Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mnemonic compatibility issues #2751

Open
RichardBelsum opened this issue Jan 3, 2025 · 1 comment
Open

Mnemonic compatibility issues #2751

RichardBelsum opened this issue Jan 3, 2025 · 1 comment

Comments

@RichardBelsum
Copy link

test cruise rely brand crazy spoon soda flee congress spawn lady curious This mnemonic imports
https://iancoleman.io/bip39/ (manually enter the derived path m/44'/888'/0'/0/0), OneGate, https://neo.org/converter generates the same address NUzy2Ns2D35BTdFVqDhUCRoZb1cmix2cXS (WIF: L3QZ4s4qgK5ggT2SnPL6nLEdTdhQeogssCgCJmYhDwVneR49MQCD)

After importing neon it is another address NNp3qhpb7YjTg311KKaTuo8Qh1Ra7a7Reo

What step is wrong?

image image image image
@RichardBelsum
Copy link
Author

I figured out that neonjs references the Moonlight-io/asteroid-sdk-js library.
Moonlight-io/asteroid-sdk-js which has some problems with the Bip32 implementation.

  • First the masterkey's fingerprint should be 4 bytes [0,0,0,0], it writes it as [46], which is the ASCII code for '0'. bip32 and asteroid-sdk-js
  • Then the key for the HMACSHA512 algorithm was changed from Bitcoin seed to Nist256p1 seed code
  • Then, the curve used to derive the path is Secp256r1, and in Bitcoin's Bip32 it is Secp256k1 code
  • Another point is that it handles BigInteger a little differently, which also creates compatibility issues code

2 and 3 should be considered parameter changes for neo, 1 and 4 should be considered bugs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant