This repository was archived by the owner on Nov 30, 2022. It is now read-only.
Merged
Conversation
47d6f6d to
effe044
Compare
Contributor
|
Is there anything that prevents this from being merged? |
Member
|
I'd prefer there be a real system out there (even a branch of elements where we can launch a regtest node) so we can test the API in the wild. |
Contributor
|
We are using tagged hashes in RGB: https://github.com/LNP-BP/lnpbps/blob/master/lnpbp-0001.md |
dr-orlovsky
suggested changes
Jan 25, 2020
This was referenced Jan 25, 2020
dr-orlovsky
suggested changes
Jan 25, 2020
Contributor
dr-orlovsky
left a comment
There was a problem hiding this comment.
This will work with the fix from stevenroose#3
Collaborator
Author
|
Thanks, @dr-orlovsky! This PR should be good for review then! |
Member
|
Can you add a unit test which actually implements this |
Collaborator
Author
|
I added the tapleaf hash as an example. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Introducing a new
SHA256thash type that works as a tagged hash. The idea of tagged hashes is to prevent collisions between hashes meant for different purposes. This type allows tagging these hashes using Rust's type system so that they are semantically different from each other and can't be confused.It also enables seamless efficient calculation of these hashes.
The
Tag::engine()method should return aHashEnginethat is prefilled with data. Of course, it is supposed to have this data statically initialized instead of calculated on call.Example usage: rust-bitcoin/rust-bitcoin#259