Update bitcoin_hashes to 1.0#282
Open
apoelstra wants to merge 3 commits into
Open
Conversation
In ElementsProject#279 we fixed some slicing bugs in a fairly ugly way so that we could easily backport the bugfixes without API breakage. However, the better solution is to close the RangeProofMessage type, add a dedicated error for parsing from an array, and update all callers. This changes the CT validation logic to allow rangeproofs to contain embedded asset IDs alongside explicit assets. This differs from Elements which only allows unblinding an output if both its value and asset commitment are confidential. However, if the confidential asset is explicit, it seems like the "right thing to do" to embed the asset ID and a zero blinding factor. This matches what we do in this library in TxIn::blind_issuances_with_bfs for example.
This is a fairly big commit but it's mostly mechanical and it didn't seem super helpful to pull it out into multiple commits. The bulk of the prepatory work was done in ElementsProject#278.
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.
As part of our project to modernize this library and its dependencies, upgrade to bitcoin_hashes 1.0. This has a number of API improvements:
Hashtrait methods with inherent methods so you don't need to import a trait anymorefrom_slicemethods with infalliblefrom_byte_arraymethodshashmethod and other "compute a hash from arbitrary data" methods on wrapper types likeTxid; these should only be constructed in specific prescribed waysAlso includes a followup commit to #279 to improve error typing.