-
Notifications
You must be signed in to change notification settings - Fork 80
Update compile
command to support creating taproot descriptors
#208
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
Conversation
Pull Request Test Coverage Report for Build 17544445237Details
💛 - Coveralls |
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.
Thank you for working on this @va-an .
I have left a few comments for you.
Thank you
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.
@va-an Please rebase so I can test.
Thank you.
src/handlers.rs
Outdated
assert!(EXPECTED_PK_A.contains(NUMS_UNSPENDABLE_KEY_HEX)); | ||
assert!(EXPECTED_AND_AB.contains(NUMS_UNSPENDABLE_KEY_HEX)); |
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.
I am wondering how much value these assert statements add when we are in control of the expected values ?
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.
Agreed, fixed!
@va-an , can you please make some time to update this PR? It will be great if it can get in the next release in few days. |
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.
Thank you @va-an for updating the PR.
I left minor comments.
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.
04d0301
to
3bcec61
Compare
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.
Thank you @va-an
Thank you for your patience and help! |
// This ensures the key path is effectively disabled and only script path can be used. | ||
// See https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki#constructing-and-spending-taproot-outputs | ||
|
||
let xonly_public_key = XOnlyPublicKey::from_str(NUMS_UNSPENDABLE_KEY_HEX) |
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.
I believe technically the NUMS_UNSPENDABLE_KEY_HEX
is not supposed to be used as is (privacy concerns), though for now it's fine. Per BIP-0431, should add an issue to do the following:
"In order to avoid leaking the information that key path spending is not possible it is recommended to pick a fresh integer r in the range 0...n-1 uniformly at random and use H + rG as internal key. It is possible to prove that this internal key does not have a known discrete logarithm with respect to G by revealing r to a verifier who can then reconstruct how the internal key was created."
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.
utACK 3bcec61
Description
Resolves #204.
Notes to the reviewers
For creating the tr descriptor, I used the NUMS pubkey proposed in BIP-341.
There is discussion about adding NUMS key to
rust-bicoin
, we can use it in the future from there.Also there is BIP draft for new descriptor key expression
unspendable()
for exacly this use case - we will simply use descriptortr(unspendable(), TREE)
.Changelog notice
Checklists
All Submissions:
cargo fmt
andcargo clippy
before committingNew Features:
CHANGELOG.md