Nested witness signature path injection#45
Open
topologoanatom wants to merge 1 commit intoBlockstreamResearch:devfrom
Open
Nested witness signature path injection#45topologoanatom wants to merge 1 commit intoBlockstreamResearch:devfrom
topologoanatom wants to merge 1 commit intoBlockstreamResearch:devfrom
Conversation
24d71ba to
d6078a4
Compare
Arvolear
reviewed
Apr 8, 2026
| } | ||
| } | ||
|
|
||
| enum EitherDirection { |
Collaborator
There was a problem hiding this comment.
Let's move all this code to a new "WitnessParser" module.
Arvolear
reviewed
Apr 8, 2026
| Ok(res) | ||
| } | ||
|
|
||
| fn wrap_signature_along_path(ty: &ResolvedType, sig: Value, path: &[EitherDirection]) -> Result<Value, SignerError> { |
Collaborator
There was a problem hiding this comment.
Can this work with arbitrary values? Let's generalize the naming a bit.
Arvolear
reviewed
Apr 8, 2026
Comment on lines
+66
to
+68
| let witness = NestedSigWitness { | ||
| inherit_or_not: simplex::either::Either::Left(DUMMY_SIGNATURE), | ||
| }; |
Collaborator
There was a problem hiding this comment.
Is it possible to implement a "Default" trait for these autogenerated objects?
Arvolear
reviewed
Apr 8, 2026
Comment on lines
+552
to
+558
| for dir in path.split_ascii_whitespace() { | ||
| match dir { | ||
| "Left" | "L" | "0" => res.push(EitherDirection::Left), | ||
| "Right" | "R" | "1" => res.push(EitherDirection::Right), | ||
| _ => return Err(SignerError::WtnsSigParse), | ||
| } | ||
| } |
Collaborator
There was a problem hiding this comment.
This doesn't cover the case when the signature is inside a tuple.
Arvolear
reviewed
Apr 8, 2026
| inherit_or_not: simplex::either::Either::Right(simplex::either::Either::Right(DUMMY_SIGNATURE)), | ||
| }; | ||
|
|
||
| let spend_tx = spend_nested_sig(&context, witness, Some("Right Right".to_string()))?; |
Collaborator
There was a problem hiding this comment.
Would the path be more readable if it were an array "[Right, Right]"?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Added functionality to inject signature value from
RequiredSignatureinto nested match blocks.