EYBlockchain / nightfall_3

a mono-repo containing an optimistic version of nightfall
Creative Commons Zero v1.0 Universal
261 stars 57 forks source link

BIP39 bug #1381

Closed Westlad closed 1 year ago

Westlad commented 1 year ago

Describe the bug The BIP39 implementation in Nightfall client is non-standard because of the way that it encodes strings. It would be good if it matched other BIP39 implementations (e.g. the Nightfall wallet).

Additional context The fix is pretty simple. This line is casting to a hex_string (which is not 0x prefixed) when it shouldn't, this leads to the bip39 package (which expect a bytes) to parse a utf-8 string as a bytestring. keys.mjs

      const seed = mnemonicToSeedSync(mnemonic).toString('hex');