Skip to content
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

Misc cleanups, add rawtr()/tr(k) descriptor support #474

Merged
merged 15 commits into from
Jan 27, 2025
Merged

Conversation

jgriffiths
Copy link
Contributor

@jgriffiths jgriffiths commented Jan 23, 2025

Adds rawtr() and tr(k) initially, as the simplest of the taproot descriptor cases.

tr(k,script) will be added in a future MR.

@jgriffiths jgriffiths changed the title Misc cleanups, add rawtr() Misc cleanups, add rawtr()/tr(k) descriptor support Jan 24, 2025

Verified

This commit was signed with the committer’s verified signature.
menof36go Fabian Reinbold

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was signed with the committer’s verified signature.
menof36go Fabian Reinbold
We must differentiate between x-only being allowed, mandatory, and not
allowed, so the logic is a little more complex.

If we get a compressed (non-x-only) hex key for a rawtr() expression, convert
it in-place to an x-only key to make future handling simpler.
This is to support rawtr() which can be given either an x-only or
compressed (non-x-only) key.
Also extend the pk() test cases to cover the new x-only behaviour for
non-taproot descriptors.
raw() with no arguments generates a zero length script. Ensure we tell
the caller they need at least one byte of generation space for this
case, otherwise they would be passing an invalid (empty) output buffer.
Use a freshly allocated buffer of the computed size to allocate into, so
valgrind can warn us of any errant writes.

Also add a testcase for a simple key push without CHECKSIG.
@jgriffiths jgriffiths merged commit 6da0029 into master Jan 27, 2025
5 checks passed
@jgriffiths jgriffiths deleted the taproot_btc branch January 27, 2025 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant