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
Add checksum to getdescriptorinfo #15986
Conversation
So the only reason I didn't write it this way, is that people have said they don't want private keys to be echoed in the output. Personally I think this is fine -- the only way to get a private key in the output, is if you include it in the input. And in fact, there has to be SOME way to get private keys echoed back, if you want to be able to get checksums for descriptors with private keys included. So I'd advocate for this PR the way it is, but if people aren't comfortable with it, I'd suggest adding a flag, and not echoing descriptors with private keys unless the flag is set. Thanks! (Tagging #15740 for the record.) |
utACK 15c482e |
Concept ACK. Light preference for returning only the checksum rather than echoing a private key. But I do agree with @gwillen's point:
I find the extra |
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
I'm confused by this, getdescriptorinfo already adds a checksum if it's missing? |
@jb55 It also normalizes the descriptor (which among other things turns WIP into pubkey, and xprv into xpub) |
ah ok that was the bit I was missing
|
Code Review ACK 15c482e I would prefer if there were also a test where the descriptor were slightly modified (e.g. replacing |
Tested ACK 15c482e |
I like the suggestion of instead just reporting the checksum for the unmodified descriptor, and not echoing anything back. Since this has been reviewed already, I'm happy to go either way. What do reviewers think? |
I prefer this because it is unambiguous as to what the checksum belongs to and what the descriptor with with checksum will look like. |
15c482e
to
26d3fad
Compare
Updated to instead add a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 26d3fad
@@ -136,6 +136,7 @@ UniValue getdescriptorinfo(const JSONRPCRequest& request) | |||
RPCResult{ | |||
"{\n" | |||
" \"descriptor\" : \"desc\", (string) The descriptor in canonical form, without private keys\n" | |||
" \"checksum\" : \"chksum\", (string) The checksum for the input descriptor\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: did you really mean chksum
?
Code Review ACK 26d3fad |
Two wallet reviewer ACKs here; @meshcollider want to take a final look? I've compiled to check that there aren't any silent merge conflicts etc. |
re-Code Review ACK 26d3fad |
26d3fad Add unmodified-but-with-checksum to getdescriptorinfo (Pieter Wuille) 104b3a5 Factor out checksum checking from descriptor parsing (Pieter Wuille) Pull request description: ACKs for top commit: achow101: Code Review ACK 26d3fad meshcollider: re-Code Review ACK 26d3fad Sjors: ACK 26d3fad Tree-SHA512: b7a7f89b64a184927d6f9a0c183a087609983f0c5d5593f78e12db4714e930a4af655db9da4b0c407ea2e24d3b926cef6e1f2a15de502d0d1290a6e046826b99
26d3fad Add unmodified-but-with-checksum to getdescriptorinfo (Pieter Wuille) 104b3a5 Factor out checksum checking from descriptor parsing (Pieter Wuille) Pull request description: ACKs for top commit: achow101: Code Review ACK 26d3fad meshcollider: re-Code Review ACK 26d3fad Sjors: ACK 26d3fad Tree-SHA512: b7a7f89b64a184927d6f9a0c183a087609983f0c5d5593f78e12db4714e930a4af655db9da4b0c407ea2e24d3b926cef6e1f2a15de502d0d1290a6e046826b99
Github-Pull: bitcoin#15986 Rebased-From: 104b3a5
Github-Pull: bitcoin#15986 Rebased-From: 26d3fad
Summary: bitcoin/bitcoin@104b3a5 --- Partial backport of Core [[bitcoin/bitcoin#15986 | PR15986]] Test Plan: ninja check-all Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Subscribers: Fabien Differential Revision: https://reviews.bitcoinabc.org/D6622
Summary: bitcoin/bitcoin@26d3fad --- Depends on D6622 Concludes backport of Core [[bitcoin/bitcoin#15986 | PR15986]] Test Plan: ninja check ninja test_runner.py wallet_address_types Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D6623
No description provided.