diff --git a/.gitignore b/.gitignore index 29d76d2..2af6062 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ crytic-export .certora_internal coverage coverage.json +ignition/deployments diff --git a/hardhat.config.js b/hardhat.config.js index fb2cdcc..24cb3b6 100644 --- a/hardhat.config.js +++ b/hardhat.config.js @@ -1,4 +1,5 @@ require("@nomicfoundation/hardhat-toolbox") +require("@nomicfoundation/hardhat-ignition-ethers") module.exports = { solidity: { @@ -22,7 +23,10 @@ module.exports = { networks: { hardhat: { tags: ["local"], - allowBlocksWithSameTimestamp: true, + allowBlocksWithSameTimestamp: process.env.NODE_ENV == "test", + }, + localhost: { + tags: ["local"], }, codexdisttestnetwork: { url: `${process.env.DISTTEST_NETWORK_URL}`, diff --git a/verifier/networks/localhost/example-proof/proof.json b/verifier/networks/localhost/example-proof/proof.json new file mode 100644 index 0000000..0d99b1f --- /dev/null +++ b/verifier/networks/localhost/example-proof/proof.json @@ -0,0 +1,28 @@ +{ + "pi_a": [ + "6534256117371673392078914918983405561950705741555607896616281548993166767050", + "4683704071819826577549511087725295557628226569657977399743888281350488008160", + "1" + ], + "pi_b": [ + [ + "5214601005301447749408976517903523691026761713935248596363525026084207179898", + "12928862018496028019248584699701543976607635004280021323367162829172676142063" + ], + [ + "6802359022534661924490571652741723715650845080843101596088257121470226373081", + "13026065833109947056007317243769626467054545801812125911606045634450472294131" + ], + [ + "1", + "0" + ] + ], + "pi_c": [ + "4064922718155280187684708354118623661512911161238889435233679092743470899962", + "16109406845320108508342512724551388830826795687369147885401665396548555026064", + "1" + ], + "protocol": "groth16", + "curve": "bn128" +} \ No newline at end of file diff --git a/verifier/networks/localhost/example-proof/public.json b/verifier/networks/localhost/example-proof/public.json new file mode 100644 index 0000000..36b2e34 --- /dev/null +++ b/verifier/networks/localhost/example-proof/public.json @@ -0,0 +1,5 @@ +[ + "10941033813", + "16074246370508166450132968585287196391860062495017081813239200574579640171677", + "3" +] \ No newline at end of file diff --git a/verifier/networks/localhost/proof_main.circom b/verifier/networks/localhost/proof_main.circom new file mode 100644 index 0000000..1018d4b --- /dev/null +++ b/verifier/networks/localhost/proof_main.circom @@ -0,0 +1,4 @@ +pragma circom 2.0.0; +include "sample_cells.circom"; +// SampleAndProven( maxDepth, maxLog2NSlots, blockTreeDepth, nFieldElemsPerCell, nSamples ) +component main {public [entropy,dataSetRoot,slotIndex]} = SampleAndProve(32, 8, 5, 67, 5); diff --git a/verifier/networks/localhost/proof_main.r1cs b/verifier/networks/localhost/proof_main.r1cs new file mode 100644 index 0000000..8b58ffa Binary files /dev/null and b/verifier/networks/localhost/proof_main.r1cs differ diff --git a/verifier/networks/localhost/proof_main.wasm b/verifier/networks/localhost/proof_main.wasm new file mode 100644 index 0000000..f908d4f Binary files /dev/null and b/verifier/networks/localhost/proof_main.wasm differ diff --git a/verifier/networks/localhost/proof_main.zkey b/verifier/networks/localhost/proof_main.zkey new file mode 100644 index 0000000..5451ad0 Binary files /dev/null and b/verifier/networks/localhost/proof_main.zkey differ diff --git a/verifier/networks/localhost/proof_main_verification_key.json b/verifier/networks/localhost/proof_main_verification_key.json new file mode 100644 index 0000000..5f995ae --- /dev/null +++ b/verifier/networks/localhost/proof_main_verification_key.json @@ -0,0 +1,104 @@ +{ + "protocol": "groth16", + "curve": "bn128", + "nPublic": 3, + "vk_alpha_1": [ + "20491192805390485299153009773594534940189261866228447918068658471970481763042", + "9383485363053290200918347156157836566562967994039712273449902621266178545958", + "1" + ], + "vk_beta_2": [ + [ + "6375614351688725206403948262868962793625744043794305715222011528459656738731", + "4252822878758300859123897981450591353533073413197771768651442665752259397132" + ], + [ + "10505242626370262277552901082094356697409835680220590971873171140371331206856", + "21847035105528745403288232691147584728191162732299865338377159692350059136679" + ], + [ + "1", + "0" + ] + ], + "vk_gamma_2": [ + [ + "10857046999023057135944570762232829481370756359578518086990519993285655852781", + "11559732032986387107991004021392285783925812861821192530917403151452391805634" + ], + [ + "8495653923123431417604973247489272438418190587263600148770280649306958101930", + "4082367875863433681332203403145435568316851327593401208105741076214120093531" + ], + [ + "1", + "0" + ] + ], + "vk_delta_2": [ + [ + "3431611495862121747865613070227194870328323956412989443038622984801922101560", + "1839332345901382467668376261123176838724068493614256702976446713083234015641" + ], + [ + "4267694917739299737209021244200092851467599237028086467255985366439671917679", + "14005704598922119245150389324584568926199987543485693236347173598336567030859" + ], + [ + "1", + "0" + ] + ], + "vk_alphabeta_12": [ + [ + [ + "2029413683389138792403550203267699914886160938906632433982220835551125967885", + "21072700047562757817161031222997517981543347628379360635925549008442030252106" + ], + [ + "5940354580057074848093997050200682056184807770593307860589430076672439820312", + "12156638873931618554171829126792193045421052652279363021382169897324752428276" + ], + [ + "7898200236362823042373859371574133993780991612861777490112507062703164551277", + "7074218545237549455313236346927434013100842096812539264420499035217050630853" + ] + ], + [ + [ + "7077479683546002997211712695946002074877511277312570035766170199895071832130", + "10093483419865920389913245021038182291233451549023025229112148274109565435465" + ], + [ + "4595479056700221319381530156280926371456704509942304414423590385166031118820", + "19831328484489333784475432780421641293929726139240675179672856274388269393268" + ], + [ + "11934129596455521040620786944827826205713621633706285934057045369193958244500", + "8037395052364110730298837004334506829870972346962140206007064471173334027475" + ] + ] + ], + "IC": [ + [ + "11919420103024546168896650006162652130022732573970705849225139177428442519914", + "17747753383929265689844293401689552935018333420134132157824903795680624926572", + "1" + ], + [ + "13158415194355348546090070151711085027834066488127676886518524272551654481129", + "18831701962118195025265682681702066674741422770850028135520336928884612556978", + "1" + ], + [ + "20882269691461568155321689204947751047717828445545223718893788782534717197527", + "11996193054822748526485644723594571195813487505803351159052936325857690315211", + "1" + ], + [ + "18155166643053044822201627105588517913195535693446564472247126736722594445000", + "13816319482622393060406816684195314200198627617641073470088058848129378231754", + "1" + ] + ] +} \ No newline at end of file diff --git a/verifier/networks/localhost/zkey_hash.json b/verifier/networks/localhost/zkey_hash.json new file mode 100644 index 0000000..c9a88f8 --- /dev/null +++ b/verifier/networks/localhost/zkey_hash.json @@ -0,0 +1 @@ +"65dfa139e1c6dae5f50102cca2a856b759723c6ec6029343c2c6e926b855a6ca"