diff --git a/circom_circuits/Mantle/generate_inputs_for_shielded_transaction.py b/circom_circuits/Mantle/generate_inputs_for_shielded_transaction.py index caa2a62..096cdf6 100755 --- a/circom_circuits/Mantle/generate_inputs_for_shielded_transaction.py +++ b/circom_circuits/Mantle/generate_inputs_for_shielded_transaction.py @@ -212,7 +212,7 @@ maxInputs = int(sys.argv[Integer(1)]) maxOutputs = int(sys.argv[Integer(2)]) value_in = [F(randrange(0,10000,1) )for i in range(maxInputs) ] -unit = F(19676183153323264216568033390884511718872104179761154996527087027500271872825) +unit = F(10779557959052216631390333682740231728667240537997953966056427002575892499162) state_in = [F(randrange(0,p,1)) for i in range(maxInputs) ] zone_in = [F(randrange(0,p,1)) for i in range(maxInputs) ] note_nonce_in = [F(randrange(0,p,1)) for i in range(maxInputs)] @@ -244,8 +244,7 @@ is_a_output_note[0] = F(1) with open("input.json", "w") as file: - file.write('{\n\t"minting_covenant" :\t\t\t\t"'+str(0)+'",') - file.write('\n\t"burning_covenant" :\t\t\t\t"'+str(0)+'",') + file.write('{\n\t"unit_arg_cm" :\t\t\t\t"'+str(0)+'",') file.write('\n\t"state_in" :\t\t\t\t\t[') for i in range(maxInputs): file.write('"') diff --git a/circom_circuits/Mantle/ownership.circom b/circom_circuits/Mantle/ownership.circom index 0ab0e6b..b0cc80e 100644 --- a/circom_circuits/Mantle/ownership.circom +++ b/circom_circuits/Mantle/ownership.circom @@ -23,4 +23,4 @@ template proof_of_unshielded_note_ownership(maxInput){ dummy <== attached_data * attached_data; } -component main {public [attached_data]}= proof_of_unshielded_note_ownership(1); \ No newline at end of file +component main {public [attached_data]}= proof_of_unshielded_note_ownership(5); \ No newline at end of file diff --git a/circom_circuits/Mantle/shielded_transaction.circom b/circom_circuits/Mantle/shielded_transaction.circom index a297570..c90d24c 100644 --- a/circom_circuits/Mantle/shielded_transaction.circom +++ b/circom_circuits/Mantle/shielded_transaction.circom @@ -6,8 +6,7 @@ include "../misc/constants.circom"; template shielded_transaction(maxInputs, maxOutputs){ - signal input minting_covenant; // Used to derive the unit and make sure the token use a no-op spending covenant. - signal input burning_covenant; + signal input unit_arg_cm; // Used to derive the unit and make sure the token use a no-op spending covenant. //consummed notes // notes themselves @@ -40,9 +39,10 @@ template shielded_transaction(maxInputs, maxOutputs){ //Derive the unit component derive_unit = derive_unit(); - derive_unit.minting_covenant <== minting_covenant; + derive_unit.minting_covenant <== 0; derive_unit.spending_covenant <== 0; // 0 encodes the fact that it's a no-op transfer covenant - derive_unit.burning_covenant <== burning_covenant; + derive_unit.burning_covenant <== 0; + derive_unit.unit_arg_cm <== unit_arg_cm; unit <== derive_unit.out; diff --git a/circom_circuits/ledger/notes.circom b/circom_circuits/ledger/notes.circom index 350a1cb..8135034 100644 --- a/circom_circuits/ledger/notes.circom +++ b/circom_circuits/ledger/notes.circom @@ -57,14 +57,16 @@ template derive_unit(){ signal input minting_covenant; signal input spending_covenant; signal input burning_covenant; + signal input unit_arg_cm; signal output out; - component hash = Poseidon2_hash(4); + component hash = Poseidon2_hash(5); component dst = NOMOS_UNIT(); hash.inp[0] <== dst.out; hash.inp[1] <== minting_covenant; hash.inp[2] <== spending_covenant; hash.inp[3] <== burning_covenant; + hash.inp[4] <== unit_arg_cm; out <== hash.out; }