membership_proof.zk 754 B

12345678910111213141516171819202122232425262728
  1. # SPDX-License-Identifier: AGPL-3.0-only
  2. # The k parameter defining the number of rows used in our circuit (2^k)
  3. k = 11;
  4. field = "pallas";
  5. # The constants we define for our circuit
  6. constant "MembershipProof" {
  7. # We use this generator for public key derivation
  8. EcFixedPointBase NULLIFIER_K,
  9. }
  10. # The witness values we define in our circuit
  11. witness "MembershipProof" {
  12. # The secret key we use to derive the public key
  13. Base secret_key,
  14. }
  15. # The definition of our ZK circuit
  16. circuit "MembershipProof" {
  17. # Derive the public key
  18. public_key = ec_mul_base(secret_key, NULLIFIER_K);
  19. # Constrain the public key coordinates.
  20. # These are our circuit's public inputs.
  21. constrain_instance(ec_get_x(public_key));
  22. constrain_instance(ec_get_y(public_key));
  23. }