Alert Source Discuss
⚠️ Draft Standards Track: ERC

ERC-8299: WYRIWE — Input Provenance for AI Inference

Defines an input-provenance commitment scheme and attestation profile for verifiable AI agent inference

Authors Tiago Merlini (@TMerlini), Vincent Wu (@TruthAnchor-AI), Damon Zwicker (@damonzwicker), Jimmy Shi (@JimmyShi22), babyblueviper1 (@babyblueviper1)
Created 2026-05-28
Discussion Link https://ethereum-magicians.org/t/erc-8299-wyriwe-what-you-read-is-what-you-execute/28655
Requires EIP-712, EIP-8004

Abstract

This ERC defines a triple-hash commitment scheme and an EIP-712 attestation profile for proving that the input an artificial intelligence (AI) model received is the input the user submitted, transformed only by a declared, public specification. It introduces three linked values — raw_input_hash, sanitization_pipeline_hash, and input_hash — that together form a verifiable chain of custody for AI inference inputs. A verifier holding the raw input can confirm input integrity from the committed hashes and the public sanitization specification, without trusting the agent, gateway, or execution environment. This standard occupies the input-provenance layer of the AI inference trust stack, complementing ERC-8004 (agent identity) and ERC-8126 (agent verification).

Motivation

On-chain AI agent systems built on standards such as ERC-8004 and ERC-8126 can establish which agent is registered and whether it is considered trustworthy, and proof-verification layers can attest which model ran and what output was produced. No standard defines how to commit to the input before inference. This creates a trust gap: an agent may sanitize, rewrite, or substitute the user’s input between request submission and model execution, leaving no evidence of the transformation.

ERC-8126 (AI Agent Verification) addresses the question “Is this agent trustworthy?” through risk scores and verification registries. It does not record what the agent actually processed in a specific invocation. WYRIWE (What You Read Is What You Execute) fills that gap.

Without a committed input record:

  • A settlement contract cannot verify that the delivered output corresponds to the funded input.
  • A proof verifier cannot confirm that the inputHash it receives matches what was originally requested.
  • A commit-reveal dispute mechanism has no ground truth for what the model was actually asked to do.

WYRIWE closes this gap with a minimal, hash-based commitment that a compliant gateway produces at execution time and that any verifier can check independently.

Specification

The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “NOT RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in RFC 2119 and RFC 8174.

1. Triple-Hash Construction

A WYRIWE-compliant execution MUST produce the following three values:

raw_input_hash             = keccak256(raw_user_input)
sanitization_pipeline_hash = keccak256(utf8(sanitization_spec_uri) || raw_input_hash)
input_hash                 = keccak256(sanitized_input)

Where:

  • raw_user_input is the exact bytes of the user’s input as received, before any transformation.
  • sanitization_spec_uri is the full InterPlanetary File System (IPFS) Uniform Resource Identifier (URI) of the sanitization specification, including the ipfs:// scheme prefix (for example ipfs://Qmccvom6aRVgZ2dtFWvT6Wm3DmTvoAUHHotK7uQufnStVR). utf8(...) is its UTF-8 encoding. The ipfs:// prefix is part of the preimage.
  • raw_input_hash in the second line is the 32-byte value from the first line.
  • sanitized_input is the exact bytes fed to the model after applying the sanitization specification to raw_user_input.
  • || denotes byte concatenation.

sanitization_pipeline_hash binds the specification to this specific raw input, so a pipeline commitment cannot be replayed against a different input.

2. Identity Transform

When no sanitization is applied, the identity-transform specification MUST be used, and the following MUST hold:

sanitization_spec_uri      = IDENTITY_SENTINEL_CID
sanitization_pipeline_hash = keccak256(utf8(IDENTITY_SENTINEL_CID) || raw_input_hash)
input_hash                 = raw_input_hash

where:

IDENTITY_SENTINEL_CID = "ipfs://Qmccvom6aRVgZ2dtFWvT6Wm3DmTvoAUHHotK7uQufnStVR"

sanitization_pipeline_hash MUST NOT be omitted or zero-valued in the identity case.

2.1 Identity-Transform Specification

The content identified by IDENTITY_SENTINEL_CID is normative and frozen. It is the following 760 bytes: the UTF-8 encoding of the JSON text below, with two-space indentation and LF line endings exactly as shown, followed by one trailing LF.

{
  "name": "identity-transform",
  "version": "1",
  "description": "The identity sanitization pipeline. No modification is applied to the input. The sanitized output is identical to the raw input byte-for-byte.",
  "transform": "none",
  "input": "raw_user_input (bytes, unmodified)",
  "output": "raw_user_input (bytes, identical to input)",
  "invariants": [
    "sanitized_input == raw_user_input",
    "input_hash == raw_input_hash",
    "sanitization_pipeline_hash == keccak256(IDENTITY_SENTINEL_CID_bytes || raw_input_hash)"
  ],
  "notes": "Use this CID when no sanitization is applied. The input_hash == raw_input_hash equality is a provable on-chain claim. Implementations MUST NOT substitute any other CID to represent the no-sanitization case."
}

The content identifier (CID) is a version-0 CID computed the way ipfs add computes it for a file of this size with default settings: the bytes are wrapped in a single UnixFS File node (no chunking, since the content is smaller than the default 262144-byte chunk) inside a DAG-PB node, the node is hashed with SHA2-256, and the multihash is encoded in base58btc. A verifier holding these 760 bytes MUST obtain Qmccvom6aRVgZ2dtFWvT6Wm3DmTvoAUHHotK7uQufnStVR. Implementations SHOULD pin this CID.

3. WyriweAttestation Struct

A WYRIWE attestation is an EIP-712 typed structured data record with the following fields:

struct WyriweAttestation {
    bytes32 agentId;                    // ERC-8004 agent identity anchor
    address registry;                   // ERC-8004 identity registry address
    bytes32 modelHash;                  // commitment to the model that ran
    bytes32 rawInputHash;               // raw_input_hash
    bytes32 sanitizationPipelineHash;   // sanitization_pipeline_hash
    bytes32 inputHash;                  // input_hash
    bytes32 outputHash;                 // keccak256(model_output)
    bytes32 commitmentHash;             // see below
    uint256 timestamp;                  // Unix time in seconds at which the attestation was signed
}

All fields are REQUIRED and MUST be populated.

  • agentId is the ERC-8004 registry identity anchor — the identifier the registry assigns — not a hash of any human-readable name. When the ERC-8004 identity is a uint256 registry id, agentId is its left-padded encoding bytes32(uint256(id)) (for example, registry id 860 becomes 0x000…035c). Deriving an identity from a human-readable name is out of scope for this ERC; an implementation that does so MUST declare the derivation, and an Ethereum Name Service (ENS) name SHOULD be mapped to its ERC-137 namehash, never to keccak256(utf8(name)). Where the execution environment does not implement ERC-8004, agentId and registry MAY be zero.
  • modelHash is a 32-byte commitment to the model or its manifest. The attestor MUST document how it is computed.
  • outputHash is keccak256(model_output), where model_output is the exact bytes the model returned.
  • commitmentHash is keccak256(abi.encode(agentId, modelHash, inputHash, outputHash, timestamp)), with the five values encoded as bytes32, bytes32, bytes32, bytes32, uint256. It lets a verifier that holds only these five values check them against the signed record.

The canonical EIP-712 type string is:

WyriweAttestation(bytes32 agentId,address registry,bytes32 modelHash,bytes32 rawInputHash,bytes32 sanitizationPipelineHash,bytes32 inputHash,bytes32 outputHash,bytes32 commitmentHash,uint256 timestamp)

Field order is normative. A type string with fields in any other order produces a different type hash and MUST NOT be used.

4. EIP-712 Domain and Signature

The EIP-712 domain for WYRIWE attestations is:

EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)

name              = "WyriweAttestation"
version           = "1"
chainId           = the chain ID of the chain on which `registry` is deployed
verifyingContract = registry

Binding the domain to registry means a signature made for one registry does not verify against another. chainId MUST be the chain ID of the registry’s chain, including when the attestation is signed off-chain.

The attestation is signed with the EIP-712 signing method (eth_signTypedData in EIP-712) over the digest keccak256("\x19\x01" || domainSeparator || hashStruct(WyriweAttestation)). The signature is 65 bytes, r || s || v, with v ∈ {27, 28} and s in the lower half of the secp256k1 curve order. A signature produced with eth_sign or personal_sign, which prefix the message with "\x19Ethereum Signed Message:\n", MUST NOT be used.

The address that produces the signature is the attestor.

5. Verification Procedure

A verifier evaluating a WYRIWE attestation MUST perform the following checks and report one of three results: verified, refuted, or unverifiable.

  1. Recompute the EIP-712 digest from the attestation fields and the domain in Section 4, recover the signer, and check that it equals an attestor the verifier accepts for this agentId and registry. Recovering some address is not sufficient: every well-formed signature recovers to an address.
  2. Recompute commitmentHash from agentId, modelHash, inputHash, outputHash and timestamp, and check it equals the attested value.
  3. If the raw input is available: check rawInputHash == keccak256(raw_user_input).
  4. If the raw input is available: obtain sanitization_spec_uri (from the gateway response in Section 6, or IDENTITY_SENTINEL_CID for the identity case), check sanitizationPipelineHash == keccak256(utf8(sanitization_spec_uri) || rawInputHash), apply the specification to raw_user_input, and check that keccak256 of the result equals inputHash. For the identity case this reduces to inputHash == rawInputHash.

The result is refuted if any check that was performed fails. It is verified if all four checks pass. If checks 1 and 2 pass but the raw input or the specification is not available, the result is unverifiable for input provenance: the attestor’s signature over the hashes is authentic, but the chain from raw input to model input has not been checked. A verifier MUST NOT report an attestation as verified when checks 3 or 4 were skipped.

A sanitization specification is identified by content; this ERC defines the identity specification (Section 2.1) and does not define a format for other specifications. A gateway that uses another specification MUST publish it at its sanitization_spec_uri in a form that states its transform exactly enough for an independent verifier to reproduce sanitized_input from raw_user_input.

6. Gateway Query Interface

A compliant gateway MUST expose:

GET /agent/verify/:inputHash

where :inputHash is the inputHash as hexadecimal, with or without a 0x prefix, case-insensitive. On success the response MUST be HTTP 200 with a JavaScript Object Notation (JSON) body:

{
  "inputHash": "0x…",
  "attestations": [
    {
      "attestation": {
        "agentId": "0x…", "registry": "0x…", "modelHash": "0x…",
        "rawInputHash": "0x…", "sanitizationPipelineHash": "0x…", "inputHash": "0x…",
        "outputHash": "0x…", "commitmentHash": "0x…", "timestamp": "1790000000"
      },
      "domain": { "name": "WyriweAttestation", "version": "1", "chainId": 1, "verifyingContract": "0x…" },
      "signature": "0x…",
      "attestor": "0x…",
      "sanitizationSpecUri": "ipfs://…"
    }
  ]
}

bytes32 and address values MUST be 0x-prefixed hexadecimal; timestamp MUST be a decimal string; chainId MUST be a JSON number. attestations MUST list every attestation the gateway holds for that inputHash, newest first. The gateway MUST respond with HTTP 404 when it holds none.

A gateway SHOULD keep the content at every sanitizationSpecUri it returns retrievable, for example by pinning it, for as long as it serves attestations that reference it.

7. ClaimType Discriminator

Every signed claim artifact has a claimType identifying the accountability model of the claim. It is distinct from proofSystem and MUST NOT be conflated with it:

  • proofSystem belongs to the proof-verifier contract path and has contract context. It identifies the cryptographic mechanism that authenticated the artifact.
  • claimType is fixed by the signed artifact and travels without that context. It identifies the accountability and dispute model.

An off-chain consumer holding only the raw signed struct MUST be able to determine the accountability model without a registry lookup. For the structs defined in this ERC, the authenticated carrier is the EIP-712 primary type, which the signature covers through its typeHash: a WyriweAttestation is an Attestation-class claim, and a JudgmentExecutionAttestation (Section 9.5) is a Judgment-class claim. A struct type that does not fix its class this way MUST carry claimType as a signed field.

A verifier MUST derive the claim class only from a primary type listed in this ERC, identified by its type string or typeHash (Test Cases, Case 5), or from a signed claimType field. For any other primary type without a signed claimType, the claim class is unverifiable, and a verifier MUST NOT infer it from the struct name or from context.

A JudgmentExecutionAttestation is Judgment-class because the claim it carries is that the named validator judged the identified proposal. That claim is established by the struct together with the validator’s verdict signature (Section 9.4). The attestor’s signature authenticates only the recorded hashes, and accountability for the judgment rests with the validator.

enum ClaimType {
    ReExecution,  // deterministic computation — objectively disputable
    Attestation,  // authorized signer certifies a result
    Judgment      // subjective assessment — accountable through track record / policy
}

The fields answer different questions:

  • proofSystem answers: what cryptographic mechanism authenticated the artifact?
  • claimType answers: what kind of accountability model backs the claim?
claimType proofSystem examples Accountability Dispute surface
ReExecution zk/sp1, zk/ezkl, op/ora Mathematical / economic Objectively disputable
Attestation attestation/wyriwe, attestation/multisig Signer authorization / stake / reputation Signer registry or policy
Judgment attestation/judgment Track record / reputation / policy-defined stake Pre-outcome commitment and later outcome evidence

A proof verifier for WYRIWE attestations SHOULD report proofSystem() = "attestation/wyriwe".

8. Consumer Requirements

A settlement contract or other consumer that acts on WYRIWE attestations MUST enforce its own replay protection, for example by recording consumed inputHash or commitmentHash values. timestamp records when the attestation was signed and does not prevent replay.

9. Judgment Composition

This section applies only to an implementation that composes a judgment layer with WYRIWE: a judgment validator that issues a JudgmentExecutionAttestation, or a verifier or consumer that accepts one. A WYRIWE implementation that does neither is unaffected by it.

9.1 Hashes

rawProposalHash    = sha256(proposed_action_artifact)
verdictHash        = sha256(JCS(verdict_preimage))
executedActionHash = sha256(executed_action_record)

proposed_action_artifact and executed_action_record are hashed as the exact bytes submitted for review and recorded at execution, with no further canonicalization. JCS is the JSON Canonicalization Scheme of RFC 8785. verdict_preimage is a JSON object whose members are the verdict’s named preimage fields.

The verdict preimage MUST contain a member artifact_hash whose value is a string of 64 hexadecimal digits, with or without a 0x prefix, encoding the 32 bytes of rawProposalHash. This is what binds the verdict to the proposal it judged. The exact string is whatever the producer hashed; verdictHash commits to it, so verifiers compare the decoded bytes (Section 9.2) and never re-encode the string.

9.2 Declared preimage fields

The producer MUST publish, alongside every verdictHash, the list of member names of its verdict_preimage as a JSON array named decision_ref_preimage_fields. A verifier MUST:

  1. obtain the disclosed verdict_preimage and its decision_ref_preimage_fields;
  2. check that the member names of verdict_preimage are exactly the declared list and that the list contains artifact_hash;
  3. decode the preimage’s artifact_hash to 32 bytes and check that they equal the attestation’s rawProposalHash; a value that does not decode to exactly 32 bytes is a failed check;
  4. recompute verdictHash from the disclosed preimage and compare it with the attested value.

Step 3 is what ties the verdict to the attested proposal; a matching verdictHash alone does not.

A verifier MUST NOT assume a fixed field set. If the preimage or the list cannot be obtained, the result is unverifiable; if a check fails, the result is refuted.

9.3 Intended verifier

When the consuming proof-verifier instance is known at judgment time, the verdict preimage MUST contain a member intended_verifier whose value is the account identifier of that instance as defined by Chain Agnostic Improvement Proposal (CAIP) 10. A verifier MUST report refuted for a verdict whose intended_verifier names a different instance than itself.

When the preimage carries no intended_verifier, the verdict is not bound to any gate. A verifier MUST report alongside its result that gate binding was not established, and MUST NOT treat the missing field as replay-safe. A consumer MUST enforce its own authenticated consumer scope before acting on such a verdict.

9.4 Validator identity

validatorId identifies the judgment validator. The validator authenticates its verdict by signing the verdict artifact that verdictHash pins; it does not sign the execution attestation (Section 9.5). A verifier MUST verify that signature against the validator’s key. When validatorId is zero, the validator is not registered in an ERC-8004 registry, and its identity MUST be resolved from the verdict artifact through an authenticated mechanism, such as a signature over the verdict by the key the artifact names. If that resolution is unavailable, the result is unverifiable; if it fails, the result is refuted.

9.5 Execution attestation

The executing agent’s attestor MUST sign the following struct under EIP-712, with the domain defined in Section 4, when the execution is recorded. As in Section 5, the recovered signer MUST be an accepted attestor for agentId; otherwise the result is refuted.

struct JudgmentExecutionAttestation {
    bytes32 agentId;             // identity of the executing agent
    address registry;            // ERC-8004 registry
    bytes32 validatorId;         // identity of the judgment validator, or zero (Section 9.4)
    bytes32 rawProposalHash;     // Section 9.1
    bytes32 verdictHash;         // Section 9.1
    bytes32 executedActionHash;  // Section 9.1
    uint256 verdictTimestamp;    // verdict issuance, Unix seconds
    uint256 executedTimestamp;   // execution, Unix seconds
    string  recordPointer;       // locator of the accountability record
}
JudgmentExecutionAttestation(bytes32 agentId,address registry,bytes32 validatorId,bytes32 rawProposalHash,bytes32 verdictHash,bytes32 executedActionHash,uint256 verdictTimestamp,uint256 executedTimestamp,string recordPointer)

Both verdictTimestamp and executedTimestamp MUST be populated, so that a consumer can apply an ordering policy. Which ordering a consumer requires, which time source it trusts, and what it does on a violation are consumer policy and are not specified here. A proof verifier for JudgmentExecutionAttestation records SHOULD report proofSystem() = "attestation/judgment".

A valid JudgmentExecutionAttestation, together with a verified verdict signature, establishes that the named validator judged the identified proposal and that an accepted attestor recorded the attested action hash. It does not by itself prove that execution occurred, and it does not establish execution ordering or authorization.

Rationale

Why three hashes?

Two hashes (raw and final) prove that the input was transformed but not which transformation was applied. sanitization_pipeline_hash commits to both the specification and the raw input, making the transform auditable and reproducible by any third party.

Why content-addressed specifications?

A content-addressed reference ensures the specification retrieved at verification time is the one applied at execution time. A mutable URL would let the specification be swapped after the fact, defeating the commitment.

Why EIP-712, and why bind the domain to the registry?

EIP-712 signatures are verifiable on-chain and by existing wallet tooling, and the structured hash is deterministic. Using the ERC-8004 registry as verifyingContract scopes each signature to one registry on one chain without an extra field.

Why include agentId, registry and commitmentHash?

Linking attestations to an ERC-8004 identity makes them attributable to a registered agent, not only to a signing key, which settlement systems such as ERC-8183 need. commitmentHash gives an on-chain verifier a single value that binds the agent, model, input, output and time, so it can be recorded or compared without the full struct.

Why an identity specification instead of a null value?

A null or zero sanitization_pipeline_hash would make it ambiguous whether the field was omitted or a transform was applied but not committed. The identity specification makes the no-sanitization case explicit and verifiable on equal footing with sanitized cases.

Why check the attestor, not just the signature?

ecrecover returns an address for every well-formed signature. A verifier that only checks that the recovered address is non-zero accepts attestations signed by anyone. Section 5 therefore requires comparing the recovered signer with an attestor the verifier accepts.

Relationship to ERC-8126

ERC-8126 defines risk scores and verification registries that answer “Is this agent trustworthy?” WYRIWE answers “What did this agent actually process in this invocation?” The two compose: a settlement contract may require both that the agent is verified under ERC-8126 and that the input commitment matches the funded request.

Composition with Adjacent Layers

This subsection is informative. It describes integration patterns that reuse WYRIWE’s chain-of-custody shape at other layers. None of them is required of a WYRIWE implementation; what an implementation that composes a judgment layer has to do is in Section 9.

Settlement snapshots. A mesh of gateways that settles contribution counts can commit to a snapshot the same way: snapshotRoot = keccak256(abi.encode(rows)) over rows of (address contributor, uint256 score, uint256 timestamp) sorted by contributor, and commitmentHash = keccak256(abi.encode(snapshotRoot, periodId, nodeAddress)), submitted in a commit phase and checked against the revealed rows in a reveal phase. A node can only reveal rows whose hash matches its commitment.

Judgment. The same question exists one layer up for judgment validators: nothing in an input commitment binds “action reviewed” to “action executed after the verdict”. The shape maps slot for slot:

WYRIWE Judgment (example)
rawInputHash — what the user submitted rawProposalHash — what the agent proposed
sanitizationPipelineHash — public spec transforming raw → permitted verdictHash — the verdict, including any conditions, transforming proposed → permitted
inputHash — what the model actually received executedActionHash — what was actually executed
identity specification — no-sanitization is a provable claim unconditional approval — executed-as-reviewed is a provable claim

Section 9 makes the parts a verifier has to check normative: the declared preimage fields, the intended verifier, authenticated validator identity, and the presence of both timestamps. The rest is policy. Typically the verdict is committed when it is issued and the execution attestation revealed after execution, so the executor can only reveal an action whose hash matches what was judged. Consumers commonly require verdictTimestamp < executedTimestamp. Relay-published verdicts can be overwritten on some relays, so the time a verdict was first published is best taken from an on-chain commitment where one exists, and a later relay copy’s timestamp should not be read as the commit time. Keeping commitment evidence and outcome evidence separately addressable lets a dispute check the commitment without seeing the outcome.

The preimage field list is declared on each proof, not fixed here, because in practice it grows: a verifier that hardcoded an earlier set would report its own stale assumption as a bad proof. intended_verifier exists because a preimage that binds only the judge and the content judged can be replayed against any gate willing to accept it.

A common proof-verifier interface is being specified separately, with an example of verifying a signed verdict in its reference implementation. This ERC does not depend on it.

Backwards Compatibility

This ERC introduces a new standard and does not modify any existing interface.

Implementations deployed before this revision used other EIP-712 domain names (for example ERC8004AttestationGateway) or other pipeline-hash constructions. Signatures and hashes produced that way do not verify under this ERC; such attestations need to be re-issued to be conformant.

Test Cases

Case 1: Identity transform

raw_user_input             = "transfer 1 ETH to 0xABCD..."   (UTF-8)
                           = 0x7472616e7366657220312045544820746f203078414243442e2e2e
raw_input_hash             = 0x49a368dd77974bb589199333d0ee5e6796c1ae449b13b5336bdb5a3606ac4772
sanitization_spec_uri      = "ipfs://Qmccvom6aRVgZ2dtFWvT6Wm3DmTvoAUHHotK7uQufnStVR"
sanitization_pipeline_hash = 0x0bac6c485a2b53c833d464e1b41ff387363d1a529026984d7aff276cd1adec38
input_hash                 = raw_input_hash

Case 2: Sanitization applied

The specification URI below is an example identifier; the hash computation is the same for any URI.

raw_user_input             = "transfer 1 ETH to 0xABCD... <script>alert(1)</script>"   (UTF-8)
raw_input_hash             = 0xf941af070de0f3096ac705c8be1489658487bbd18d2a96ddab70e4a87a3a5e54
sanitization_spec_uri      = "ipfs://bafkreigh2akiscaildcqabsyg3dfr6chu3fgpregiymsck7e7aqa4s52zy"
sanitization_pipeline_hash = 0x6650cdd004e5a9a968838cb46a719130742b804a48a5bf36bfab815ee47ae5c6
sanitized_input            = "transfer 1 ETH to 0xABCD..."
input_hash                 = 0x49a368dd77974bb589199333d0ee5e6796c1ae449b13b5336bdb5a3606ac4772

Case 3: Signed attestation

Signed with the publicly known test key 0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d, over the Case 1 input. This key must not be used outside testing.

domain             = { name: "WyriweAttestation", version: "1", chainId: 1,
                       verifyingContract: 0x0000000000000000000000000000000000008004 }
agentId            = 0x000000000000000000000000000000000000000000000000000000000000035c   (registry id 860)
registry           = 0x0000000000000000000000000000000000008004
modelHash          = keccak256("example-model-manifest")
                   = 0x8209ab3880d92d34ec49492cc29881fc0f84320585c8ca989730764b5d5c9ce8
rawInputHash       = 0x49a368dd77974bb589199333d0ee5e6796c1ae449b13b5336bdb5a3606ac4772
sanitizationPipelineHash = 0x0bac6c485a2b53c833d464e1b41ff387363d1a529026984d7aff276cd1adec38
inputHash          = 0x49a368dd77974bb589199333d0ee5e6796c1ae449b13b5336bdb5a3606ac4772
outputHash         = keccak256("approved: 1 ETH to 0xABCD...")
                   = 0xb244ca6861bb4505ea20daa57aa4e8c20e9da91728f2874458b1eb979de693f3
timestamp          = 1790000000
commitmentHash     = 0xea3f7e0187df96ebedda5760f1abc6cbe1d2ed58753a6a4ed8035d7458d0c437
digest             = 0xe26e05f67a987708fd415266620d23797c9e5d15cb2f7ca1931d7c65a607578d
signature          = 0xd4f4447b79174752ad7189fd1aac9137589bd7c3e98299dd9178badd461b41f8217e5e8b6c25a9960b64f5f19d48edff7569ce7896dabf42d59bb3c2621a433d1b
attestor           = 0x70997970C51812dc3A010C7d01b50e0d17dc79C8

Expected: a verifier that accepts 0x70997970C51812dc3A010C7d01b50e0d17dc79C8 as the attestor reports checks 1 and 2 as passing; with the Case 1 raw input it reports verified.

Case 4: Forgery

claimed raw_user_input = "transfer 100 ETH to attacker"

presented with the Case 3 attestation. Check 3 fails: keccak256(claimed raw_user_input) does not equal the attested rawInputHash, so the result is refuted. If the forger instead signs a new attestation over the claimed input with their own key, check 1 fails because the recovered signer is not an accepted attestor, and the result is again refuted.

The values below fix one exact answer for the re-signed branch. They come from an independent replay by giskard09. The attestation is built from Sections 1, 3 and 4 over the claimed input, with the identity specification of Case 1 and the Case 3 domain, agentId, registry, modelHash, outputHash and timestamp. It is signed with the publicly known test key 0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a, which must not be used outside testing. Other constructions are equally valid. These values test the text, not a deployed verifier.

rawInputHash       = keccak256("transfer 100 ETH to attacker")
                   = 0x38a753d6e9aef019f6d746541bce1365c3132105171ca8b3ea076f93b1aac139
sanitizationPipelineHash = 0xe053505389bb66ee9661cf9f5f329f55832757a48ff742b02858968fba3cb09b
inputHash          = 0x38a753d6e9aef019f6d746541bce1365c3132105171ca8b3ea076f93b1aac139
commitmentHash     = 0x7c789dedbe5a064bc0bea3bea2a219431a4a1e1ecc1b195685b0c97b7e3986bc
digest             = 0x7c0acf670193db6862a4d39801259167ad98f6008f5bc1c4a6d3fcca6c074064
signature          = 0x87a1c783b015fe3e94028826faf096a0c2749fca83cb880a0cde6b005c0285c80a151cf1a539af5f73b97f23162669ef85fac2d89e0db28106f5aef79f0ce53f1b
recovered signer   = 0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC

Expected: with 0x70997970C51812dc3A010C7d01b50e0d17dc79C8 as the only accepted attestor, check 1 fails and the result is refuted. Checks 2, 3 and 4 pass for this attestation, so check 1 alone decides it.

Case 5: Judgment preimage and intended verifier

proposed_action_artifact = utf8('{"action":"swap","amount":"1.0","asset":"ETH"}')
rawProposalHash          = 0xa2ba55f37139a15a6d91299b1a87826dd3f70226cac9ce1124888931f26cdfaa

decision_ref_preimage_fields = ["artifact_hash","intended_verifier","policy_version","verdict"]
JCS(verdict_preimage) =
{"artifact_hash":"0xa2ba55f37139a15a6d91299b1a87826dd3f70226cac9ce1124888931f26cdfaa","intended_verifier":"eip155:1:0x0000000000000000000000000000000000000001","policy_version":"example.v1","verdict":"approve"}

verdictHash = 0x80327347d204fd0bc99464c3bbe30abe9bec217286b5b9bfc862a3d1d6daf263

WyriweAttestation typeHash =
  0x465936ddc3693f48ac8b4c7b3e097d2b4be6011f2dac0be649291fd9a6c418a0
JudgmentExecutionAttestation typeHash =
  0x82a33faffb99579b0b5041135692ca8159d7d6e97bc261b68d9e858e7a6d4bbf

These two values are the keys of the Section 7 class mapping: 0x4659…18a0 is Attestation-class and 0x82a3…4bbf is Judgment-class.

A verifier at eip155:1:0x0000000000000000000000000000000000000001 that obtains this preimage and field list recomputes verdictHash and finds a match. The negative controls are:

  • The same verdict presented to a verifier at eip155:1:0x0000000000000000000000000000000000000002 is refuted (Section 9.3), even though verdictHash recomputes.
  • Rewriting intended_verifier to the second verifier changes verdictHash to 0xb1e00ca31e8dba5c31fc0a034bf4c6bee9c08826b95b2b43035377f99591c3c8, which no longer matches the attestation, so the result is refuted.
  • The same preimage without intended_verifier ({"artifact_hash":"0xa2ba…cdfaa","policy_version":"example.v1","verdict":"approve"}) has verdictHash 0x24b6e34cc72c1e3788de03db1f6219f9e936c4167512874cc40f5311fbe33a6f. It recomputes, but the verifier reports that gate binding was not established, and the verdict is not replay-safe at any gate.
  • Writing artifact_hash without the 0x prefix in the first preimage above (the one with intended_verifier) is equally valid: the preimage bytes change, so its verdictHash is 0xfd7b5616bc8689d53d4e37d2ba1ebea16c19f05855f9c2003d56d331dd2fda32, and step 3 still passes because the decoded bytes are the same.
  • An attestation whose rawProposalHash differs from the preimage’s artifact_hash is refuted, even when verdictHash recomputes (Section 9.2, step 3).
  • A preimage whose members differ from decision_ref_preimage_fields is refuted. If the preimage or the list cannot be obtained, the result is unverifiable (Section 9.2).
  • A signed struct whose primary type has neither of the two typeHash values above and carries no signed claimType has an unverifiable claim class (Section 7), whatever its struct name.

Reference Implementation

A TypeScript gateway implementation produces WyriweAttestation records as specified in Sections 1–4 for the identity case and serves them to peer gateways. A Solidity proof-verifier contract reports proofSystem() = "attestation/wyriwe" and verifies an attestation on-chain from metadata = abi.encode(agentId, registry, attestor) and proof = abi.encode(modelHash, rawInputHash, sanitizationPipelineHash, commitmentHash, timestamp, signature): it recomputes commitmentHash (check 2), and requires the signature, under the domain in Section 4, to recover to attestor (check 1). Checks 3 and 4 need the raw input and are performed off-chain. Case 3 above verifies against this implementation.

Security Considerations

Authentic judgment is not authorization

A JudgmentExecutionAttestation that verifies proves who judged what and that an accepted attestor recorded an executed-action hash. It does not prove that the execution occurred, that it followed the verdict in time, or that the executor was authorized to act. Consumers that gate funds or permissions on a judgment have to enforce ordering and their own authenticated consumer scope; a verdict without intended_verifier carries no gate binding at all (Section 9.3).

Attestor key compromise

An attestation is only as trustworthy as the attestor’s key. Consumers that use WYRIWE attestations for settlement or dispute resolution should keep an on-chain record of accepted attestors and support key rotation. A compromised attestor key allows forged attestations, but a forged attestation still cannot make a different raw input hash to the committed rawInputHash.

Signature checks that accept anyone

A verifier that checks only that a signature recovers to a non-zero address accepts attestations signed by any key, which defeats the scheme. The recovered signer has to be compared with an accepted attestor (Section 5, check 1). High-s signatures are malleated copies and are excluded by Section 4.

Hash collision resistance

WYRIWE relies on the collision resistance of keccak256. No practical collision attack is known. If keccak256 were broken, all three hashes would be affected equally; the triple-hash construction adds no collision surface of its own.

Adversarial sanitization specification

WYRIWE proves faithful application of a declared transform, not that the transform is benign. A gateway can publish a specification designed to rewrite inputs maliciously — for example to replace a transfer amount or destination — and still commit to applying it faithfully. The scheme makes the transform auditable and attributable, but the semantic safety of a specification is the consumer’s responsibility. Consumers that accept arbitrary specification URIs should restrict them to an allow-list, and end users should read the specification before relying on a result.

Specification availability

sanitization_pipeline_hash commits to a URI, not to retrievable content. If the content at a specification URI becomes unavailable, check 4 cannot be completed and the result is unverifiable. Section 6 asks gateways to keep referenced specifications retrievable. The identity specification is reproduced in full in Section 2.1 for this reason.

Input availability

WYRIWE commits to hashes of the input, not to the input. Parties that need to reproduce verification have to retain the raw input themselves; without it, the strongest available result is unverifiable (Section 5). This ERC does not define an input storage or retrieval mechanism.

Cross-chain and cross-registry replay

The EIP-712 domain binds chainId and the registry address, so a signature made for one registry or chain does not verify against another. Replay within the same domain is prevented by the consumer (Section 8).

Copyright and related rights waived via CC0.

Citation

Please cite this document as:

Tiago Merlini (@TMerlini), Vincent Wu (@TruthAnchor-AI), Damon Zwicker (@damonzwicker), Jimmy Shi (@JimmyShi22), babyblueviper1 (@babyblueviper1), "ERC-8299: WYRIWE — Input Provenance for AI Inference [DRAFT]," Ethereum Improvement Proposals, no. 8299, May 2026. Available: https://eips.ethereum.org/EIPS/eip-8299.