diff --git a/circom_circuits/Blend/generate_inputs_for_poq.py b/circom_circuits/Blend/generate_inputs_for_poq.py index c47aa53..77e353a 100644 --- a/circom_circuits/Blend/generate_inputs_for_poq.py +++ b/circom_circuits/Blend/generate_inputs_for_poq.py @@ -237,10 +237,13 @@ for i in range(20): # 2) PoL inputs (broadened from pol script) epoch_nonce = F(randrange(0, p,1)) slot_number = F(randrange(0, 2**32,1)) -total_stake = F(5000) +total_stake = int(5000) -t0 = F(0x27b6fe27507ca57ca369280400c79b5d2f58ff94d87cb0fbfc8294eb69eb1ea) -t1 = F(0x104bfd09ebdd0a57772289d0973489b62662a4dc6f09da8b4af3c5cfb1dcdd) +t0_constant = F(0x27b6fe27507ca57ca369280400c79b5d2f58ff94d87cb0fbfc8294eb69eb1ea) +t1_constant = F(0x104bfd09ebdd0a57772289d0973489b62662a4dc6f09da8b4af3c5cfb1dcdd) + +t0 = F(int(t0_constant) // total_stake) +t1 = F(p- (int(t1_constant) // total_stake**2)) value = F(total_stake / 100) threshold = (t0 + t1 * value) * value @@ -284,8 +287,8 @@ for i in range(32): index = randrange(0, Ql if core_or_leader else Qc,1) # 4) One‐time key -K_one = F(randrange(0,p,1)) -K_two = F(randrange(0,p,1)) +K_one = F(123456) +K_two = F(654321) # 5) Assemble JSON inp = { @@ -316,9 +319,9 @@ inp = { } if core_or_leader == 0: - inp["pol_ledger_aged"] = randrange(0,p,1) + inp["pol_ledger_aged"] = str(randrange(0,p,1)) else: - inp["core_root"] = randrange(0,p,1) + inp["core_root"] = str(randrange(0,p,1)) import json diff --git a/circom_circuits/Blend/poq.circom b/circom_circuits/Blend/poq.circom index 407bfea..86c82c0 100644 --- a/circom_circuits/Blend/poq.circom +++ b/circom_circuits/Blend/poq.circom @@ -133,5 +133,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, pol_ledger_aged, K_part_one, K_part_two ] } +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 ] } = ProofOfQuota(20, 25, 20); diff --git a/circom_circuits/Mantle/generate_inputs_for_pol.py b/circom_circuits/Mantle/generate_inputs_for_pol.py index 4f24c4e..2925cf5 100755 --- a/circom_circuits/Mantle/generate_inputs_for_pol.py +++ b/circom_circuits/Mantle/generate_inputs_for_pol.py @@ -219,8 +219,13 @@ if total_stake >= p: print("total stake must be less than p") exit() -t0 = F(0x27b6fe27507ca57ca369280400c79b5d2f58ff94d87cb0fbfc8294eb69eb1ea) -t1 = F(0x104bfd09ebdd0a57772289d0973489b62662a4dc6f09da8b4af3c5cfb1dcdd) +t0_constant = F(0x27b6fe27507ca57ca369280400c79b5d2f58ff94d87cb0fbfc8294eb69eb1ea) +t1_constant = F(0x104bfd09ebdd0a57772289d0973489b62662a4dc6f09da8b4af3c5cfb1dcdd) + +t0 = F(int(t0_constant) // total_stake) +t1 = F(p- (int(t1_constant) // total_stake**2)) + +print(t0) value = F(total_stake / 100) diff --git a/circom_circuits/Mantle/proof_of_claim.circom b/circom_circuits/Mantle/poc.circom similarity index 100% rename from circom_circuits/Mantle/proof_of_claim.circom rename to circom_circuits/Mantle/poc.circom diff --git a/circom_circuits/Mantle/pol.circom b/circom_circuits/Mantle/pol.circom index 2a91396..637a5d2 100644 --- a/circom_circuits/Mantle/pol.circom +++ b/circom_circuits/Mantle/pol.circom @@ -2,5 +2,4 @@ pragma circom 2.1.9; include "pol_lib.circom"; -component main {public [sl,epoch_nonce,t0,t1,ledger_aged,ledger_latest,P_lead_part_one,P_lead_part_two]}= proof_of_leadership(25); - +component main {public [sl,epoch_nonce,t0,t1,ledger_aged,ledger_latest,P_lead_part_one,P_lead_part_two]}= proof_of_leadership(25); \ No newline at end of file