OpenViSTAI · Agents · Blockchain · Crypto
Menu
ZK & Privacy

Solana ZK Proof Example

Solana ZK Proof Example is a Rust tutorial demonstrating how to generate a Groth16 BN254 ZK-SNARK proof and verify it in an on-chain Solana program. It covers a simple circuit, circuit-specific key generation, proof creation, and the use of Solana’s alt_bn128_pairing function for on-chain verification.

Independent OpenViST project profile, based on linked sources.

Solana ZK Proof Example — OpenViST project profile in ZK & Privacy.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use it when learning or prototyping the basic Groth16-to-Solana verification flow, especially if you want to inspect both proof-generation and on-chain program stages.

Who it is for

  • Developers learning how Groth16 proof generation connects to on-chain verification in Solana.
  • Rust developers exploring a proof-verification pattern for Solana programs.

Documented uses

  • Understand the steps from defining a circuit to generating a proof.
  • See how a proof is sent to a Solana program and checked on-chain.
  • Build and test the documented example program with a local validator.
Before you choose

Requirements & limits

The repository is public and specifies an Apache-2.0 license.

  • The sample circuit enforces a deliberately trivial constraint, so application logic must be developed separately.
  • The README identifies verification cost, trusted setup and implementation complexity as relevant SNARK considerations.
  • The documented build flow uses Solana command-line tools and Cargo.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Build and test the documented Solana program example

Follow the README’s local-validator, program build and deployment, and on-chain program build and test stages.

Before you start

  • Solana command-line tools, including solana-test-validator and solana program
  • Rust and Cargo

Steps

  1. Start a local validator with solana-test-validator.

  2. In proof-verify, run cargo build-bpf and deploy the resulting program with solana program deploy ./target/deploy/solana_zk_example.so.

  3. Replace the program ID in main.rs with the deployed program ID.

  4. In on-chain-program-example, run cargo build and cargo test.

Expected outcome

The example program is built and deployed to the local validator, and the on-chain program’s documented build and test commands are run.

Guide limitations

  • The README does not specify tool versions or diagnose setup errors.
  • Its example circuit uses a trivial constraint and is not application-specific.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
15 October 2026
Original website title
wkennedy/solana-zk-proof-example · Official homepage title · retained in its source language