Skip to content
Turnstile

Zero-knowledge fee audit

Prove the fee without showing the earnings.

A seller pays the facilitator a share of what it earns. With a Groth16 proof it shows the share is exactly right, and a Solidity contract on QoreChain checks the proof with the chain's BN254 pairing precompile. Revenue stays private.

What the proof says

The seller paid the facilitator 0.215 QOR, which is exactly 25% of what it earned from 13 committed payments. The payments and their total are not revealed.

public: fee
215000 uqor
public: bps
2500
public: commitment
10768655407495376412807850321314653536112273396097219396240382422611921307489
private
16 amounts, salt, total

Verify it inside QoreChain

On chain

  1. Groth16 verifier deployed 0xc305f06c626a…
  2. FeeAudit deployed 0x16c507c76119…
  3. Fee proof recorded on chain (300,404 gas) 0xb477295f885e…

FeeAudit 0xAE05f8faDD76F827B3e80A3382a54cF31A4549A5
Groth16 verifier 0x4E499B476A556F1086B0813f104637C469F21205

How it works

  • Circuit: packages/zk/circuits/fee_audit.circom, 3,753 constraints. It proves fee = floor(total × feeBps / 10000) where total is the sum of up to 16 payment amounts (each below 2^64) that the seller committed to with Poseidon.
  • Public: fee, feeBps, commitment. Private: the amounts and a salt. The seller can open the commitment later to an auditor.
  • Proof made from 13 real payments one of our sellers received, in 604 ms. A wrong fee cannot be proven, and changing a public value makes the contract reject the proof (tests in packages/zk/test).
  • Honest limit: the Groth16 setup was run once, locally, with one contributor, for this testnet. A production deployment needs a public multi-party ceremony.