From 3d24ed3977428a411102736c91daa734e63a91ff Mon Sep 17 00:00:00 2001 From: thomaslavaur Date: Wed, 13 May 2026 09:23:05 +0200 Subject: [PATCH] update circuits to what is live on master --- .../{Blend => blend}/generate_inputs_for_poq.py | 12 +++++------- circom_circuits/{Blend => blend}/poq.circom | 7 +++---- .../{Mantle => mantle}/generate_inputs_for_pol.py | 0 .../generate_inputs_for_proof_of_claim.py | 0 .../generate_inputs_for_signature.py | 0 circom_circuits/{Mantle => mantle}/poc.circom | 0 circom_circuits/{Mantle => mantle}/pol.circom | 0 circom_circuits/{Mantle => mantle}/pol_lib.circom | 0 circom_circuits/{Mantle => mantle}/signature.circom | 0 circom_circuits/misc/comparator.circom | 2 +- 10 files changed, 9 insertions(+), 12 deletions(-) rename circom_circuits/{Blend => blend}/generate_inputs_for_poq.py (97%) rename circom_circuits/{Blend => blend}/poq.circom (93%) rename circom_circuits/{Mantle => mantle}/generate_inputs_for_pol.py (100%) rename circom_circuits/{Mantle => mantle}/generate_inputs_for_proof_of_claim.py (100%) rename circom_circuits/{Mantle => mantle}/generate_inputs_for_signature.py (100%) rename circom_circuits/{Mantle => mantle}/poc.circom (100%) rename circom_circuits/{Mantle => mantle}/pol.circom (100%) rename circom_circuits/{Mantle => mantle}/pol_lib.circom (100%) rename circom_circuits/{Mantle => mantle}/signature.circom (100%) diff --git a/circom_circuits/Blend/generate_inputs_for_poq.py b/circom_circuits/blend/generate_inputs_for_poq.py similarity index 97% rename from circom_circuits/Blend/generate_inputs_for_poq.py rename to circom_circuits/blend/generate_inputs_for_poq.py index 4d94a2a..c364be6 100644 --- a/circom_circuits/Blend/generate_inputs_for_poq.py +++ b/circom_circuits/blend/generate_inputs_for_poq.py @@ -206,14 +206,13 @@ def PoseidonSponge(data, capacity, output_len): # ——————————————————————— # Main # ——————————————————————— -if len(sys.argv) != 5: - print("Usage: python3 generate_inputs_for_poq.py ") +if len(sys.argv) != 4: + print("Usage: python3 generate_inputs_for_poq.py ") sys.exit(1) -session = int(sys.argv[1]) -Qc = int(sys.argv[2]) -Ql = int(sys.argv[3]) -core_or_leader = int(sys.argv[4]) +Qc = int(sys.argv[1]) +Ql = int(sys.argv[2]) +core_or_leader = int(sys.argv[3]) if not core_or_leader in [0,1]: print("core or leader must be 0 or 1") sys.exit(1) @@ -280,7 +279,6 @@ K_two = F(654321) # 5) Assemble JSON inp = { - "session": str(session), "core_quota": str(Qc), "leader_quota": str(Ql), "core_root": str(core_root), diff --git a/circom_circuits/Blend/poq.circom b/circom_circuits/blend/poq.circom similarity index 93% rename from circom_circuits/Blend/poq.circom rename to circom_circuits/blend/poq.circom index 02314c4..79b19fd 100644 --- a/circom_circuits/Blend/poq.circom +++ b/circom_circuits/blend/poq.circom @@ -5,7 +5,7 @@ include "../hash_bn/poseidon2_hash.circom"; include "../misc/constants.circom"; // defines KDF, SELECTION_RANDOMNESS, PROOF_NULLIFIER include "../misc/comparator.circom"; include "../circomlib/circuits/bitify.circom"; -include "../Mantle/pol_lib.circom"; // defines proof_of_leadership +include "../mantle/pol_lib.circom"; // defines proof_of_leadership include "../ledger/notes.circom"; /** @@ -17,7 +17,6 @@ include "../ledger/notes.circom"; */ template ProofOfQuota(nLevelsPK, nLevelsPol, bitsQuota) { // Public Inputs - signal input session; // session s signal input core_quota; signal input leader_quota; signal input core_root; @@ -115,7 +114,7 @@ template ProofOfQuota(nLevelsPK, nLevelsPol, bitsQuota) { // choose core_sk or pol.secret_key: selection_randomness.inp[1] <== selector * (would_win.secret_key - core_sk ) + core_sk; selection_randomness.inp[2] <== index; - selection_randomness.inp[3] <== session; + selection_randomness.inp[3] <== selector * (would_win.slot - pol_epoch_nonce) + pol_epoch_nonce; // Derive key_nullifier @@ -127,5 +126,5 @@ template ProofOfQuota(nLevelsPK, nLevelsPol, bitsQuota) { } // Instantiate with chosen depths: 20 for core PK tree, 25 for PoL secret slot tree -component main { public [ session, core_quota, leader_quota, core_root, K_part_one, K_part_two, pol_epoch_nonce, pol_t0, pol_t1, pol_ledger_aged ] } +component main { public [ core_quota, leader_quota, core_root, K_part_one, K_part_two, pol_epoch_nonce, pol_t0, pol_t1, pol_ledger_aged ] } = ProofOfQuota(20, 25, 20); diff --git a/circom_circuits/Mantle/generate_inputs_for_pol.py b/circom_circuits/mantle/generate_inputs_for_pol.py similarity index 100% rename from circom_circuits/Mantle/generate_inputs_for_pol.py rename to circom_circuits/mantle/generate_inputs_for_pol.py diff --git a/circom_circuits/Mantle/generate_inputs_for_proof_of_claim.py b/circom_circuits/mantle/generate_inputs_for_proof_of_claim.py similarity index 100% rename from circom_circuits/Mantle/generate_inputs_for_proof_of_claim.py rename to circom_circuits/mantle/generate_inputs_for_proof_of_claim.py diff --git a/circom_circuits/Mantle/generate_inputs_for_signature.py b/circom_circuits/mantle/generate_inputs_for_signature.py similarity index 100% rename from circom_circuits/Mantle/generate_inputs_for_signature.py rename to circom_circuits/mantle/generate_inputs_for_signature.py diff --git a/circom_circuits/Mantle/poc.circom b/circom_circuits/mantle/poc.circom similarity index 100% rename from circom_circuits/Mantle/poc.circom rename to circom_circuits/mantle/poc.circom diff --git a/circom_circuits/Mantle/pol.circom b/circom_circuits/mantle/pol.circom similarity index 100% rename from circom_circuits/Mantle/pol.circom rename to circom_circuits/mantle/pol.circom diff --git a/circom_circuits/Mantle/pol_lib.circom b/circom_circuits/mantle/pol_lib.circom similarity index 100% rename from circom_circuits/Mantle/pol_lib.circom rename to circom_circuits/mantle/pol_lib.circom diff --git a/circom_circuits/Mantle/signature.circom b/circom_circuits/mantle/signature.circom similarity index 100% rename from circom_circuits/Mantle/signature.circom rename to circom_circuits/mantle/signature.circom diff --git a/circom_circuits/misc/comparator.circom b/circom_circuits/misc/comparator.circom index 4f5ce28..ac5850a 100644 --- a/circom_circuits/misc/comparator.circom +++ b/circom_circuits/misc/comparator.circom @@ -52,7 +52,7 @@ template SafeFullLessThan() { signal intermediate_results[4]; intermediate_results[0] <== (1 - C.out) * (1-D.out); - intermediate_results[1] <== (1 - C.out) * (1-E.out); + intermediate_results[1] <== C.out * (1-E.out); intermediate_results[2] <== intermediate_results[1] * (1- F.out); intermediate_results[3] <== B.out * (intermediate_results[0] + intermediate_results[2]);