ERC-8281 On-chain observation commitment verification protocol (Observation Commitment Protocol)
Draft · Other · created 2026-06-03
Standardizes a proof format and verification procedure so that a third party can independently confirm, without trusting the issuing system, that specific byte data was recorded on-chain at a specific point in time.
Why it is needed
Ethereum has no standard procedure for a third party to confirm that specific byte data was committed on-chain, independent of the system that created the commitment. As a result, each project defines its own way of encoding observation data, structuring proof artifacts, referencing transactions, and implementing verification logic. A proof created by one system cannot be independently verified by another system without custom integration. Data availability and execution correctness are not the issue. The issue is that there is no shared verification boundary that anyone can follow. This standard fills that gap by defining a minimal procedure for confirming a commitment from raw transaction receipt data alone, without a trusted SDK, gateway, or indexer.
What to implement
function record(bytes32 digest) external;: A function that records the digest passed by the caller on chain.
In depth
Contract interface and events
The IObservationCommitment interface defines a single function, record(bytes32 digest). This function records the digest passed by the caller as is and emits the Recorded(bytes32 indexed digest, address indexed committer) event. The topic-0 value of the event signature is fixed as keccak256("Recorded(bytes32,address)"), which equals 0xdca60c2087041cbb12d9a57628c6cad28ecbd0437e47c7ab6c3aa6e162bf4497. If ERC-165 is supported, the interface ID is 0xb5c645bd, the function selector for record(bytes32). Supporting ERC-165 only means the contract claims this interface; it does not guarantee that the standard is actually implemented correctly. Also, in a proxy structure where the log is emitted via delegatecall, the contract field in the proof envelope must exactly match the proxy address that actually emitted the log, not the implementation contract's address.
Hash function registry
The hash_function field of the proof envelope must be one of sha2-256, keccak-256, or blake2b-256. Verifiers must reject envelopes that declare an identifier outside the registry. All three produce a 256-bit output and have at least 128-bit collision resistance. In particular, blake2b-256 refers to BLAKE2b initialized with a 256-bit digest length parameter, which differs from a BLAKE2b-512 output truncated to 32 bytes; the latter truncated value is not accepted. This registry is closed for the lifetime of this ERC, so adding a new hash function requires a follow-up ERC.
Proof envelope schema
The proof envelope is a JSON object in which the fields version, digest, hash_function, chain_id, contract, tx_hash, block_number, receipt_log_position, and committer are all required, while block_hash is optional. digest, tx_hash, and block_hash must be 66-character lowercase hexadecimal strings starting with 0x, and chain_id, block_number, and receipt_log_position must be decimal strings with no leading zeros. contract and committer must follow the ERC-55 checksum format, and addresses with an incorrect checksum are rejected. All comparisons are made against decoded bytes or integer values, not as string comparisons. Fields not in the list are ignored by verifiers.
Extraction Rule
The verifier first checks that the RPC endpoint's eth_chainId matches the envelope's chain_id, then fetches the receipt using tx_hash. If the receipt's status is not 1 (either a reverted transaction or, as with pre-Byzantium forks, a receipt lacking a status field), extraction fails. Only the single log at the position indicated by receipt_log_position is selected; this position is within the receipt's log array and differs from the JSON-RPC logIndex, which is the position within the block. The selected log's address must match contract, it must have exactly 3 topics, and topics[0] must match the Recorded signature. topics[1] is decoded as the digest and topics[2] as the committer address. If block_hash is present in the envelope, it must also match the receipt's blockHash. The data field is not used and is ignored.
The 5 steps of the verification invariant
A verifier must pass all five steps to accept a commitment. Recompute: apply the declared hash function to the observation bytes held by the verifier to obtain H_prime. Compare: check that H_prime equals the envelope's digest. Confirm inclusion: apply the extraction rule to check that the on-chain digest equals digest. Confirm committer: check that the on-chain committer equals the envelope's committer. Confirm block: check that the receipt's blockNumber equals the envelope's block_number. If any step fails, the whole commitment is rejected; a partially passing state is not treated as a valid commitment. The digest is self-verifying since the verifier recomputes it directly, but the committer value is simply trusted as whatever the contract wrote into the log, so unless the contract itself is independently trusted, there is no guarantee that address was the actual caller.
Why receipt_log_position is used
The same contract can emit the Recorded event multiple times within a single transaction. An any-match approach, accepting any log whose digest matches, makes it ambiguous which commitment is being verified and risks an attacker inserting a fake commitment into the same transaction to preempt a legitimate one. receipt_log_position removes this ambiguity by specifying the exact position within the receipt's log array. The field was named receipt_log_position rather than log_index precisely because JSON-RPC's logIndex is a block-wide position, and a similar name would risk implementers comparing the wrong value.
Out of scope
This ERC does not define authorship (identity), data sanitization, data availability, canonical encoding of observation content, or application-layer semantics. It also does not define extraction specifications for non-EVM chains, and compliance with this standard must not be claimed on non-EVM chains. It also does not address the linkage between multiple record() calls, i.e., relationships such as superseding or supplementing a prior commitment (inheritance or update ordering). A committed digest is only a one-off fact; ordering it or interpreting the current state on top of it is left to higher layers that make use of this standard.
Current status
As of December 2026 this proposal is still in Draft status and has not yet been finalized. Since detailed field definitions or the verification procedure may change, or discussion may stall, developers who intend to actually adopt and use it should check the latest discussion and change history together.
Things to watch out for
- Hash function whitelist: If a committer were free to choose any hash function, they could select a weak hash (e.g. MD5) and present colliding observation data. This standard prevents this attack by maintaining a registry of allowed hash functions and requiring verifiers to reject envelopes that declare an identifier outside the registry.
- Low-entropy observation data: A commitment is binding (immutable) but does not guarantee hiding. Hashing predictable values such as forms, votes, or prices allows the original value to be recovered from the published digest via brute-force preimage search. When committing low-entropy data, it is recommended to mix in a salt before hashing and to keep that salt alongside the observation data.
- RPC trust: Verifying using only the receipt obtained from a single RPC endpoint amounts to trusting that endpoint to return honest data. It is recommended to cross-check multiple independent RPC providers, or to directly verify the receipt using a Merkle Patricia trie proof based on the block header.
- Finality and reorgs: A commitment in a given block is only as safe as how finalized that block is. On PoS Ethereum, economic finality is reached after about 2 epochs (about 12.8 minutes), and on L2s, a block confirmed by the sequencer may not yet be settled on L1. The optional block_hash field serves as a means of detecting whether a transaction has moved to a different block due to a reorg.
- Contract trust: The verification procedure only confirms that a specific contract emitted a Recorded log with the declared digest. Any contract can emit an event with the same signature, so whether to trust a given contract address is a judgment the verifying party must make independently, for example through code review or checking a known registry. It does not guarantee that the deployment complies with this standard, nor that the committer is actually the caller of record().