From 02b80a7db8e35db012cec3a7b42ea3bb60fff2bb Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Fri, 20 Nov 2020 09:12:58 -0400 Subject: [PATCH] test: eip1581 --- test/nim/bip32.nim | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/nim/bip32.nim b/test/nim/bip32.nim index 2f69d6f..395643f 100644 --- a/test/nim/bip32.nim +++ b/test/nim/bip32.nim @@ -1,7 +1,16 @@ import ../../nim_status/lib/account import stew/[results] import secp256k1 +import eth/keys +import byteutils let seed = getSeed(Mnemonic "panda eyebrow bullet gorilla call smoke muffin taste mesh discover soft ostrich alcohol speed nation flash devote level hobby quick inner drive ghost inside") + +# This derivation path will generate a private key corresponding to wallet i=0 assert $(derive(seed, KeyPath "m/44'/60'/0'/0/0").get()) == "ff1e68eb7bf2f48651c47ef0177eb815857322257c5894bb4cfd1176c9989314" + +# This derivation path will generate a status public key +let pk = derive(seed, KeyPath "m/43'/60'/1581'/0'/0").get() +assert($pk == "38ac4da490b5c48a06d0a2fe7900c56b6639b88f6f71303590f28047411981c2") +assert($pk.toPublicKey() == "04ac5a45f2a90052cee10b22b74832f2deb814d58e35aa3f01a249160615a238aef3a34ba86e1817fc8c5a6e93e3c5f159f6c46e922c85d47bafc4b78e07718279") \ No newline at end of file