secret_commitment.zk 611 B

123456789101112131415161718192021222324
  1. # The k parameter defining the number of rows used in our circuit (2^k)
  2. k = 11;
  3. field = "pallas";
  4. # The constants we define for our circuit
  5. constant "SecretCommitment" {
  6. EcFixedPointBase NULLIFIER_K,
  7. }
  8. # The witness values we define in our circuit
  9. witness "SecretCommitment" {
  10. # Secret key used to derive the public key
  11. Base secret,
  12. }
  13. # The definition of our circuit
  14. circuit "SecretCommitment" {
  15. # Derive the public key
  16. pub = ec_mul_base(secret, NULLIFIER_K);
  17. # Constrain the public key coordinates
  18. constrain_instance(ec_get_x(pub));
  19. constrain_instance(ec_get_y(pub));
  20. }