---
eip: 8262
label: ERC-8262
title: Zero-Knowledge Compliance Oracle
status: Draft
type: Standards Track
category: ERC
created: 2026-04-07
requires: 165
official: https://eips.ethereum.org/EIPS/eip-8262
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-8262.md
canonical: https://eips.huatuo.xyz/eip-8262/
lang: en
tldr: "An on-chain oracle interface where users submit zero-knowledge proofs that their screening results meet a jurisdiction's AML rules, so contracts can check compliance without anyone seeing the underlying data."
tags: [zk, compliance, privacy, oracle, aml]
---

# ERC-8262: Zero-Knowledge Compliance Oracle

> On-chain ZK compliance verification without revealing transaction data

**TL;DR:** An on-chain oracle interface where users submit zero-knowledge proofs that their screening results meet a jurisdiction's AML rules, so contracts can check compliance without anyone seeing the underlying data.

## What problem does it solve?

Public chains make users choose between transparency (everything visible, including trades exposed to MEV) and privacy tools that may lack any compliance story. Existing middle grounds each have gaps: view keys eventually reveal raw data to auditors, TEE-based approaches depend on hardware trust, and set-exclusion proofs ("I am not on this list") do not show compliance with a specific rule.

ERC-8262 proposes a standard **compliance oracle**. A user generates a ZK proof on their own device showing, for example, that a weighted risk score from several screening providers is below a jurisdiction's threshold. The oracle verifies the proof and records an attestation that contracts can query. Only the boolean result and some commitments become public.

## How it works

- **Nine proof types**, each its own circuit: Compliance (0x01), Risk Score threshold/range (0x02), Pattern checks for anti-structuring, velocity or round amounts (0x03), Credential Attestation (0x04), Membership (0x05), Non-membership (0x06), and provider-signed variants (0x07, 0x08) plus an M-of-N multi-signed variant (0x09).
- **Scoring:** the score is the weighted average of provider signals (each 0–100), expressed in basis points and compared with a published per-jurisdiction threshold. The spec's table covers ids 0–4 (EU, US, UK, Singapore, UAE), along with a policy for each on whether unsigned proofs are accepted and the minimum M for multi-signed proofs.
- **Binding:** every proof includes `submitter`, which must equal `msg.sender`, so nobody can reuse someone else's proof. `proofHash = keccak256(proof, proofType, chainid, oracle)` prevents on-chain replay.
- **Attestations** expire after a TTL (default 24 h, allowed range 1 h to 30 days) but stay retrievable through `getHistoricalProof` as "proof of innocence" if an address is flagged later.
- **Registries** for config hashes, Merkle roots, signer keys and thresholds stop proofs from being replayed in the wrong context. Admin changes use two-step ownership, and submissions can be paused without blocking reads.

The proof system must give at least 128-bit security. The reference uses Noir circuits with UltraHonk.

## Sample code

Gating a function on a valid attestation, using the spec's oracle interface (trimmed):

```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

interface IERC8262Oracle {
    struct ComplianceAttestation {
        address subject; uint8 jurisdictionId; uint8 proofType; bool meetsThreshold;
        uint256 timestamp; uint256 expiresAt; bytes32 proofHash; bytes32 providerSetHash;
        bytes32 publicInputsHash; address verifierUsed;
    }
    function checkComplianceByType(address subject, uint8 jurisdictionId, uint8 proofType)
        external view returns (bool valid, ComplianceAttestation memory attestation);
}

contract GatedVault {
    IERC8262Oracle public immutable oracle;
    uint8 constant JURISDICTION_EU = 0;
    uint8 constant COMPLIANCE_SIGNED = 0x07;   // require provider-attested signals

    constructor(IERC8262Oracle o) { oracle = o; }

    function deposit() external payable {
        (bool ok, IERC8262Oracle.ComplianceAttestation memory a) =
            oracle.checkComplianceByType(msg.sender, JURISDICTION_EU, COMPLIANCE_SIGNED);
        require(ok && a.meetsThreshold, "no valid compliance attestation");
        // ... accept deposit
    }
}
```

## Things to know

- **Status: Draft.** Circuits, constants and the jurisdiction table may change.
- The proofs guarantee *correct computation*, not *honest inputs*. In the unsigned types (0x01, 0x02) the user supplies their own screening signals. Integrators who need provider-backed data should require the signed or credential-based types via `checkComplianceByType`.
- The threshold and policy values are the spec's reference choices. Whether they satisfy any regulator is a legal question the standard does not settle; check with qualified counsel before relying on them.
- In the draft text, the attestation struct comment lists jurisdiction ids 0–3, while the threshold table also defines 4 (UAE).
- Compared with [ERC-3643](/eip-3643/), which verifies on-chain identity claims, this standard aims to reveal no identity data. The older generic verifier interface [ERC-1922](/eip-1922/) is stagnant.


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-8262
