vulpemventures / go-elements

Go support for Liquid/Elements transactions
MIT License
29 stars 13 forks source link

Methods for external verification of surjection proofs #142

Closed altafan closed 3 years ago

altafan commented 3 years ago

At the moment, the library does verify surjection proofs once generated, but doesn't let the user perform such verification.

We need to expose a VerifySurjectionProof method in the confidential pkg accepting in/out assets and asset blinders as bytes, a proof as byte that basically wraps the respective method of the go-secp256 library.

Also, a ValidateBlinding function needs to be added to the pset's blinder expecting a pset object, and a list of in/out private blinding keys that unblinds all the inputs and outputs of the tx and calls the new method defined in the confidential pkg. This way we validate both range and surjection proofs at once.