You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
1.7 KiB

  1. # sigmabus-poc
  2. Proof of concept implementation of Sigmabus https://eprint.iacr.org/2023/1406, a cool idea by [George Kadianakis](https://twitter.com/asn_d6) and [Mary Maller](https://www.marymaller.com/) and [Andrija Novakovic](https://twitter.com/AndrijaNovakov6).
  3. > Experimental code, do not use in production.
  4. This PoC implements [Sigmabus](https://eprint.iacr.org/2023/1406) to prove & verify that $X = x \cdot G \in \mathbb{G}$ for a public input $X \in \mathbb{G}$ and a private input $x \in \mathbb{F}_r$ ($\mathbb{G}$'s ScalarField), while the circuit is defined on $\mathbb{F}_r$ (note that $\mathbb{G}$ coordinates are on $\mathbb{F}_q$ ($\mathbb{G}$'s BaseField)).
  5. Proving $X = x \cdot G$ with a 'traditional' approach in a zkSNARK circuit, would require non-native arithmetic for computing the scalar multiplication $x \cdot G \in \mathbb{G}$ over $\mathbb{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.
  6. Let $\mathbb{G}$ be [BN254](https://hackmd.io/@jpw/bn254)'s $G1$, an example of usage would be:
  7. ```rust
  8. // generate the trusted setup
  9. let params = Sigmabus::<Bn254>::setup(&mut rng, &poseidon_config);
  10. // compute X = x * G
  11. let x = Fr::rand(&mut rng);
  12. let X = G1Projective::generator().mul(x);
  13. // generate Sigmabus proof for X==x*G
  14. let mut transcript_p = PoseidonTranscript::<G1Projective>::new(&poseidon_config);
  15. let proof = Sigmabus::<Bn254>::prove(&mut rng, &params, &mut transcript_p, x);
  16. // verify Sigmabus proof for X==x*G
  17. let mut transcript_v = PoseidonTranscript::<G1Projective>::new(&poseidon_config);
  18. Sigmabus::<Bn254>::verify(&params, &mut transcript_v, proof, X).unwrap();
  19. ```