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

Feature Request: Add Root Fingerprint to Output #23

Closed
mflaxman opened this issue Aug 20, 2020 · 8 comments
Closed

Feature Request: Add Root Fingerprint to Output #23

mflaxman opened this issue Aug 20, 2020 · 8 comments

Comments

@mflaxman
Copy link

It turns out this is required for interoperability with Coldcard as well as Spectre.

The easiest way to do this now is as follows, but it's obviously sketchy (destroys much of the security benefit of seedpicker!):

  1. Calculate last word for abandon repeated 23x here (will correctly return art):
    http://seedpicker.net/calculator/last-word.html
  2. Open up an Electrum console and input 24 words into this script:
>> from electrum import keystore
>> ks = keystore.from_bip39_seed("abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon art", passphrase="", derivation="m/48'/0'/0'/2'")
>> ks.get_root_fingerprint()
'5436d724'

Screen Shot 2020-08-20 at 10 52 49 AM

Code snippet on how to calculate root fingerpint here:
https://github.com/spesmilo/electrum/blob/9d0bb295e6f55a2bff9f5b6770fa744c16af6e8a/electrum/keystore.py#L685-L690

This one may be easier to read:
https://github.com/lyndsysimon/bip32utils/blob/56f5a56d1c54e648f35b670a87efabbca08fffae/bip32utils/BIP32Key.py#L244-L266

Maybe for UX purposes, you'd want to hide this behind Show more (for advanced users)?

@merland
Copy link
Owner

merland commented Aug 21, 2020

Thanks for this feature request. I'd be happy to implement it, seems straightforward. Agree that it would fit under Show more, for now anyway. A bit occupied with other projects but will try to fit it in.
Also: thanks for mentioning SeedPicker on btcguide! :)

@mflaxman
Copy link
Author

mflaxman commented Aug 21, 2020

Forgot to mention my own code snippet in golang to calculate this (just research code not cleaned up yet, but in case it helps)!

https://github.com/mflaxman/human-rng-golang

@merland
Copy link
Owner

merland commented Aug 26, 2020

I'm not so good at python (or golang), so I thought I'd look up the standard recipe for cooking a root fingerprint. Is this in any of the BIPs? I couldn't find it.

@mflaxman
Copy link
Author

There isn't really, it's just something coldcard picked up for registering xpubs in a multisig and then Spectre copied :(

Maybe this 2-line code snippet is more clear? It's the master parent xpub (no derivation needed).

https://github.com/cryptoadvance/specter-desktop/blob/5cc92c989f6d071da6d936c06e0ba5629f03b7ce/src/cryptoadvance/specter/helpers.py#L126-L128

@merland
Copy link
Owner

merland commented Aug 27, 2020

This was really helpful, thanks!
I was able to run the specter snippet and got a js unit test working now.

@merland
Copy link
Owner

merland commented Aug 31, 2020

This is implemented on seedpicker.net now (Cache reset may be necessary).
Please advise on wording and appearance.

@mflaxman
Copy link
Author

The functionality looks great, thanks! I tested it against my python and golang scripts for zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo buddy and it correctly returns 669dce62.

I did notice a security vulnerability on this PR that I think should be addressed ASAP:
8421201#r41919841

@mflaxman
Copy link
Author

mflaxman commented Sep 2, 2020

Btw, I'm closing this as it's done, right? Love the new feature!

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

2 participants