This can be used for UTXO commitments.
Specification at
https://github.com/tomasvdw/bips/blob/master/ecmh.mediawiki
Differential D1072
Add ECMH multiset module to libsecp256k1 tomtomtom7 on Feb 9 2018, 12:55. Authored by
Details
This can be used for UTXO commitments. Specification at Tests included
Diff Detail
Event TimelineThere are a very large number of changes, so older changes are hidden. Show Older Changes
Comment Actions I am a bit uncertain about finalize. Is there actually a point in hashing? We could also just return the X value. This means set A collides with "negative" set A but negative sets are only intermediates, so if you are finalizing them something is already terribly wrong.
Comment Actions Please make sure the style match the rest of libsecp256k1. The comments and various other things do not match. They are also various weird empty lines. Except that and the test that needs some improvement, I think we have a great piece of software here. I'd like for someone else to review this as it's very critical.
Comment Actions
TODO
Comment Actions Here is the relevant discussion on Bitcoin Core, just for reference. Comment Actions ACK: Code review, testing, and a lot of playing... My only suggestion is to consider using compressed pub key encoding for finalizing instead of hashing. Then the result will be 33bytes long (consisting of 0x02 (Y is even) or 0x03 (Y is odd), followed by 32 bytes for the X coordinate.). It depends whether we want the multiset to be able to continue to be built after finalization (ie: if you receive a multiset from the networt if you will be able to continue building from it) Comment Actions
Curious yet not surprising. My first introduction to CMake has resulted in a long and bloody war. I thought I had won, but the bastard keeps pulling new tricks from its sleeve. I'll give it another try. Comment Actions I think we should just return an all zero vector for the empty set instead of hashing zeros. In addition, providing test vector for ge_from_data_var is valuable, IMO as it'll help anyone who wish to implement.
Comment Actions Return 0 instead of SHA(0) for the empty multiset
Comment Actions I don't think I have anything to add here. It looks good to me. I will leave some time for someone else to shime in before accepting, due to the fact this code is sensible, but I do not have anything else to add.
Comment Actions Changed testvector 3 input and output This way it correctly represents the serialization of UTXOs and |