sigma_protocol_homomorphism - [devnet]
此内容尚不支持你的语言。
This module can be used to build -protocols for proving knowledge of a pre-image on a homomorphism .
Let denote the set of public statements.
This module helps you convince a verifier with that you know a secret such that , where:
is a homomorphism, and is a transformation function.
Many useful statements can be proved in ZK by framing them as proving knowledge of a pre-image on a homomorphism:
e.g., a Schnorr signature is just proving knowledge of such that , where the PK is .
e.g., a proof that both Pedersen-commit to the same is proving knowledge of s.t.
The sigma protocol is very simple:
- ------------------ + + ------------------------------------------------ + | Prover has | | Verifier has |
- ------------------ + | |
- ------------------------------------------------ +
-
Sample $\alpha \in \mathbb{F}^k
-
Compute commitment
-
send commitment ------------------------------->
-
Assert
-
Pick random challenge (via Fiat-Shamir on: a protocol identifier and a session identifier)
-
send challenge <-------------------------------
-
Compute response
-
send response ------------------------------->
-
Check
use 0x1::sigma_protocol_representation_vec;use 0x1::sigma_protocol_statement;use 0x1::sigma_protocol_witness;Structs
TransformationFunction
The transformation function
struct TransformationFunction<P>Fields
Homomorphism
The homomorphism
struct Homomorphism<P>