VegeBun-csj / substrate-zk

A substrate-based chain with bellman
Apache License 2.0
2 stars 1 forks source link
bellman substrate zero-knowledge zk-snarks

substrate-zk

A Substrate-based chain supporting ZK-SNARK(change Bellman's verifier to no_std to adapt substrate) you can use this verifier pallet to verify the proof(uncompressed data) with bls12_381 curve

Build and Run

you should have known how to build a substrate-based chain.

build the chain:

cargo build --release

run the chain:

./target/release/node-template --dev --tmp

Test the zk-verifier

First, you need use this adapter to generate proof(proof_hex.json) and verification(vkey_hex.json). i will show a minimal example with this circuit: a*b=c.

Advantage

You can verify all proofs generated by snarkjs with BLS12_381 through this pallet.