Skip to content

aliyudotdev/proofmatch-contracts

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

proofmatch-contracts

The on-chain layer of ProofMatch — Soroban smart contracts on Stellar testnet that verify Groth16 proofs and permanently anchor proof commitments.

🌍 Live demo: proofmatch-stellar.fly.dev — every proof generated there submits real transactions to the two contracts below. · 📖 Docs · 🎥 Demo video · 𝕏 @zkproofmatch

Part of the ProofMatch trio:

Repo Role
proofmatch-circuits Circom circuits that generate the proofs these contracts verify
proofmatch-contracts (this) Soroban verifier + registry contracts
proofmatch-app Web app / API that invokes these contracts

Deployed on Stellar testnet

verifier/ — Groth16 verifier

CB33TGWZROSRQRKFVZGZV74SKFGSDC6HOEN366PF2S2WD7ESRCHIR6VB

https://lab.stellar.org/r/testnet/contract/CB33TGWZROSRQRKFVZGZV74SKFGSDC6HOEN366PF2S2WD7ESRCHIR6VB

Verifies Groth16 proofs over BLS12-381 using Soroban's native BLS host functions. Takes a verification key, proof (A, B, C), and public signals; returns true/false. VK-agnostic — the same contract verifies both the solvency and the 7-day-stability circuits (the caller supplies the matching VK).

stellar contract invoke --id CB33...R6VB --source <key> --network testnet --send=yes \
  -- verify_proof \
  --vk-file-path vk.json --proof-file-path proof.json --pub_signals-file-path pub_signals.json

Input format: BLS12-381 field elements as big-endian hex; G1 = x‖y (96 bytes), G2 Fp2 coords serialized c1‖c0 (ark-ff convention). Produced by scripts/proof_to_cli_args.js in proofmatch-circuits.

registry/ — proof commitment registry

CCB7YWB42PZNXNCQVAUNX7LWYDEAAJ6YSLMCK6LPDDNMPMQEMDTMZGKL

https://lab.stellar.org/r/testnet/contract/CCB7YWB42PZNXNCQVAUNX7LWYDEAAJ6YSLMCK6LPDDNMPMQEMDTMZGKL

Permanently anchors each proof's commitment on-chain so share links can be independently corroborated:

  • store(proof_id: Bytes, threshold: i128, asset: Symbol, stored_at: u64) -> bool — write-once (returns false on duplicate), TTL extended ~1 year
  • exists(proof_id: Bytes) -> bool
  • get(proof_id: Bytes) -> Option<Commitment>

Building

Requires Rust with the wasm32v1-none target and stellar-cli 25+.

cd verifier && stellar contract build
cd ../registry && stellar contract build

# Deploy (testnet)
stellar contract deploy --wasm target/wasm32v1-none/release/proof_registry.wasm \
  --source <funded-key> --network testnet

Tests

cd verifier && cargo test   # proof pass + tamper rejection + boundary equality

About

Soroban contracts for ProofMatch — on-chain Groth16 verifier + proof registry on Stellar testnet

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Rust 100.0%