-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
PSBT support for deterministic bitcoin commitments (tapret and opret) #9
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #9 +/- ##
========================================
- Coverage 52.7% 0.0% -52.7%
========================================
Files 20 17 -3
Lines 2849 3143 +294
========================================
- Hits 1501 0 -1501
- Misses 1348 3143 +1795
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
Can you check to see if these changes affect the ~250,000 MPC contract limit?
@@ -112,6 +120,13 @@ impl<'a> IntoIterator for &'a TapTree { | |||
} | |||
|
|||
impl TapTree { | |||
pub fn with_single_leaf(leaf: impl Into<LeafScript>) -> TapTree { | |||
Self(vec![LeafInfo { | |||
depth: u7::ZERO, |
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.
This is really a u7?
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.
Yes, since taptree can have up to 127 levels (and up to 2^127 leafs)
pub fn with_capacity(capacity: usize) -> Self { | ||
Self { | ||
leafs: Vec::with_capacity(capacity), | ||
buoy: zero!(), |
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.
What is buoy?
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.
A helper structure that assists in constructing and merging merkle trees
I will, but I do not see in any way how they can be affected by this code. It is BP library, not RGB, it has nothing to do with contracts. It just follows Bitcoin consensus and BIPs - that's it |
Sorry, wrong repo. Yes, the part you commented on is about DBCs and thus related to RGB contracts. But there is nothing which can affect it since the work is done in It is like libwally can't restrict the way Bitcoin consensus works |
I see. This is high level and wouldn't affect consensus beyond what's specified in this library. I think I'm also confused, thank you for the clarification. |
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.
All questions addressed.
ACK
psbt/src/csval/tapret.rs
Outdated
/// the value of tapret commitment has invalid length. | ||
InvalidCommitment, | ||
|
||
/// Using non-empty taptree is not supported in RGB v0.10. Please update. |
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.
Does this prerequisite remain in later versions?
/// Using non-empty taptree is not supported in RGB v0.10. Please update. | |
/// Using non-empty taptree is not supported in RGB v0.10 or later. Please update. |
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.
Maybe "is not yet supported" without a specific version? At the end this is not even an RGB library...
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.
Yes, does make sense.
We will revisit this topic when we support script-path spend, right?
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.
Yes. This should be done right after v0.11 release. For now I just wanted to save time and do this non-trivial thing later when we have at least basic functionality working.
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.
Yes. This should be done right after v0.11 release. For now I just wanted to save time and do this non-trivial thing later when we have at least basic functionality working.
Yes, I agree with you, better focus on this topic later, because the rgb v0.11 topic is the epic of epics =)
Finally completed the work on doing everything necessary for DBCs and MPCs in PSBTs. This is prerequisite for completing RGB support in PSBT and last bit of RGB wallet functionality