@clearproof/circuits
v0.3.0
Published
Circom circuits for ZK compliance proofs — sanctions non-membership, credential validity, amount tier encoding
Maintainers
Readme
@clearproof/circuits
Circom circuits for ZK compliance proofs. Prove sanctions clearance, credential validity, and jurisdiction-correct tier encoding — without revealing private data.
Install
npm install @clearproof/circuitsUse pre-compiled artifacts
const { artifacts } = require("@clearproof/circuits");
const snarkjs = require("snarkjs");
const { proof, publicSignals } = await snarkjs.groth16.fullProve(
input,
artifacts.wasmPath,
artifacts.zkeyPath
);Use circuits in your own Circom project
include "@clearproof/circuits/src/sanctions_nonmembership.circom";
include "@clearproof/circuits/src/credential_validity.circom";circom my-circuit.circom \
-l node_modules/@clearproof/circuits/src \
-l node_modules/circomlib/circuits \
--r1cs --wasmCircuits
| Circuit | Constraints | Purpose |
|---------|------------|---------|
| compliance.circom | 15,754 | Main composed circuit |
| sanctions_nonmembership.circom | — | Sorted Merkle gap proof |
| credential_validity.circom | — | Poseidon commitment + expiry + issuer |
| amount_tier.circom | — | Jurisdiction threshold encoding |
Public Signals (16)
| Index | Signal | Description |
|-------|--------|-------------|
| 0 | is_compliant | 1 if all checks pass |
| 1 | sar_review_flag | 1 if tier >= 3 |
| 2 | sanctions_tree_root | Current sanctions Merkle root |
| 3 | issuer_tree_root | Trusted issuer Merkle root |
| 4 | amount_tier | 1-4 |
| 5 | transfer_timestamp | Unix epoch |
| 6 | jurisdiction_code | ISO 3166 as uint |
| 7 | credential_commitment | Poseidon hash |
| 8-10 | tier2/3/4_threshold | Jurisdiction boundaries |
| 11 | domain_chain_id | Blockchain chain ID |
| 12 | domain_contract_hash | Verifier contract hash |
| 13 | transfer_id_hash | Transfer binding |
| 14 | credential_nullifier | One-time use |
| 15 | proof_expires_at | Proof TTL enforced on-chain |
License
Apache-2.0
