Manually implement is_uncompressed for BitcoinKey#666
Merged
Conversation
The `interpreter::BitcoinKey` uses the default implementation of `MiniscriptKey`, which means `is_uncompressed` returns `false`. However if the full key is a `bitcoin::PublicKey` it may be compressed. Manually implement `MiniscriptKey::is_uncompressed` for `BitcoinKey` and return the compressedness of the inner full key.
Member
|
We may want to just remove the default impl. I think it may have been there to avoid a breaking change in the trait a long time ago. |
apoelstra
approved these changes
Mar 28, 2024
heap-coder
added a commit
to heap-coder/rust-miniscript
that referenced
this pull request
Sep 27, 2025
…essed for BitcoinKey
52198dd62da7c4066f6f04fc38aa418480a5e5af Manually implement is_uncompressed for BitcoinKey (Tobin C. Harding)
Pull request description:
The `interpreter::BitcoinKey` uses the default implementation of `MiniscriptKey`, which means `is_uncompressed` returns `false`. However if the full key is a `bitcoin::PublicKey` it may be compressed.
Manually implement `MiniscriptKey::is_uncompressed` for `BitcoinKey` and return the compressedness of the inner full key.
Originally done, and discussed, in #620.
ACKs for top commit:
apoelstra:
ACK 52198dd62da7c4066f6f04fc38aa418480a5e5af
Tree-SHA512: 59f514d24120cfc452e60c361f851280b0515e4b63eb5d2a94d84e39821e6c80f3af07eee5fc5f80bd7198d2e09c6e4465f6f6ef3e8f38dba87ef77a2e1a3b9a
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.
The
interpreter::BitcoinKeyuses the default implementation ofMiniscriptKey, which meansis_uncompressedreturnsfalse. However if the full key is abitcoin::PublicKeyit may be compressed.Manually implement
MiniscriptKey::is_uncompressedforBitcoinKeyand return the compressedness of the inner full key.Originally done, and discussed, in #620.