-
Notifications
You must be signed in to change notification settings - Fork 182
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
Update encode_qr.py - Adds comments to code (Fixes #582) #643
base: dev
Are you sure you want to change the base?
Conversation
Some helpers comments.
@jdlcdl you mention And now that I take a second look at PR #610, is |
Thank you for your advices, done! |
I had not given this as much thought as @fedebuyito and @newtonick did. My thoughts were to include the "use_info" context (which network is this pubkey for?) in all cases, but it would make the qrcode even bigger for mainnet, whereas that's the only reasonable default without an explicit "use_info". That it's only included for testnet seems a much better solution than my original thoughts. |
It does not seem to refer to the cointype of the derivation path but to the hrp of the xpub according to the code in urtypes/crypto/hd_key.HDKey class here: https://github.com/selfcustody/urtypes/blob/8ff8e6ebe484d7a0f98ad73f4441708704998b43/src/urtypes/crypto/hd_key.py#L112, where setting use_info=None or use_info.network=0 would apply MAINNET; otherwise, TESTNET. Perhaps we could add to the comment (df36c1a) that, for TESTNET, network must not be 0: On the other hand, remembering the conversation with @Newtonic, it was recommended to skip "use_info" for mainnet according to https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-007-hdkey.md; different from setting it to "None" as it is now. We could effectively bypass "use_info" with this last conditional argument on code below: self.ur_hdkey = HDKey({ I have probe it and works fine and doesn't affect the QR exported. Maybe it's better implemented this way. I read your opinions, of course, so you can tell me what you think is good. |
Some helpers comments.
Description
Some additional helpers comments on code. (Relative to issue #582, fixed on #610)
This pull request is categorized as a:
Checklist
If you modified or added functionality/workflow, did you add new unit tests?
I have tested this PR on the following platforms/os:
Note: Keep your changes limited in scope; if you uncover other issues or improvements along the way, ideally submit those as a separate PR. The more complicated the PR the harder to review, test, and merge.