Taproot-related data types#666
Taproot-related data types#666dr-orlovsky wants to merge 1 commit intorust-bitcoin:masterfrom BP-WG:taproot/script
Conversation
|
Same CI error as in #646 is fuzztests unrelated to the code |
src/util/taproot.rs
Outdated
There was a problem hiding this comment.
nit:
| pub struct ScriptedPubkey { | |
| pub struct ScriptPubkey { |
There was a problem hiding this comment.
How about just naming this Taproot or Tap? ScriptedPubkey sounds strange.
There was a problem hiding this comment.
It is neither Taproot or Tap pubkey since this data type only covers variant of pubkey which has an associated script and does not cover self-tweaked single pubkey which can be used in taproot. I am also not happy with ScriptedPubkey name, but we need to somehow highlight that this is one of two options for source data in final taproot generation process from the internal key.
There was a problem hiding this comment.
A little more bikeshedding: TapScriptPubkey? (since it would only be used in the script path)
Fine with whatever name, after more thought: ScriptPubkey might be confused with scriptPubkey from BIPs
|
Concept ACK |
sanket1729
left a comment
There was a problem hiding this comment.
@dr-orlovsky, I have a more detailed implementation of the TapTree structure that I did for rust-miniscript. I can port it over the data structures to rust-bitcoin, but I feel that logic for Tree parsing, and construction utilities do belong there.
What do you think?
src/util/taproot.rs
Outdated
There was a problem hiding this comment.
Leaves themselves are not enough to construct a full tree. You also need to know how they are arranged.
I have a local implementation of TapTree structure for rust-miniscript that I can port to rust-bitcoin. I don't know if this belongs in rust-bitcoin or in rust-miniscript(descriptors).
src/util/taproot.rs
Outdated
There was a problem hiding this comment.
How about just naming this Taproot or Tap? ScriptedPubkey sounds strange.
|
@sanket1729 I also thought that constructing outputs with tapscript should belong to Rust-bitcoin should clearly allow creation of tapscript-based transaction outputs, even if these outputs are not checked against validity rules (like if they have Next, if we plan to split So yes, I think that it will be nice to have your tree script implementation to move here from miniscript (and, probably in the future, to |
|
@dr-orlovsky, I have upcoming PR(coming in the near future) that would address creating |
|
@sanket1729 Thank you for the update, I am mot working on this PR for now |
|
Closing in favor of #677 |
This PR will introduce types required for Taproot API for output construction from tapscript and internal keys. If the approach will be concept ACK, I will work on the implementation (merklization of script data + using these types in address construction)