Files
darkfi/example/wasm-hello-world/proof/secret_commitment.zk
2024-06-04 12:18:41 +02:00

25 lines
611 B
Plaintext

# The k parameter defining the number of rows used in our circuit (2^k)
k = 11;
field = "pallas";
# The constants we define for our circuit
constant "SecretCommitment" {
EcFixedPointBase NULLIFIER_K,
}
# The witness values we define in our circuit
witness "SecretCommitment" {
# Secret key used to derive the public key
Base secret,
}
# The definition of our circuit
circuit "SecretCommitment" {
# Derive the public key
pub = ec_mul_base(secret, NULLIFIER_K);
# Constrain the public key coordinates
constrain_instance(ec_get_x(pub));
constrain_instance(ec_get_y(pub));
}