| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- # Circuit used to mint arbitrary coins for given token attributes.
- k = 11;
- field = "pallas";
- constant "TokenMint_V1" {
- EcFixedPointShort VALUE_COMMIT_VALUE,
- EcFixedPoint VALUE_COMMIT_RANDOM,
- EcFixedPointBase NULLIFIER_K,
- }
- witness "TokenMint_V1" {
- # TokenAttributes {
- Base token_auth_function,
- Base token_user_data,
- Base token_blind,
- # }
- # CoinAttributes {
- Base coin_public_x,
- Base coin_public_y,
- Base coin_value,
- Base coin_spend_hook,
- Base coin_user_data,
- Base coin_blind,
- # }
- }
- circuit "TokenMint_V1" {
- # Constrain the token authority function
- constrain_instance(token_auth_function);
- # Derive the token ID
- token_id = poseidon_hash(token_auth_function, token_user_data, token_blind);
- # Then constrain that the derived minted coin contains the token ID
- coin = poseidon_hash(
- coin_public_x,
- coin_public_y,
- coin_value,
- token_id,
- coin_spend_hook,
- coin_user_data,
- coin_blind,
- );
- constrain_instance(coin);
- # At this point we've enforced all of our public inputs.
- }
|