aneopsy / groth16-sol-verifier

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Groth16 verifier on Solana

This project is an implementation of the Groth16 zk-SNARK proving system on Solana.

The project is consist of:

  • An on-chain proof verifier program
  • A circuit demo
  • A client can send proof and input to verifier program

Quick Start

The following dependencies are required to build and run this example, depending on your OS, they my have already been installed:

Configure CLI

you're on Windows, it is recommended to use WSL to run these commands

  1. Set CLI config url to localhost cluster
solana config set --url localhost
  1. Create CLI Keypair

If this is your first time using the Solana CLI, you will need to generate a new keypair:

solana-keygen new

Start local Solana cluster

This example connects to a local Solana cluster by default.

Start a local Solana cluster:

solana-test-validator

Note: You may need to do some system tuning (and restart your computer) to get the validator to run

Listen to transaction logs:

solana logs

Build the on-chain program

cd contract
cargo build-bpf

Deploy the on-chain program

solana program deploy target/deploy/contract.so

Build and run the client

cd client
cargo build
../target/debug/client

About


Languages

Language:Rust 100.0%