Hello everyone,
I am proposing ERC-XXXX (Cryptographic Proof Attachment Standard) — a minimal, vendor-neutral on-chain interface (IERCXXXX) for attaching cryptographic proof artifacts to arbitrary bytes32 assets and composing them into bounded dependency DAGs.
Motivation
Attestation standards (EAS, Verax, Sign Protocol) model who said what about whom, while cross-chain messaging/storage-proof standards (such as ERC-7888) focus on remote state-slot verification. Neither defines a shared local ABI for:
- binding a fixed-shape off-chain proof commitment (
proofHash) to an arbitrary domain-separatedassetId, - expressing bounded proof-to-proof dependencies (
MAX_DEPENDENCIES = 16, with strict on-chain existence and direct self-reference checks), - exposing a minimal reserved verification/dispute flag bitfield (
FLAG_FLAGGED,FLAG_VERIFIED) consumable by generic wallets, indexers, and explorers without per-schema logic, - accepting either compact pointers (IPFS/Arweave/attestation UIDs) or inline proof payloads (MPT / ZK proofs up to an immutable per-implementation
MAX_METADATA_LEN()) without forcing full-payloadSSTORE.
Key Design Choices
- Minimal 7-function interface (
IERCXXXX, ERC-165 ID0x7118c651, CC0-1.0):attachProof,setProofFlags,getProof,getAssetProofs,proofExists,getProofCount,MAX_METADATA_LEN. - B-hybrid metadata layout:
attachProofaccepts fullmetadatacalldata (capped by an immutableMAX_METADATA_LEN()in[256, 65535]) and emits the full bytes inProofAttached, whilegetProofpersists and returns onlymetadataHash, a word-alignedmetadataHead(0 / 32 / 64 / 96 bytes), anduint16 metadataLen. - Pure DAG invariant: every
dependencies[i]MUST satisfyproofExists(dependencies[i]) == true. Larger dependency sets (> 16) compose by attaching a normal Merkle-root proof (proofHash == merkleRoot) and referencing itsproofIdas a single dependency. - Deterministic
proofId: recommended preimage(block.chainid, address(this), assetId, proofHash, submitter, attachNonce)excludesmetadata,block.timestamp, andblock.number, makingproofIdprecomputable off-chain and direct self-reference checks exact. - Reference implementation (MIT, Foundry):
ProofRegistry(~4.4 KB), optionalProofRegistryMerkleextension,NFTAuthenticityworked example, all 9 mandatory compliance tests, fuzz suite, and gas snapshot benchmarks.
Links
- Repository (
draft-v0.1.0): GitHub - nidhal-ferjani/cryptographic-proof-attachment-standard: Draft ERC: minimal, composable interface for attaching cryptographic proofs to on-chain assets via bounded DAG dependencies · GitHub - Normative draft specification: cryptographic-proof-attachment-standard/EIP-XXXX.md at draft-v0.1.0 · nidhal-ferjani/cryptographic-proof-attachment-standard · GitHub
- Interface (
IERCXXXX.sol): cryptographic-proof-attachment-standard/contracts/interfaces/IERCXXXX.sol at draft-v0.1.0 · nidhal-ferjani/cryptographic-proof-attachment-standard · GitHub - Reference implementation (
ProofRegistry.sol): cryptographic-proof-attachment-standard/contracts/core/ProofRegistry.sol at draft-v0.1.0 · nidhal-ferjani/cryptographic-proof-attachment-standard · GitHub
Feedback from EIP editors, rollup/indexer teams, and application builders is very welcome — especially on the B-hybrid metadataHead word-alignment rule, the immutable MAX_METADATA_LEN() bounds, and reserved flag semantics.