mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-01-09 22:57:59 -05:00
27 lines
625 B
Plaintext
27 lines
625 B
Plaintext
k = 13;
|
|
|
|
constant "TokenFreeze_V1" {
|
|
EcFixedPointBase NULLIFIER_K,
|
|
}
|
|
|
|
witness "TokenFreeze_V1" {
|
|
# Token mint authority secret
|
|
Base mint_authority,
|
|
}
|
|
|
|
circuit "TokenFreeze_V1" {
|
|
# TokenID derivation path (See darkfi_sdk::crypto::ContractId)
|
|
derivation_path = witness_base(69);
|
|
|
|
# Derive public key for the mint authority
|
|
mint_public = ec_mul_base(mint_authority, NULLIFIER_K);
|
|
mint_x = ec_get_x(mint_public);
|
|
mint_y = ec_get_y(mint_public);
|
|
constrain_instance(mint_x);
|
|
constrain_instance(mint_y);
|
|
|
|
# Derive the token ID
|
|
token_id = poseidon_hash(derivation_path, mint_x, mint_y);
|
|
constrain_instance(token_id);
|
|
}
|