Skip to content

zk-examples/zk-soroban-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zk-soroban-examples

Supported Toolchains

Proofs and verification keys generated by:

Repository Structure

The ./data/ directory is organized by ZK toolchain: e.g. data/circom (Circom/snarkjs), data/gnark (Go/gnark), data/arkworks (Rust/arkworks). Each subdirectory holds circuit definitions, inputs, and the generated proof artifacts for that toolchain.

For proof verification, three key files are required per toolchain. Example for Circom (data/circom/):

Intermediate artifacts (witness code, Powers of Tau outputs, etc.) live under ./data/circom/auxiliary (see data/circom/README.md for the Circom setup steps).

For gnark BLS12-381, circuit definitions and setup code are in ./data/gnark/auxiliary (see data/gnark/README.md).

For gnark BN254, circuit definitions and setup code are in ./data/gnark_bn254/auxiliary (see data/gnark_bn254/README.md).

For arkworks, circuit definitions and setup code are in ./data/arkworks/auxiliary (see data/arkworks/README.md).

Usage

cd groth16_verifier

cargo install soroban-verifier-gen

# bls12-381
soroban-verifier-gen --vk data/circom/verification_key.json --out contracts/circom_verifier --crate-name circom_verifier
soroban-verifier-gen --vk data/gnark/verification_key.json --out contracts/gnark_verifier --crate-name gnark_verifier
soroban-verifier-gen --vk data/arkworks/verification_key.json --out contracts/ark_verifier --crate-name ark_verifier

# bn254
soroban-verifier-gen --vk data/gnark_bn254/verification_key.json --out contracts/gnark_bn254_verifier --crate-name gnark_bn254_verifier --curve bn254

About

Examples of using zero-knowledge proofs on the Stellar blockchain

Topics

Resources

License

Stars

Watchers

Forks

Contributors