mimblewimble / rust-secp256k1-zkp

ZKP fork for rust-secp256k1, adds wrappers for range proofs, pedersen commitments, etc
Creative Commons Zero v1.0 Universal
57 stars 51 forks source link

new API in secp to convert commitments to public keys safely #14

Closed garyyu closed 6 years ago

garyyu commented 6 years ago

To complete the TODO item: need an API in secp to convert commitments to public keys safely. a commitment is prefixed 08/09 and public keys are prefixed 02/03.

A new function secp256k1_pedersen_commitment_to_pubkey is added into repo secp256k1-zkp and have sent pull request #15 on repo secp256k1-zkp .

Related ffi function secp256k1_pedersen_commitment_to_pubkey is added, function to_pubkey is modified and that workaround function to_two_pubkeys is removed.

tests runs OK for 10 times. test result: ok. 46 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

yeastplume commented 6 years ago

hi @garyyu Thanks for taking this on, and from what I can tell it looks like it's doing the right thing. We need to test this within Grin and integrate it end-to-end, but since I'm working on libsecp a bit right now I can slip this in and test via the PR I'm working on at the moment.

Thanks!

antiochp commented 6 years ago

Nice!