Skip to content

Files

Latest commit

f87a71f · Sep 29, 2023

History

History
27 lines (19 loc) · 1.7 KB

README.md

File metadata and controls

27 lines (19 loc) · 1.7 KB

sigmabus-poc

Proof of concept implementation of Sigmabus https://eprint.iacr.org/2023/1406, a cool idea by George Kadianakis and Mary Maller and Andrija Novakovic.

Experimental code, do not use in production.

This PoC implements Sigmabus to prove & verify that X = x G G for a public input X G and a private input x F r ( G 's ScalarField), while the circuit is defined on F r (note that G coordinates are on F q ( G 's BaseField)).

Proving X = x G with a 'traditional' approach in a zkSNARK circuit, would require non-native arithmetic for computing the scalar multiplication x G G over F r , which would take lot of constraints. The number of constraints in the circuit for this Sigmabus instantiation mainly depends on the constraints needed for 2 Poseidon hashes.

Let G be BN254's G 1 , an example of usage would be:

// generate the trusted setup
let params = Sigmabus::<Bn254>::setup(&mut rng, &poseidon_config);

// compute X = x * G
let x = Fr::rand(&mut rng);
let X = G1Projective::generator().mul(x);

// generate Sigmabus proof for X==x*G
let mut transcript_p = PoseidonTranscript::<G1Projective>::new(&poseidon_config);
let proof = Sigmabus::<Bn254>::prove(&mut rng, &params, &mut transcript_p, x);

// verify Sigmabus proof for X==x*G
let mut transcript_v = PoseidonTranscript::<G1Projective>::new(&poseidon_config);
Sigmabus::<Bn254>::verify(&params, &mut transcript_v, proof, X).unwrap();