├── .gitignore ├── .tool-versions ├── Cargo.lock ├── Cargo.toml ├── Makefile ├── README.md ├── circuits ├── clean.sh ├── const.zok ├── fri.zok ├── main.zok ├── merkle.zok ├── read_iop.zok ├── runit.sh ├── tests │ ├── test_fp.sh │ ├── test_fp.zok │ ├── test_merkle.sh │ ├── test_merkle.zok │ ├── test_rng.sh │ └── test_rng.zok └── utils.zok ├── groth16 ├── __init__.py ├── contracts │ ├── README.md │ ├── __init__.py │ ├── artifacts │ │ ├── application.json │ │ ├── approval.teal │ │ ├── clear.teal │ │ └── contract.json │ ├── main.py │ ├── mypy.ini │ ├── verifier │ │ ├── __init__.py │ │ ├── application.py │ │ └── lib │ │ │ ├── __init__.py │ │ │ ├── bls12_381.py │ │ │ ├── bn254.py │ │ │ └── util.py │ ├── vscode_hackery.py │ └── zokrates.py ├── gnark │ ├── cubic │ │ └── circuit.go │ ├── keys.go │ ├── sortedlist │ │ ├── circuit.go │ │ └── circuit_test.go │ ├── types.go │ └── util.go └── zokrates │ ├── alice.sh │ ├── clean.sh │ ├── dApp_simulate.sh │ ├── eve.sh │ ├── helpers.sh │ ├── root.zok │ ├── root_abi.json │ ├── root_out │ ├── root_proof.json │ ├── root_proving.key │ ├── root_verification.key │ ├── root_witness │ ├── secret_factor.zok │ ├── secret_factor2.zok │ ├── secret_factor2_abi.json │ ├── secret_factor2_out │ ├── secret_factor2_proof.json │ ├── secret_factor2_proving.key │ ├── secret_factor2_verification.key │ ├── secret_factor2_witness │ ├── secret_factor_abi.json │ ├── secret_factor_out │ ├── secret_factor_proof.json │ ├── secret_factor_proving.key │ ├── secret_factor_verification.key │ ├── secret_factor_witness │ └── zok-flow.dot ├── host ├── Cargo.toml └── src │ └── main.rs ├── methods ├── Cargo.toml ├── build.rs ├── guest │ ├── Cargo.lock │ ├── Cargo.toml │ └── src │ │ └── bin │ │ └── multiply.rs └── src │ └── lib.rs ├── python ├── README.md ├── __init__.py ├── consts.py ├── fp.py ├── fp_test.py ├── fri.py ├── main.py ├── merkle.py ├── method.py ├── poly_ext.py ├── read_iop.py ├── sha256.py ├── steps.json ├── taps.py └── util.py ├── random ├── Zokrates-Algorand.png └── get_a_32bit_prime.ipynb ├── requirements.txt ├── rust-toolchain └── sanitycheck ├── Cargo.toml └── src └── main.rs /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/.gitignore -------------------------------------------------------------------------------- /.tool-versions: -------------------------------------------------------------------------------- 1 | python 3.11.1 2 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/Cargo.lock -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/Cargo.toml -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/Makefile -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/README.md -------------------------------------------------------------------------------- /circuits/clean.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/circuits/clean.sh -------------------------------------------------------------------------------- /circuits/const.zok: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/circuits/const.zok -------------------------------------------------------------------------------- /circuits/fri.zok: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /circuits/main.zok: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/circuits/main.zok -------------------------------------------------------------------------------- /circuits/merkle.zok: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/circuits/merkle.zok -------------------------------------------------------------------------------- /circuits/read_iop.zok: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/circuits/read_iop.zok -------------------------------------------------------------------------------- /circuits/runit.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/circuits/runit.sh -------------------------------------------------------------------------------- /circuits/tests/test_fp.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/circuits/tests/test_fp.sh -------------------------------------------------------------------------------- /circuits/tests/test_fp.zok: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/circuits/tests/test_fp.zok -------------------------------------------------------------------------------- /circuits/tests/test_merkle.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/circuits/tests/test_merkle.sh -------------------------------------------------------------------------------- /circuits/tests/test_merkle.zok: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/circuits/tests/test_merkle.zok -------------------------------------------------------------------------------- /circuits/tests/test_rng.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/circuits/tests/test_rng.sh -------------------------------------------------------------------------------- /circuits/tests/test_rng.zok: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/circuits/tests/test_rng.zok -------------------------------------------------------------------------------- /circuits/utils.zok: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/circuits/utils.zok -------------------------------------------------------------------------------- /groth16/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /groth16/contracts/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/groth16/contracts/README.md -------------------------------------------------------------------------------- /groth16/contracts/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /groth16/contracts/artifacts/application.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/groth16/contracts/artifacts/application.json -------------------------------------------------------------------------------- /groth16/contracts/artifacts/approval.teal: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/groth16/contracts/artifacts/approval.teal -------------------------------------------------------------------------------- /groth16/contracts/artifacts/clear.teal: -------------------------------------------------------------------------------- 1 | #pragma version 9 2 | pushint 0 // 0 3 | return -------------------------------------------------------------------------------- /groth16/contracts/artifacts/contract.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/groth16/contracts/artifacts/contract.json -------------------------------------------------------------------------------- /groth16/contracts/main.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/groth16/contracts/main.py -------------------------------------------------------------------------------- /groth16/contracts/mypy.ini: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/groth16/contracts/mypy.ini -------------------------------------------------------------------------------- /groth16/contracts/verifier/__init__.py: -------------------------------------------------------------------------------- 1 | from .application import Verifier 2 | -------------------------------------------------------------------------------- /groth16/contracts/verifier/application.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/groth16/contracts/verifier/application.py -------------------------------------------------------------------------------- /groth16/contracts/verifier/lib/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /groth16/contracts/verifier/lib/bls12_381.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/groth16/contracts/verifier/lib/bls12_381.py -------------------------------------------------------------------------------- /groth16/contracts/verifier/lib/bn254.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/groth16/contracts/verifier/lib/bn254.py -------------------------------------------------------------------------------- /groth16/contracts/verifier/lib/util.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/groth16/contracts/verifier/lib/util.py -------------------------------------------------------------------------------- /groth16/contracts/vscode_hackery.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/groth16/contracts/vscode_hackery.py -------------------------------------------------------------------------------- /groth16/contracts/zokrates.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/groth16/contracts/zokrates.py -------------------------------------------------------------------------------- /groth16/gnark/cubic/circuit.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/groth16/gnark/cubic/circuit.go -------------------------------------------------------------------------------- /groth16/gnark/keys.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/groth16/gnark/keys.go -------------------------------------------------------------------------------- /groth16/gnark/sortedlist/circuit.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/groth16/gnark/sortedlist/circuit.go -------------------------------------------------------------------------------- /groth16/gnark/sortedlist/circuit_test.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/groth16/gnark/sortedlist/circuit_test.go -------------------------------------------------------------------------------- /groth16/gnark/types.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/groth16/gnark/types.go -------------------------------------------------------------------------------- /groth16/gnark/util.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/groth16/gnark/util.go -------------------------------------------------------------------------------- /groth16/zokrates/alice.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/groth16/zokrates/alice.sh -------------------------------------------------------------------------------- /groth16/zokrates/clean.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/groth16/zokrates/clean.sh -------------------------------------------------------------------------------- /groth16/zokrates/dApp_simulate.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/groth16/zokrates/dApp_simulate.sh -------------------------------------------------------------------------------- /groth16/zokrates/eve.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/groth16/zokrates/eve.sh -------------------------------------------------------------------------------- /groth16/zokrates/helpers.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/groth16/zokrates/helpers.sh -------------------------------------------------------------------------------- /groth16/zokrates/root.zok: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/groth16/zokrates/root.zok -------------------------------------------------------------------------------- /groth16/zokrates/root_abi.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/groth16/zokrates/root_abi.json -------------------------------------------------------------------------------- /groth16/zokrates/root_out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/groth16/zokrates/root_out -------------------------------------------------------------------------------- /groth16/zokrates/root_proof.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/groth16/zokrates/root_proof.json -------------------------------------------------------------------------------- /groth16/zokrates/root_proving.key: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/groth16/zokrates/root_proving.key -------------------------------------------------------------------------------- /groth16/zokrates/root_verification.key: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/groth16/zokrates/root_verification.key -------------------------------------------------------------------------------- /groth16/zokrates/root_witness: -------------------------------------------------------------------------------- 1 | ~one 1 2 | _0 337 3 | _1 113569 4 | -------------------------------------------------------------------------------- /groth16/zokrates/secret_factor.zok: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/groth16/zokrates/secret_factor.zok -------------------------------------------------------------------------------- /groth16/zokrates/secret_factor2.zok: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/groth16/zokrates/secret_factor2.zok -------------------------------------------------------------------------------- /groth16/zokrates/secret_factor2_abi.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/groth16/zokrates/secret_factor2_abi.json -------------------------------------------------------------------------------- /groth16/zokrates/secret_factor2_out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/groth16/zokrates/secret_factor2_out -------------------------------------------------------------------------------- /groth16/zokrates/secret_factor2_proof.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/groth16/zokrates/secret_factor2_proof.json -------------------------------------------------------------------------------- /groth16/zokrates/secret_factor2_proving.key: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/groth16/zokrates/secret_factor2_proving.key -------------------------------------------------------------------------------- /groth16/zokrates/secret_factor2_verification.key: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/groth16/zokrates/secret_factor2_verification.key -------------------------------------------------------------------------------- /groth16/zokrates/secret_factor2_witness: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/groth16/zokrates/secret_factor2_witness -------------------------------------------------------------------------------- /groth16/zokrates/secret_factor_abi.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/groth16/zokrates/secret_factor_abi.json -------------------------------------------------------------------------------- /groth16/zokrates/secret_factor_out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/groth16/zokrates/secret_factor_out -------------------------------------------------------------------------------- /groth16/zokrates/secret_factor_proof.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/groth16/zokrates/secret_factor_proof.json -------------------------------------------------------------------------------- /groth16/zokrates/secret_factor_proving.key: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/groth16/zokrates/secret_factor_proving.key -------------------------------------------------------------------------------- /groth16/zokrates/secret_factor_verification.key: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/groth16/zokrates/secret_factor_verification.key -------------------------------------------------------------------------------- /groth16/zokrates/secret_factor_witness: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/groth16/zokrates/secret_factor_witness -------------------------------------------------------------------------------- /groth16/zokrates/zok-flow.dot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/groth16/zokrates/zok-flow.dot -------------------------------------------------------------------------------- /host/Cargo.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/host/Cargo.toml -------------------------------------------------------------------------------- /host/src/main.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/host/src/main.rs -------------------------------------------------------------------------------- /methods/Cargo.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/methods/Cargo.toml -------------------------------------------------------------------------------- /methods/build.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | risc0_build::embed_methods(); 3 | } 4 | -------------------------------------------------------------------------------- /methods/guest/Cargo.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/methods/guest/Cargo.lock -------------------------------------------------------------------------------- /methods/guest/Cargo.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/methods/guest/Cargo.toml -------------------------------------------------------------------------------- /methods/guest/src/bin/multiply.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/methods/guest/src/bin/multiply.rs -------------------------------------------------------------------------------- /methods/src/lib.rs: -------------------------------------------------------------------------------- 1 | include!(concat!(env!("OUT_DIR"), "/methods.rs")); 2 | -------------------------------------------------------------------------------- /python/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/python/README.md -------------------------------------------------------------------------------- /python/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /python/consts.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/python/consts.py -------------------------------------------------------------------------------- /python/fp.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/python/fp.py -------------------------------------------------------------------------------- /python/fp_test.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/python/fp_test.py -------------------------------------------------------------------------------- /python/fri.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/python/fri.py -------------------------------------------------------------------------------- /python/main.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/python/main.py -------------------------------------------------------------------------------- /python/merkle.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/python/merkle.py -------------------------------------------------------------------------------- /python/method.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/python/method.py -------------------------------------------------------------------------------- /python/poly_ext.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/python/poly_ext.py -------------------------------------------------------------------------------- /python/read_iop.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/python/read_iop.py -------------------------------------------------------------------------------- /python/sha256.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/python/sha256.py -------------------------------------------------------------------------------- /python/steps.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/python/steps.json -------------------------------------------------------------------------------- /python/taps.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/python/taps.py -------------------------------------------------------------------------------- /python/util.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/python/util.py -------------------------------------------------------------------------------- /random/Zokrates-Algorand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/random/Zokrates-Algorand.png -------------------------------------------------------------------------------- /random/get_a_32bit_prime.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/random/get_a_32bit_prime.ipynb -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/requirements.txt -------------------------------------------------------------------------------- /rust-toolchain: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/rust-toolchain -------------------------------------------------------------------------------- /sanitycheck/Cargo.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/sanitycheck/Cargo.toml -------------------------------------------------------------------------------- /sanitycheck/src/main.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barnjamin/zk-experiments/HEAD/sanitycheck/src/main.rs --------------------------------------------------------------------------------