Skip to content

DCS-LabsAI/r4-standard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

R+4 — Federated Zero-Knowledge Verification Standard

Spec License: MIT Status Built on

An open specification for zero-knowledge proofs over R+2 receipts and R+3 audit bundles — prove a compliance property holds without revealing the underlying receipts. Groth16 / BN254. MIT-licensed.

🌐 Full spec: https://dcslabs.ai/standard/r4 🔗 Built on: R+2 + R+3


What is R+4?

R+2 makes every agent action signable; R+3 aggregates them into Merkle-rooted audit bundles. Both share one property: the verifier sees the data.

R+4 removes that. An R+4 proof is a short cryptographic object (~200 bytes on BN254) that lets a verifier check a specific, pre-committed statement about a set of receipts — e.g. "≥ 10,000 receipts in this bundle were signed under policy pol_v3 with amount ≤ $5.00"without learning anything else: not the receipts, not the principals, not the exact count.

Where R+2 makes every action provable and R+3 makes every period provable, R+4 makes every compliance claim verifiable without disclosure.


Reference circuit

The reference statement class is r4-threshold-count-v1 — implemented in reference/circuits/threshold-count.circom. It enforces, in-circuit:

  • a SHA-256 Merkle path from each consumed receipt to the public bundle root,
  • the receipt's EdDSA signature,
  • the receipt timestamp inside the declared window,
  • policy-ID and amount-cap bounds.

Compiled profile: 1,197,221 R1CS constraints (64-receipt Groth16 / BN254 profile).


Quick start

cd reference
npm install

# 1. compile circuit → R1CS → dev keys → Solidity verifier
npm run build

# 2. generate a real Groth16 proof from the worked example
npm run prove -- --bundle example-bundle.json \
     --statement example-statement.json --artifacts ./artifacts --out proof.json

# 3. verify it
npm run verify -- proof.json

Expected: the witness suite passes 7/7, and the verifier prints groth16 verify : valid.

Trust note. npm run build produces development proving/verifying keys from a single-party setup — fine for testing the circuit and pipeline. The production keys come from the multi-party trusted-setup ceremony, which has now been completed — see reference/ceremony/CEREMONY_TRANSCRIPT.md. The production keys are a v0.1 ceremony (5 contributors, family + internal) — verified ZKey Ok!, Bitcoin-beacon sealed.


On-chain verifiers

Testnet — Base Sepolia (development keys)

The dev-key Groth16 Solidity verifier was deployed to Base Sepolia and its verifyProof() returned true on-chain.

Item Value
Network Base Sepolia (testnet), chain ID 84532
Verifier contract 0x91d98bc1…0553e1cd
Deployment tx 0x31e7a6b2…1617609e7
Keys development keys

Mainnet — Base (production / ceremony keys)

The production Groth16 verifier, built from the completed ceremony's phase2_final.zkey, is live on Base mainnet.

Item Value
Network Base mainnet, chain ID 8453
Verifier contract 0xabf8626c20e6bf21a9fdcd4e9f80c17ac8963209
Deployment tx 0x9df6edff…02f01f53f
Block 46,343,838
Keys production — v0.1 trusted-setup ceremony

Ceremony record: reference/ceremony/CEREMONY_TRANSCRIPT.md — 5 contributors, Bitcoin-beacon sealed, ZKey Ok!.


Repository structure

r4-standard/
├── reference/
│   ├── circuits/             # threshold-count.circom — the reference circuit
│   ├── prover/               # generate a Groth16 proof from a bundle + statement
│   ├── verifier/             # verify a proof off-chain
│   ├── solidity/             # generated Groth16 Solidity verifier
│   ├── scripts/              # deploy + on-chain verify scripts
│   ├── ceremony/             # multi-party trusted-setup coordination
│   ├── test/                 # witness + statement-logic test suite
│   ├── build.sh              # compile → R1CS → keys → Solidity verifier
│   ├── COMPILE_RUNBOOK.md    # full compile procedure (circom + snarkjs)
│   └── example-*.json        # worked bundle / statement / proof
├── CONTRIBUTING.md
├── SECURITY.md
├── CODE_OF_CONDUCT.md
└── LICENSE

The canonical specification text lives on the website (https://dcslabs.ai/standard/r4). This repository holds the reference circuit and proof tooling.


License

The specification and reference implementation are released under the MIT License. DCS AI Technologies L.L.C holds no patents covering R+4 and has filed none.


Contact

— DCS AI Technologies L.L.C, Dubai

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages