ERC-8524 Cryptographic proof attachment standard (Cryptographic Proof Attachment)
Draft · Signatures & auth · created 2026-11-27
A common interface that lets cryptographic proofs be attached to arbitrary on-chain assets and linked to each other through dependency relationships (a DAG).
Why it is needed
Ethereum has no common interface for attaching and composing cryptographic proofs on assets, so each domain has built its own approach. Rollups use different dispute/verification proof ABIs, such as Optimism's FaultDisputeGame, Arbitrum's ChallengeManager, and zkSync's Verifier. Attestation frameworks like EAS, Verax, and Sign Protocol handle signed claims but do not define dependency relationships between proofs or a composition graph with DoS limits. NFT authenticity proofs, supply chain provenance tracking, and reusable credentials each spawn their own verification contracts on each platform that cannot be composed with one another, and tokenized real world assets need a multi-stage verification chain through independent parties such as issuers, appraisers, custodians, and auditors, yet every platform builds its own ad hoc storage for this. As a result, wallets and indexers must learn a separate ABI for every asset type.
What to implement
event ProofAttached( bytes32 indexed assetId, bytes32 indexed proofId, address indexed submitter, bytes32 metadataHash, bytes metadata, bytes32[] dependencies );: Emitted exactly once each time an attachProof call succeeds, recording the asset, proof ID, submitter, metadataHash, full metadata, and the list of dependencies.event ProofFlagsUpdated( bytes32 indexed proofId, address indexed updater, uint256 oldFlags, uint256 newFlags );: Emitted whenever a proof's flag bitfield changes, recording the flag values before and after the change and the party that made the change.function attachProof( bytes32 assetId, bytes32 proofHash, bytes calldata metadata, bytes32[] calldata dependencies ) external returns (bytes32 proofId);: Attaches a new proof to an asset. proofHash commits the off-chain proof data, metadata carries a pointer or inline payload, and dependencies specifies the prior proofs it depends on.function setProofFlags(bytes32 proofId, uint256 setMask, uint256 clearMask) external;: Turns flag bits of an existing proof on with setMask and off with clearMask in a single operation.function getProof(bytes32 proofId) external view returns ( bytes32 assetId, address submitter, bytes32 proofHash, bytes32 metadataHash, bytes memory metadataHead, uint16 metadataLen, uint64 timestamp, bytes32[] memory dependencies, uint256 flags );: Looks up the asset, submitter, proofHash, metadataHash, metadataHead, metadataLen, timestamp, dependencies, and flags for a given proof ID. It does not return the full metadata body.function getAssetProofs(bytes32 assetId, uint256 offset, uint256 limit) external view returns (bytes32[] memory proofIds, uint256 total);: Returns the list of proof IDs attached to a given asset, in registration order, paginated by offset and limit.function proofExists(bytes32 proofId) external view returns (bool);: Returns a boolean indicating whether the given proofId has actually been attached before.function getProofCount(bytes32 assetId) external view returns (uint256);: Returns the total number of proofs attached to the given asset so far.function MAX_METADATA_LEN() external view returns (uint256);: Returns the maximum metadata length that this implementation allows in attachProof.
In depth
ERC-165 interface identifier
The interface ID of IERC8524 is 0x1d613507, computed as the XOR of the standard signature hashes of its 7 external function selectors: attachProof, setProofFlags, getProof, getAssetProofs, proofExists, getProofCount, and MAX_METADATA_LEN. An implementation must return true from supportsInterface(0x1d613507).
assetId domain separation
assetId is a bytes32 identifier, but simply casting a token ID to bytes32 can create collisions where a chain ID or block number numerically overlaps with a contract address. It is therefore recommended to separate domains using keccak256(abi.encode(type tag, chainId, ...)), with a distinct type tag for ERC-721/1155 tokens, L2 blocks, user credentials, RWAs, and contract bytecode.
Deterministic derivation of proofId
The recommended approach is proofId = keccak256(abi.encode(chainId, contract address, assetId, proofHash, submitter, attachNonce)). attachNonce is a counter starting at 0 that increments per (assetId, submitter) pair. metadata, block.timestamp, and block.number are excluded from the preimage because metadata is already committed via proofHash and metadataHash, and block metadata can be manipulated by the proposer in a way that would break self-referencing proofs within the same block.
B-hybrid storage structure for metadata
attachProof receives the full metadata as calldata, but on-chain it only stores metadataHash (keccak256(metadata)), metadataHead truncated to 32-byte units up to 96 bytes, and metadataLen. The full bytes are left only in the ProofAttached event, and getProof returns only these three fields. The maximum metadata length varies by implementation; MAX_METADATA_LEN() must expose a value between 256 and 65535 bytes, and 16384 bytes or more is recommended if it needs to carry inline state/MPT/ZK proofs.
Dependency DAG and cap
The dependencies array is a list of proof IDs of prior proofs, with up to 16 allowed (MAX_DEPENDENCIES). attachProof must revert if the array length exceeds 16, if any proofId in the list does not exist per proofExists, or if it directly references itself. If more dependencies are needed, a single proof carrying a Merkle root can be referenced as a dependency to compose further. Blocking transitive cycles (A to B to ... to A) on-chain is only a recommendation, so applications must verify acyclicity off-chain before submission.
Flag bitfield and permission model
flags is a uint256 bitfield where bit 0 (FLAG_FLAGGED) means under dispute and bit 1 (FLAG_VERIFIED) means verification complete; both bits have fixed, reserved meanings. setProofFlags(proofId, setMask, clearMask) computes newFlags = (oldFlags | setMask) & ~clearMask and must revert if setMask and clearMask overlap. FLAG_VERIFIED cannot be set by the submitter themselves and may only be set by an authorized verifier, except that setting it at attachment time is allowed when the implementation itself acts as the verifier within the same transaction as attachProof. Raising or lowering FLAG_FLAGGED each requires its own separate permission policy. Bits 2 through 255 may be defined by the implementation, but touching an unsupported bit must revert.
Lookup functions and pagination
getProof reverts for a proofId that does not exist and does not return the full metadata body. getAssetProofs(assetId, offset, limit) returns the array of proofIds in registration order along with the total count; if offset is greater than or equal to total it returns an empty array with total, and if limit exceeds the implementation's page size cap it does not revert but truncates internally before returning.
A proposal that has not yet been finalized
This standard is currently in Draft status, written on November 27, 2026, and under active discussion. The interface, constant values, and permission model may change or be discontinued before final approval.
Things to watch out for
- Dependency existence validation: attachProof must check, at call time, that every proofId in dependencies actually exists. Skipping this check would let an attacker build a fake DAG pointing to proofs that do not exist, and that fake dependency relationship could later surface unexpectedly if the same ID happens to be attached afterward.
- Transitive cycles are not fully blocked on-chain: Direct self-reference is cheap to check, so the standard enforces it, but transitive cycles like A to B to ... to A would require traversing the entire graph, which can become prohibitively expensive in gas at deep levels. Applications that require strict acyclicity must verify it off-chain directly before submission; otherwise flag propagation logic could get stuck in a loop that never terminates.
- Denial-of-service risk from metadata length: MAX_METADATA_LEN() must be enforced on-chain inside attachProof, must be a constant or immutable value that an admin cannot change after deployment, and the full metadata body must not be left in contract storage. If any of these three conditions is not met, the published gas cost guarantee can be broken.
- Reserved flag permissions and griefing: If submitters are allowed to set FLAG_VERIFIED themselves, unverified proofs get treated as verified, silently breaking every integrated service. Conversely, if anyone can raise FLAG_FLAGGED at no cost, a single attacker can grief the registry by marking every proof as disputed.
- Impersonation risk when supporting meta-transactions: Implementations that support trusted-forwarder schemes like ERC-2771 must strictly validate calldata length and the decoding of the original sender. Otherwise, a compromised forwarder can pass short calldata so that msg.sender is passed through as the submitter still set to the forwarder's own address, enabling impersonation and false FLAG_VERIFIED grants.