zk-proof-verification

Verifies Groth16 zero-knowledge proofs from snarkjs and Circom circuits in .NET.

2.3k|744|Updated Nov 23, 2015
One-click install
npx skills add https://github.com/Nethereum/Nethereum --skill zk-proof-verification
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: zk-proof-verification
Source: https://github.com/Nethereum/Nethereum/tree/main/plugins/nethereum-skills/skills/zk-proof-verification
Command: npx skills add https://github.com/Nethereum/Nethereum --skill zk-proof-verification

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires Nethereum.ZkProofsVerifier.

What problem does it solve?

Verifying Groth16 zero-knowledge proofs in .NET normally requires deep knowledge of BN128 elliptic curve pairing cryptography and manual parsing of snarkjs output files. This Skill provides a single-call API that consumes proof.json, verification_key.json, and public.json directly and returns a clear verification result.

Core Features & Use Cases

  • One-Liner Verification: Call CircomGroth16Adapter.Verify() with the three snarkjs JSON strings to check proof validity without touching cryptographic internals.
  • Tamper Detection: Detects modified proofs, altered public inputs, or mismatched verification keys, returning descriptive error messages such as "Pairing check failed" or input count mismatches.
  • Use Case: Before submitting a transaction that relies on a ZK proof, a .NET backend verifies the Circom-generated proof off-chain using Nethereum.ZkProofsVerifier and rejects invalid submissions without paying gas.

Quick Start

Verify my Circom proof by loading proof.json, verification_key.json, and public.json and checking the result with Nethereum.ZkProofsVerifier.

Frequently Asked Questions about zk-proof-verification

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I verify a Groth16 proof in C# or .NET?

Install the Nethereum.ZkProofsVerifier NuGet package and call CircomGroth16Adapter.Verify with the contents of proof.json, verification_key.json, and public.json. The returned ZkVerificationResult exposes IsValid and an Error message.

How to verify snarkjs proof.json output in .NET?

Read proof.json, verification_key.json, and public.json as strings and pass them to CircomGroth16Adapter.Verify. The adapter parses the snarkjs JSON format directly, so no manual conversion of curve points is needed.

Does Nethereum.ZkProofsVerifier support proof systems other than Groth16?

The documented API covers Groth16 verification from snarkjs JSON output only. It consumes the standard proof.json, verification_key.json, and public.json files produced after proving a Circom circuit.

Why does Groth16 verification fail with "Pairing check failed"?

This error means the proof is invalid, typically because the proof, public inputs, or verification key were tampered with or do not correspond to each other. Verify that all three JSON files come from the same proving run and trusted setup.

What does the "Expected N public inputs but got M" error mean?

The verification key's IC array length must equal the number of public inputs plus one. This error indicates the public.json array does not match the circuit's expected public input count for the given verification key.