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

SLIP-0044 Questions #351

Closed
CruiseMan opened this issue Aug 23, 2018 · 6 comments
Closed

SLIP-0044 Questions #351

CruiseMan opened this issue Aug 23, 2018 · 6 comments

Comments

@CruiseMan
Copy link

CruiseMan commented Aug 23, 2018

Can someone explain to me next questions regarding slip44

  1. What hexa stands for ?
  2. How we got 0x8000003c if in javascript converting(60).toString(16) gives "3c"
  3. What is the right way to convert 60 to 0x8000003c and in opposite direction in javascript ?
@jhoenicke
Copy link
Contributor

jhoenicke commented Aug 23, 2018

Since private derivation is used, 2^31 should be added for the hex field (see bip32 spec), e.g., ((60+(1 << 31))>>>0).toString(16) (EDIT: added >>> 0 to trick javascript into using unsigned 32-bit numbers).

@prusnak prusnak closed this as completed Aug 23, 2018
@CruiseMan
Copy link
Author

@jhoenicke @prusnak Thank you for clarification, but how to convert 0x8000003c => 60 ?.

@jhoenicke
Copy link
Contributor

jhoenicke commented Aug 23, 2018 via email

@CruiseMan
Copy link
Author

What i'm doing wrong ? parseInt("0x8000003c", 16) - (1<<31) => 4294967356

@jhoenicke
Copy link
Contributor

Javascript weirdness. try parseInt("0x8000003c", 16) - ((1<<31)>>>0)

@CruiseMan
Copy link
Author

@jhoenicke Danke

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

3 participants