Update compile command to support creating taproot descriptors#208
Conversation
Pull Request Test Coverage Report for Build 17544445237Details
💛 - Coveralls |
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.
I am wondering how much value these assert statements add when we are in control of the expected values ?
|
@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. |
04d0301 to
3bcec61
Compare
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.
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."
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 fmtandcargo clippybefore committingNew Features:
CHANGELOG.md