Abstract
A standard to authenticate HTTP requests with Ethereum accounts using HTTP Message Signatures.
Motivation
HTTP APIs are commonly authenticated using bearer credentials (cookies, API keys, JWTs). Possession of these credentials authenticates the caller but does not itself bind authorization to a particular HTTP request. HTTP message signatures improve this by binding a cryptographic proof to the HTTP request itself: the client signs selected request components so the server can verify request integrity and authorization without issuing or storing bearer credentials.
Sign-In with Ethereum (ERC-4361) provides a widely adopted pattern for authenticating Ethereum accounts in interactive frontends. This proposal extends Ethereum-based authentication to generic HTTP traffic (e.g. API clients, servers, and agents) without bespoke sign-up flows, session issuance, or long-lived bearer credentials. As agentic workflows and crypto-native applications increasingly interact through APIs, a standard way to authenticate and authorize requests becomes necessary.
Ethereum accounts provide a stateful, globally verifiable identity. Using them as the signing authority for HTTP message signatures allows requests to be authorized by proving control of an address (Externally Owned Account) or by satisfying a contract-defined policy (Smart Contract Account via ERC-1271). Account provisioning, custody, and recovery remain the responsibility of wallet infrastructure. The same Account can identify a user or agent across HTTP services and separately authorized onchain operations; request authentication does not itself authorize spending.
The proposal standardizes Ethereum-based authentication for HTTP requests, aligned with the HTTP Message Signatures model where practical.
Traditional authentication systems place security policy primarily on the server: the server issues credentials, defines scopes, and enforces risk centrally. Under this specification the server issues nothing. The signer chooses the cryptographic guarantees attached to each request by selecting which request components to bind, how long the signature remains valid, and whether to enable replay protection. The verifier decides which of those guarantees each route accepts.
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.
HTTP fields, derived components, and signature parameters are to be interpreted as defined in RFC 9421. Structured Fields are parsed as defined in RFC 9651.
Overview
This specification defines an Ethereum authentication scheme for HTTP requests using HTTP Message Signatures.
Unless explicitly stated otherwise, implementations MUST reuse RFC 9421 for covered components, canonicalization, signature base construction, and the Signature-Input / Signature header syntax.
The specification defines the Ethereum bindings: required signature parameters, the keyid format, and signing and verification semantics for Externally Owned Accounts (EOAs) and Smart Contract Accounts (SCAs).
Security semantics are expressed directly through two orthogonal dimensions:
- request binding (how tightly a signature is bound to a specific request)
- replay protection (whether a signature can be reused).
No out-of-band negotiation or capability discovery is required for verification. Section 7 defines optional advisory discovery so a signer can select a compatible Account and security posture before its first request; the request and any runtime challenge remain authoritative.
In this model, the signer explicitly chooses the security posture of each request by deciding what to cryptographically bind, how long the signature remains valid, and whether to enable replay protection. The verifier does not issue credentials or negotiate risk levels; it evaluates the guarantees presented in the request against its own acceptance policy.
1. Definitions
- Account: any Ethereum account, either an Externally Owned Account (EOA) or a Smart Contract Account (SCA).
- EOA: an Externally Owned Account controlled by a private key.
- SCA: a Smart Contract Account that validates signatures via onchain logic (e.g. ERC-1271).
- Signer: the Account that generates a signature for a request.
- Verifier: the HTTP server (or gateway) verifying a signature on a received request.
- Request Signature: an RFC 9421 signature under this profile whose
keyidAccount is both the Principal and Signer. - Request-Bound: a binding model in which a signature authorizes exactly one concrete HTTP request by covering the components specified in Section 3.1.1.
- Class-Bound: a binding model with coverage below the Request-Bound component set. Acceptance is a separate verifier policy.
- Non-Replayable: a signature that includes a
nonce, which a verifier consumes on acceptance so that the signature cannot be validly reused. - Replayable: a signature without a
nonce, which can be reused within its validity window. - Principal: the Account against which application authorization is evaluated.
2. Headers
Signers MUST attach signatures to HTTP requests using the RFC 9421 header fields:
Signature-Input: carries the list of covered components and signature parameters.Signature: carries the signature bytes for the corresponding label.
Labels are arbitrary transport keys and carry no security semantics. This example shows the signature fields of the positive test vector:
Signature-Input: request=("@scheme" "@authority" "@method" "@path" \
"@query" "content-digest" "content-type");created=1700000000;\
expires=1700000060;nonce="EjRWeJCrze8BI0VniavN7w";\
keyid="eip155:1:0x7e5f4552091a69125d5dfcb7b8c2659029395bdf";\
tag="erc8128"
Signature: request=:/BpEToskxkMJ65uRmaNUPiBwbwwg6z3CxEDJJwEYREIx1Hwn85Z1L8XlRpILGx4q80yeiNugYzaUsVPWiPcB0Bs=:The signed tag parameter identifies the signature class. A Request Signature has exactly the RFC 9421 String tag="erc8128". An absent, non-String, or different last-wins tag does not identify a candidate of this profile. A verifier MUST NOT reinterpret a differently tagged signature as this profile's authentication after that other class fails.
3. Signature
3.1 Security Model
The profile expresses all security semantics directly through two orthogonal dimensions: request binding and replay protection.
3.1.1 Request Binding
A signature is Request-Bound if it binds authorization to a specific received HTTP request.
A Request-Bound signature MUST cover at minimum these exact, parameterless component identifiers:
@scheme@authority@method@path@query
The order of these covered components is not significant to the Request-Bound classification. Their received order remains significant to the RFC 9421 signature base. @query MUST be covered even when its value is ?.
The verifier evaluates coverage against the request it received after reconstructing the effective target URI using trusted deployment configuration. It MUST NOT infer adequate binding from components the signer happened to cover.
Whenever a Content-Digest field is received, the signature MUST also cover the exact parameterless content-digest field component; Section 3.1.3 requires that field for non-empty content. Whenever Content-Type is received, including on a request with empty content, the signature MUST cover the exact parameterless content-type field component. Applications SHOULD additionally require coverage of components whose alteration can change authorization or interpretation of the authenticated operation, following RFC 9421 Section 7.2.1.
Omitting a component that this section or route policy requires yields insufficient_coverage.
A signature that omits one or more components from the Request-Bound list is Class-Bound. A Class-Bound signature authorizes a class of requests defined by the covered components and any application-specific parameters. A verifier MAY accept it only under explicit route policy.
Verifiers MAY require additional application-specific components as a condition for acceptance.
3.1.2 Replay Protection
The signer chooses whether a signature can be reused by including or omitting an RFC 9421 String nonce. A verifier chooses, for each route, whether it accepts Non-Replayable signatures, Replayable signatures, or both.
A signature that includes a nonce is Non-Replayable: it cannot be validly reused. A verifier that accepts Non-Replayable signatures on a route:
- MUST enforce uniqueness of (
keyid,nonce) within the accepted validity window, including allowed clock skew, so that a nonce is accepted at most once. - MUST reject a Non-Replayable signature if its validity window exceeds the period for which replay state can be retained; this yields
request_validity_too_long.
A verifier MUST NOT accept a signature that includes a nonce without consuming that nonce. On a route that does not accept Non-Replayable signatures, a signature that includes a nonce yields nonce_not_supported.
A signature that omits nonce is Replayable and may be reused within its validity window, subject to verifier policy. Where route or Principal policy accepts only Non-Replayable signatures, absence of nonce yields nonce_required.
The nonce MUST be ASCII and no more than 128 bytes. A present nonce of another Structured Field type, containing non-ASCII data, or exceeding 128 ASCII bytes yields invalid_nonce. Unless the verifier supplies the nonce, the signer MUST generate at least 128 bits of randomness for it. This entropy requirement is not enforceable by the verifier; inadequate entropy primarily causes signer self-denial through accidental nonce_reused collisions.
The replay key is the collision-free tuple of the canonical CAIP-10 Signer ID and nonce. A verifier MUST atomically mark an unused replay key as used; finding it already used yields nonce_reused. A separate check followed by insertion is non-conforming. Replay state MUST be shared across concurrent verifier instances and retained until expires + allowed_skew has passed.
The verifier MUST consume the nonce only for a fully authenticated and policy-compatible winning candidate, after content and cryptographic verification. A failed candidate MUST NOT consume a nonce.
A Replayable signature is invalidated by expiration. Accepting one whose validity window exceeds 60 seconds additionally requires early invalidation, as defined in Section 5.2.
3.1.3 Content Integrity
A signer sending non-empty content MUST generate Content-Digest over the exact content bytes according to RFC 9530. Missing that required field yields content_digest_required.
A verifier has two digest-algorithm sets:
- supported:
sha-256MUST be supported andsha-512MAY be supported; - unsupported: every other algorithm, which is ignored.
When Content-Digest is received, the verifier MUST parse the combined field value as an RFC 9530 and RFC 9651 Dictionary, recompute and match every supported member present, and require at least one supported member to be present and match. A syntax error, a supported member of the wrong type or length, a supported mismatch, or absence of a supported member yields bad_content_digest. Empty-content requests do not require the field, but a received field is verified by the same rules.
3.2 Signer Choices and Verifier Policy
This section lists what a signer can express in a signature and what a verifier does in each case.
A signer chooses the security posture of each signature:
| Signer choice | Effect |
|---|---|
| Cover the Request-Bound components (Section 3.1.1) | The signature authorizes one concrete request |
| Cover fewer components | The signature is Class-Bound and authorizes every request that matches the covered components |
Include a nonce | The signature is Non-Replayable: a verifier that accepts it consumes the nonce, and the signature cannot be reused |
Omit nonce | The signature is Replayable: it can be reused within its validity window wherever it is accepted |
Set created and expires | The signature can authenticate a request only inside that window. A Replayable signature valid for more than 60 seconds is accepted only where the verifier supports early invalidation |
A verifier chooses, for each route, which postures it accepts. Each choice carries its own requirement:
| Verifier choice | Requirement |
|---|---|
| Accept Non-Replayable signatures | Consume every accepted nonce in shared, atomic replay state retained through the signature's skew-adjusted expiry (Section 3.1.2) |
| Accept only Non-Replayable signatures | A signature without a nonce yields nonce_required |
| Accept only Replayable signatures | A signature with a nonce yields nonce_not_supported; no replay state |
| Accept Replayable signatures valid for at most 60 seconds | No replay or invalidation state |
| Accept Replayable signatures valid for more than 60 seconds | A signer-triggerable early-invalidation mechanism (Section 5.2) |
| Require Request-Bound signatures | Missing coverage yields insufficient_coverage (Section 3.1.1) |
| Accept Class-Bound signatures | Explicit route policy (Section 3.1.1) |
A route's replay policy and its binding policy are independent of one another.
A verifier MAY reject any signature that does not satisfy its acceptance policy, even if the signature is otherwise valid under the specification. The rejection carries a failure code and challenge as defined in Section 6, from which the signer can produce a signature the route accepts. Principal policy is application-level authorization outside profile conformance; its rejection yields principal_not_allowed.
3.3 Signature Parameters
3.3.1 keyid
keyid MUST be an RFC 9421 String identifying an Account using canonical CAIP-10 syntax:
eip155:<chain-id>:<address><chain-id> MUST be the unsigned base-10 chain ID from EIP-155, with no leading zeroes. <address> MUST be 0x followed by exactly 40 lowercase hexadecimal characters. Verifiers MUST use this canonical form for cache and replay keys.
A missing, non-String, or syntactically invalid keyid on a candidate yields invalid_keyid. The chain ID selects the state used for ERC-6492 and ERC-1271 verification; a verifier MUST NOT query another chain.
A syntactically valid keyid whose chain is not served by the verifier yields unsupported_chain.
3.3.2 created, expires
createdis an RFC 9421 Integer containing a Unix timestamp in seconds.expiresis an RFC 9421 Integer containing a Unix timestamp in seconds and MUST be greater thancreated.
Verifiers MUST reject signatures whose created or expires parameter is missing or is not an Integer, or whose expires is not greater than created; these conditions yield invalid_time.
The validity window expires - created bounds how long the signature can authenticate a request, how long the verifier retains replay state for a Non-Replayable signature, and whether early invalidation applies to a Replayable one (Section 5.2): a shorter window narrows replay exposure and verifier state, while a longer one tolerates more delivery latency and clock drift. Signers SHOULD choose the shortest window their delivery path and clock uncertainty allow, and MAY choose any length. Verifiers bound the window by route policy: a route MAY enforce any documented maximum suited to its architecture, and a window exceeding it yields request_validity_too_long. Verifiers SHOULD allow 30 seconds of clock skew.
With allowed skew s, the request is time-valid exactly when:
created - s <= now <= expires + snow < created - s yields request_not_yet_valid; now > expires + s yields request_expired.
3.3.3 nonce
The nonce parameter is used to prevent replay. Its semantics are defined in Section 3.1.2.
3.3.4 tag, alg
tag is mandatory and identifies the class as specified in Section 2. Until an algorithm representing this scheme is registered in the IANA HTTP Signature Algorithms registry and this profile is revised to permit it, every Request Signature MUST omit RFC 9421's alg. A candidate containing alg yields unsupported_algorithm; a verifier MUST NOT use alg to select account behavior.
3.3.5 mode
mode is an OPTIONAL RFC 9421 String parameter whose only defined value is "eoa". It lets the verifier skip the account-code lookup as specified in Section 4.1. A signer SHOULD include mode="eoa" only when the keyid Account has no code and the signature is a strict EOA signature under Section 3.4.3. Verifiers SHOULD honor it; a verifier that ignores it performs Universal Account verification unchanged. A mode parameter with any other value or type is ignored. The parameter is intended for registration in the HTTP Signature Metadata Parameters registry.
3.4 Signing
3.4.1 Mandatory Parameters
All Request Signatures MUST include the following parameters in Signature-Input and @signature-params:
keyid(Section 3.3.1)created(Section 3.3.2)expires(Section 3.3.2)tag(Section 3.3.4)
Signatures that are intended to be Non-Replayable MUST include the nonce parameter as defined in Section 3.1.2. Signers MAY include mode as defined in Section 3.3.5.
3.4.2 Mandatory Components
Signatures that are intended to be Request-Bound MUST satisfy the component requirements in Section 3.1.1.
All Request Signatures MUST cover at least the @authority derived component; a candidate that omits it yields insufficient_coverage.
3.4.3 Signature Construction
The signature base M and component canonicalization MUST be constructed according to RFC 9421.
Let M be the signature base for the selected label.
Component and parameter order shown in examples is exemplary; the component and parameter order received in Signature-Input governs signature-base reconstruction and MUST remain unchanged for the life of the signature.
NOTE: `\` line wrapping per RFC 8792 (documentation only)."@scheme": https
"@authority": api.example
"@method": POST
"@path": /items
"@query": ?view=full
"content-digest": sha-256=:k6I5cakU5erL8KjSUVTNownDwccvu5kU1Hxg88toFYg=:
"content-type": application/json
"@signature-params": ("@scheme" "@authority" "@method" "@path" "@query" \
"content-digest" "content-type");created=1700000000;expires=1700000060;\
nonce="EjRWeJCrze8BI0VniavN7w";\
keyid="eip155:1:0x7e5f4552091a69125d5dfcb7b8c2659029395bdf";tag="erc8128"This profile applies the ERC-191 personal_sign encoding directly to M:
H = keccak256("\x19Ethereum Signed Message:\n" || decimal(byteLength(M)) || M)byteLength(M) is the length of the serialized signature base in bytes. The decimal length has no leading zeroes. ERC-1271 and ERC-6492 verification receive H, not a second hash and not the unhashed M. For the signature base above, byteLength(M) is 449 and H is 0xa7a6074cd2ab23379c04a8839a3566e98689326367a0ad9cd8ef389a961f96de.
An EOA signature MUST be exactly 65 bytes r || s || v, with 1 <= r < secp256k1n, 1 <= s <= secp256k1n / 2, and v exactly 27 or 28. Compact, DER, high-s, EIP-155 transaction, and 0/1-v encodings are invalid. The recovered address MUST equal the normalized keyid address. SCA signatures are opaque byte strings and do not use this encoding rule.
3.5 Candidate Evaluation and Limits
Before candidate evaluation, the verifier MUST combine and parse each Signature-Input and Signature field according to RFC 9421 and RFC 9651. A missing field yields signature_missing. A Structured Field syntax error in either field yields the whole-message failure signature_input_invalid; no candidate is evaluated. A well-formed tagged Signature-Input member without a correlated RFC 9421 Byte Sequence in Signature yields the candidate failure signature_input_invalid, and evaluation continues. Other well-formed candidates that fail profile validation are likewise skippable.
Candidates are selected only by the exact last-wins String tag="erc8128" in Signature-Input. They MUST be evaluated in Dictionary wire order. A verifier MUST enforce limits before cryptography. Defaults are:
| Input | Default limit |
|---|---|
Combined Signature-Input field | 16 KiB |
Combined Signature field | 16 KiB |
| Decoded signature member | 8 KiB |
| Recognized profile candidates per request | 8 |
| Covered components per candidate | 32 |
| Signature parameters per candidate | 16 |
Exceeding either field/member size or the component/parameter count yields signature_too_large. Having more than the candidate budget also yields signature_too_large; this code therefore covers both byte-size and count limits. Deployments MAY use smaller documented limits.
For each candidate, bounded parsing, time, coverage, digest, Principal-policy, and replay-posture checks precede cryptography. A verifier MAY instead evaluate Principal policy after cryptographic verification, so that principal_not_allowed reaches only a caller that controls the Account. The first candidate passing all checks and atomically consuming its nonce, when present, wins. If no candidate wins and no more specific failure is available, evaluation yields no_acceptable_signature.
Implementations MAY reorder checks when the externally observable result is identical, including HTTP status, reason code, nonce consumption, and RPC side effects. In every ordering, limit checks precede cryptography and nonce consumption comes last (Section 3.1.2).
4. Verification
Given a request containing Signature-Input and Signature, the verifier evaluates each candidate as follows:
- Parse the covered components, signature parameters, and signature bytes
Sper RFC 9421. - Parse
keyid, extract the chain ID and address, and confirm that the verifier serves that chain. - Enforce the requirements in Section 3, including route policy, time, content, request coverage, and replay posture.
- Reconstruct the signature base
Mper RFC 9421 using the received request and receivedSignature-Inputorder. - Compute
HfromMas defined in Section 3.4.3. - Perform Universal Account verification (Section 4.1).
- Atomically consume the nonce of a Non-Replayable signature (Section 3.1.2), or check a Replayable signature valid for more than 60 seconds against early-invalidation state (Section 5.2).
An invalid cryptographic result yields bad_signature. A state-provider or RPC failure preventing classification or verification yields signature_verification_unavailable, not bad_signature.
4.1 Universal Account Verification
Universal Account verification MUST proceed in this order:
- If the signature is an ERC-6492 wrapper, verify the wrapper before inspecting account code. An invalid wrapper MUST NOT fall back.
- Otherwise, if the candidate has
mode="eoa"and the verifier honors it, apply strict local EOA recovery. If the recovered address equals thekeyidaddress, the signature is valid without an account-code lookup. Otherwise, continue with step 3. - Obtain account code on the
keyidchain. If code is present, including an EIP-7702 delegation indicator, call ERC-1271 withHand the opaque signature. An invalid call MUST NOT fall back to ECDSA. - Only for an unwrapped Account without code, apply strict local EOA recovery.
With mode="eoa", a signature that recovers locally requires no RPC. A signature that does not recover, including a contract-account signature sent with mode="eoa", is verified as if mode were absent.
4.2 Failure Selection
If no candidate wins and at least one otherwise policy-compatible candidate reaches an unavailable result, the verifier SHOULD return the first such result in wire order. Otherwise, it SHOULD return the failure for the first recognized candidate. This selection is implementation guidance for interoperability; implementations need not expose unobservable internal check ordering. A failing candidate never masks a later successful candidate.
5. Signature Invalidation
5.1 Non-Replayable Invalidation
Non-Replayable signatures are invalidated by nonce consumption, as defined in Section 3.1.2.
5.2 Replayable Invalidation
Replayable signatures are invalidated primarily by expiration.
A Replayable signature whose validity window expires - created is at most 60 seconds is invalidated by expiration alone. Accepting it requires no early-invalidation mechanism, and a verifier does not consult early-invalidation state for it. Signers MUST NOT rely on early invalidation for such a signature.
A Replayable signature with a longer validity window does not provide cryptographic replay protection for that longer period. Verifiers that accept such signatures MUST implement one or more early-invalidation mechanisms that can be triggered by the signer.
Such mechanisms MUST include at least one of the following:
- Not-before: a per-
keyidnot-before timestamp. A signature whosecreatedis earlier than the not-before timestamp of itskeyidis invalidated. - Per-signature: invalidation of one signature, identified by its
keyidand its hashH(Section 3.4.3).Hidentifies the signed message, so the invalidation covers every signature encoding that verifies against it.
Verifiers that do not implement early invalidation MUST NOT accept Replayable signatures whose validity window exceeds 60 seconds; such a signature yields request_validity_too_long. A Replayable signature valid for more than 60 seconds that has been invalidated yields signature_invalidated.
Invalidation state MUST be shared across concurrent verifier instances and retained until every signature it invalidates has passed expires + allowed_skew.
5.2.1 Invalidation Requests
A signer triggers early invalidation with a POST request to the verifier's invalidation endpoint, an HTTPS URL on the verifier's origin that a discovery document advertises as invalidation_endpoint (Section 7). The request MUST be authenticated with a Request-Bound Request Signature (Section 3.1.1); at the invalidation endpoint, a signature that is not Request-Bound yields insufficient_coverage. The request applies only to signatures whose keyid equals the keyid of that Request Signature.
The request content is a JSON object, sent with Content-Type: application/json, that has exactly one of these members:
| Member | Value | Effect |
|---|---|---|
not_before | Integer Unix time in seconds, no later than the verifier's current time plus allowed clock skew | Not-before: the verifier sets the not-before timestamp of the keyid to this value, unless the stored timestamp is already equal or later |
message_hash | The hash H of the signature to invalidate, as 0x followed by 64 lowercase hexadecimal digits | Per-signature: the verifier invalidates the signature that has this H |
These examples show the request line, the content type, and the content of each request; the Content-Digest and signature fields are omitted:
POST /signatures/invalidate HTTP/1.1
Host: api.example
Content-Type: application/json
{"not_before": 1700000001}POST /signatures/invalidate HTTP/1.1
Host: api.example
Content-Type: application/json
{"message_hash": "0x3116bc69551ce120ee93875d4f6f36ab8bf5469a5bc84ba996347b24609abd84"}The verifier responds with HTTP 200 after it records the invalidation. Content that does not conform to this section yields HTTP 400. A conforming request for a mechanism the verifier does not implement yields HTTP 422, and the signer uses the other mechanism: a not_before later than the created of the signatures to invalidate, or one message_hash request for each of them. Neither failure changes invalidation state.
An invalidation is never reversed, and repeating a request has no further effect.
5.3 Key Compromise and Rotation
If an EOA is compromised, verifiers SHOULD rely on policy invalidation.
For SCAs, changes in contract state MAY invalidate previously issued signatures, depending on the ERC-1271 implementation.
6. Failure Responses
signature_input_invalid and signature_too_large use HTTP 400. signature_verification_unavailable uses HTTP 503 and MAY include Retry-After. Every other failure below, including unsupported_chain, is an authentication rejection and uses HTTP 401.
HTTP 403 is reserved for application authorization denied after a Request Signature has verified. A verifier MUST NOT return 403 for a signature-layer failure or consume a nonce for a request it denies.
Every 401 response MUST include a challenge applicable to the target resource:
WWW-Authenticate: ERC8128 error="bad_signature"The case-insensitive provisional authentication scheme token is ERC8128. Its optional error auth-param carries one reason code from this section, using quoted-string syntax. The scheme is intended for provisional IANA registration, and senders SHOULD use ERC8128 as the preferred capitalization.
A challenge MAY include chains, an ASCII-space-separated list of canonical CAIP-2 eip155 chain IDs served by the verifier. A verifier returning unsupported_chain SHOULD include chains unless exposing that policy to an unauthenticated caller is a disclosure risk. The parameter describes what would satisfy the challenged route:
WWW-Authenticate: ERC8128 error="unsupported_chain", chains="eip155:1 eip155:8453"A challenge MAY include max_validity, the largest validity window expires - created, as a base-10 integer number of seconds, that the challenged route accepts for a signature with the replay posture of the rejected one. A verifier returning request_validity_too_long SHOULD include max_validity unless exposing that policy to an unauthenticated caller is a disclosure risk:
WWW-Authenticate: ERC8128 error="request_validity_too_long", max_validity="60"When a response body is sent, it SHOULD use RFC 9457 application/problem+json and MUST include the same stable code in a reason extension. Failure details MUST NOT expose contract revert data, private policy, or sensitive content.
Whenever a route requires covered components beyond the Request-Bound components, its challenge SHOULD return RFC 9421 Accept-Signature. Each advertised member MUST enumerate, in the required order, the complete and exact component set for that label: the Request-Bound components, every route-required component, content-digest for a non-empty request body, and content-type when that field will be present. A verifier returning insufficient_coverage SHOULD include the same field unless exposing route requirements to an unauthenticated caller is a disclosure risk. For example, a repair response to a body-bearing request can advertise:
WWW-Authenticate: ERC8128 error="insufficient_coverage"
Accept-Signature: request=("@scheme" "@authority" "@method" "@path" "@query" "content-digest" "content-type");created;expires;tag="erc8128"The bare created and expires parameters request the RFC 9421 creation and expiration values, while tag carries this profile's explicit String value. The signer adds its selected canonical String keyid and, for a Non-Replayable signature, generates a fresh nonce satisfying Section 3.1.2. A verifier MAY issue the nonce by advertising its actual value in Accept-Signature, for example ;nonce="EjRWeJCrze8BI0VniavN7w".
Accept-Signature is a repair hint and does not weaken verifier policy. The runtime challenge is authoritative over discovery metadata. A retry MUST use the advertised label and cover exactly the listed component identifiers in the listed order; it MUST NOT append other covered components to that signature. The signer MAY add signature parameters permitted by RFC 9421 and this profile. If it needs to cover a different component set, it does so with a separate signature under another label.
The stable codes are:
signature_missing
signature_input_invalid
signature_too_large
no_acceptable_signature
invalid_keyid
unsupported_chain
invalid_time
request_not_yet_valid
request_expired
request_validity_too_long
invalid_nonce
insufficient_coverage
content_digest_required
bad_content_digest
nonce_required
nonce_not_supported
nonce_reused
signature_invalidated
unsupported_algorithm
bad_signature
signature_verification_unavailable
principal_not_allowedThis non-normative index maps each code to its principal condition:
| Code | Condition |
|---|---|
signature_missing | A signature field is absent |
signature_input_invalid | A signature field is SF-malformed or members cannot correlate |
signature_too_large | A byte or count limit is exceeded |
no_acceptable_signature | No candidate wins and no specific candidate failure applies |
invalid_keyid | Candidate keyid is invalid |
unsupported_chain | The verifier does not serve the syntactically valid keyid chain |
invalid_time | Required time metadata is structurally invalid |
request_not_yet_valid | Current time precedes the skew-adjusted window |
request_expired | Current time follows the skew-adjusted window |
request_validity_too_long | The route maximum is exceeded, a Non-Replayable window exceeds replay-state retention, or a verifier without early invalidation receives a Replayable signature valid for more than 60 seconds |
invalid_nonce | A present nonce has an invalid type or size |
insufficient_coverage | Request-Bound or route-required coverage is missing |
content_digest_required | Non-empty content lacks Content-Digest |
bad_content_digest | A received digest is invalid or does not verify |
nonce_required | Route or Principal policy accepts only Non-Replayable signatures |
nonce_not_supported | The route does not accept Non-Replayable signatures |
nonce_reused | Atomic replay-key insertion fails |
signature_invalidated | A Replayable signature valid for more than 60 seconds has been invalidated early |
unsupported_algorithm | A candidate contains alg |
bad_signature | Cryptographic verification is definitive and invalid |
signature_verification_unavailable | Account classification or verification is unavailable |
principal_not_allowed | Application Principal policy rejects the Account |
7. Advisory Discovery Document
An HTTPS origin MAY publish a discovery document for this profile at /.well-known/erc8128, following the well-known URI rules in RFC 8615. The document is a UTF-8 JSON object served with Content-Type: application/json. Fetching it is OPTIONAL: a verifier MUST be able to verify a request without the document, and a signer that does not fetch it learns route policy from a runtime challenge (Section 6).
The document advertises policy; it does not grant authority and is never an input to signature verification. A runtime WWW-Authenticate or Accept-Signature challenge is authoritative for the next request when it differs from a cached document. A client MUST NOT interpret an omitted member as support for every value in that category. Clients MUST ignore unrecognized members so that the document can be extended.
This example shows all defined members:
{
"max_validity_sec": 300,
"chains": ["eip155:1", "eip155:8453"],
"invalidation_endpoint": "https://api.example/signatures/invalidate",
"name": "Example Merchant API",
"logo_uri": "https://api.example/logo.svg",
"terms_uri": "https://api.example/terms",
"privacy_uri": "https://api.example/privacy",
"route_policies": {
"/orders": {
"methods": ["POST"],
"max_validity_sec": 60,
"required_components": ["content-digest", "content-type"],
"nonce": "required",
"content_digest": "required"
},
"/catalog/*": {
"methods": ["GET"],
"max_validity_sec": 60,
"nonce": "optional"
}
}
}The top-level members are:
| Member | Type and meaning |
|---|---|
max_validity_sec | Positive integer maximum for expires - created when a route does not override it |
chains | Non-empty array of canonical CAIP-2 eip155 chain IDs the verifier serves |
invalidation_endpoint | Absolute same-origin HTTPS URL of the invalidation endpoint (Section 5.2.1) |
name | Human-readable resource name |
logo_uri | Absolute HTTPS URL for a resource logo |
terms_uri | Absolute HTTPS URL for the resource's terms |
privacy_uri | Absolute HTTPS URL for the resource's privacy policy |
route_policies | Object mapping route patterns to one policy object or a non-empty array of policy objects |
All members are OPTIONAL. Numeric values MUST be JSON integers in the interoperable range 1 through 9007199254740991. Chain identifiers, component identifiers, and URLs MUST be canonical under the specifications that define them. Human-readable strings and fetched images are untrusted presentation input; a client MUST sanitize them and MUST display the resource origin with them.
A route policy has these members:
| Member | Type and meaning |
|---|---|
methods | Non-empty array of case-sensitive HTTP method tokens as defined by RFC 9110; omission applies the policy to every method |
max_validity_sec | Positive integer route override for the validity maximum |
required_components | Array of RFC 9421 component identifiers, serialized without signature-base outer quotes, required in addition to the applicable Section 3.1.1 requirements |
nonce | Whether a signature for the route includes a nonce: required when the route accepts only Non-Replayable signatures; optional when it accepts both Non-Replayable and Replayable signatures; unsupported when it accepts only Replayable signatures. Without an invalidation_endpoint, a client SHOULD keep Replayable validity windows to at most 60 seconds (Section 5.2) |
content_digest | request-body for the Section 3.1.3 rule, or required to require Content-Digest even with empty content |
Route keys are either an absolute path, an absolute path ending in /*, or default. An exact path wins over a wildcard; among matching wildcards, the longest prefix wins; default applies only when no path key matches. When a selected key contains an array, the first policy whose methods contains an exact, octet-for-octet match for the case-sensitive request method wins; implementations MUST NOT case-fold either value. Otherwise, the first policy without methods applies. Thus POST and post select different policies. If a path key matches but has no policy for the method, no lower-precedence route policy applies. Object member order otherwise carries no preference.
The decoded document SHOULD be no larger than 64 KiB and SHOULD use normal HTTP cache controls. A client MUST enforce a response limit no greater than 65,536 decoded octets, stop reading when the limit is crossed, and reject the document before parsing it. It MUST use a JSON parser with bounded nesting depth, member count, aggregate string length, and allocation, and MUST apply finite connection, read, and overall retrieval timeouts. Discovery metadata MUST NOT be required to be fresh for request verification.
The erc8128 suffix is intended for provisional registration in the Well-Known URIs registry.
Rationale
Design Goals
The proposal is designed with two primary goals:
-
No login or session step A request is authenticated by the signature it carries. No sign-in flow, session, or server-issued credential is a prerequisite, so a signer can authenticate to a verifier it has never contacted.
-
Security posture chosen per request The signer chooses the guarantees attached to each request: which components the signature binds, how long it remains valid, and whether it can be reused. The verifier chooses which of those guarantees each route accepts. Every choice has defined requirements, so applications with different security, latency, and cost needs share one signature format.
This means that:
- a signature has the same meaning at every verifier that accepts it, and
- a verifier implements only the mechanisms its routes use, and needs no shared state unless it accepts Non-Replayable signatures or Replayable signatures valid for more than 60 seconds.
Signer-Defined Security Posture
The proposal is built on the principle that the entity authorizing an action should be able to choose the exact security guarantees attached to that action. Rather than embedding risk levels in server-issued tokens, session state, or out-of-band policy, security is expressed directly in the cryptographic material of each request: which components are bound, whether the request is replayable, and how long it remains valid.
A verifier accepts or rejects the posture a signature presents and never weakens it. A signature that covers the Request-Bound components authenticates only the request it describes, and a signature that includes a nonce authenticates at most once: the verifier either consumes the nonce atomically or rejects the request. A signer that includes a nonce therefore knows that an accepted request cannot be replayed.
Which postures a route accepts is application policy, since it depends on what the route does. Accepting Non-Replayable signatures means a consistent write to a shared store on every authenticated request, so a verifier keeps that state for the routes that need it and retains each consumed nonce only until the signature's skew-adjusted expiry. A route that keeps no replay state accepts only Replayable signatures.
A signer learns a route's policy from the application's documentation, from the advisory discovery document (Section 7), or from the challenge returned with a rejection, which names the failure and can carry Accept-Signature (Section 6).
This enables:
- fine-grained, per-request control over authorization strength,
- verifiers that do not need to issue or store bearer session credentials,
- composable authorization for agents, services, and onchain identities that operate without prior trust relationships.
Why short Replayable signatures need no early invalidation
The short-window exemption makes an explicit tradeoff: the signer accepts repeated use until the signature's skew-adjusted expiry in exchange for avoiding shared replay and invalidation state. Even when a verifier implements early invalidation for longer-lived signatures, it does not consult that state for an exempt signature. Replayable signatures with longer validity windows require early invalidation under Section 5.2.
The 60-second cutoff is a policy choice: long enough to absorb ordinary delivery latency and clock drift, and short enough that expiration alone bounds the exposure of a captured request. It applies to the signed validity window expires - created; allowed clock skew extends the actual acceptance interval. The exemption removes shared replay and invalidation state, but Account verification and application authorization may still require state. Routes that cannot tolerate repeated delivery within the acceptance interval, such as non-idempotent operations, require Non-Replayable signatures or application-level deduplication instead.
Independent replay and binding choices
Replay protection and binding strength are chosen per signature and accepted per route, because real-world systems at scale need controlled tradeoffs for latency and cost.
A Replayable signature spares the verifier the shared replay-state write that a Non-Replayable signature needs on every request. It also lets a verifier reuse work when the same signature arrives several times within its validity window: each request is still evaluated, but a verifier can cache successful verification results, keyed by signature bytes or by an application-defined authorization handle, and skip the repeated cryptographic checks. This matters most for high-frequency clients and large gateways, where signature verification is a material CPU cost.
A Class-Bound signature applies one authorization proof to a class of requests, for example by omitting @query. This reduces signer and verifier work for narrowly defined uses such as idempotent reads and pre-authorized request classes.
The two choices are decoupled so that an application combines them as each route requires:
- Replayable and Class-Bound: reusable across a class of requests,
- Replayable and Request-Bound: one concrete request that can repeat within its validity window,
- Non-Replayable and Class-Bound: a single use within a class of requests,
- Non-Replayable and Request-Bound: a single use of one concrete request.
The profile standardizes each combination and what it requires, so implementations adopt the tradeoffs that fit them and remain interoperable.
Why ERC-191 over EIP-712
The specification signs the RFC 9421 signature base M, which is a canonicalized byte sequence derived from HTTP message components. The primary requirement is that the signature binds to M in a deterministic, widely implementable way across wallets, agents, and server-side signers.
ERC-191 (personal_sign) is chosen because it:
- is broadly supported across Ethereum signing stacks (including non-interactive and machine-to-machine signers),
- signs an arbitrary byte string without requiring a typed schema, domain separator, or UI-oriented metadata,
- maps naturally to "sign exactly this canonical signature base
M" as required by RFC 9421's model.
EIP-712 is primarily designed for structured (typed) data and is often used to improve human inspectability and reduce phishing risk in interactive wallet flows. That advantage is less relevant here because HTTP message signatures are typically enforced programmatically by applications and agents, and many requests include non-human-friendly material (hashes, digests, nonces, etc.).
On RFC 9421 compliance: using EIP-712 would not be "impossible", but it would not be a request signature over the RFC 9421 signature base M unless the EIP-712 typed data is defined to represent M exactly and canonically. That introduces an additional serialization layer (typed-data encoding + domain separation) and weakens interoperability with generic RFC 9421 tooling, which expects "signature = Sign(M)". For the proposal's goal — standardizing Ethereum bindings for RFC 9421 — ERC-191 is the simplest and most compatible choice.
Why this is needed in addition to SIWE and other existing mechanisms
SIWE (ERC-4361) is designed for interactive user authentication, where a user signs a statement to establish identity and a relying party typically issues a session (cookie/JWT) for subsequent requests. It does not standardize how to authenticate and provide integrity for arbitrary HTTP traffic (API clients, servers, agents) on a per-request basis without bearer credentials.
The proposal targets the missing piece: authenticating each HTTP request itself using Ethereum accounts, with request integrity and optional replay protection, without relying on server-issued bearer credentials or long-lived sessions. It is intended for machine-to-machine communication, gateways, agents, and any environment where issuing, storing, and protecting shared secrets or sessions is undesirable.
Existing payment or application-specific conventions may define how to express certain semantics (e.g., errors, payment requirements, or application-level metadata), but they do not standardize cryptographic request authentication, canonicalization, or replay protection in a way that is interoperable with RFC 9421. The proposal fills that gap.
Signature replayability inference from nonce
The presence of nonce directly and uniquely signals non-replayability, so a signature carries no separate parameter declaring it replayable or not.
A verifier never treats a nonce-bearing signature as Replayable, because the signed nonce records the signer's choice of single use. A route that keeps no replay state rejects such a signature with nonce_not_supported, which leaves the decision to the signer: it can re-sign without a nonce and accept reuse within the validity window, or decline to send the request. A signer that knows the route's policy in advance (Section 7) avoids the rejected attempt.
Algorithm and profile signaling (alg, label, params)
RFC 9421 defines an alg signature parameter whose values come from the IANA "HTTP Signature Algorithms" registry. Using alg could improve interoperability with generic RFC 9421 tooling by making the algorithm explicit and machine-discoverable. However, Ethereum signing as specified by the proposal (ERC-191 over the RFC 9421 signature base, signed with ECDSA over secp256k1, and verified via address recovery for EOAs or Universal Account verification) is not currently represented in that registry, and defining an unregistered alg value would reduce interoperability and create ambiguous behavior across implementations.
For these reasons, the signed tag and keyid identify the profile and Request Signatures MUST omit alg. A future iteration could register an IANA alg identifier and update the profile to recognize it. Labels remain arbitrary transport keys.
Algorithm agility
Signature algorithms other than secp256k1 ECDSA are supported through account logic rather than HTTP signature metadata. An Account whose signers use another scheme, such as P-256 passkeys, authenticates through ERC-1271, including before deployment through ERC-6492, so verifiers need no algorithm signal from the request. alg never selects verification, and mode only enables a local check that falls back to Account state, which rules out algorithm confusion. An Account whose authorization follows from neither secp256k1 recovery nor ERC-1271 cannot authenticate under this profile and fails closed; supporting it requires a revision of this profile that selects verification from protocol-defined account state.
Signer-declared EOA verification
For a code-free EOA, the account-code lookup is the only RPC call verification needs. The signer knows whether its Account has code, so mode="eoa" lets it remove that call. The hint cannot authenticate anyone who could not already authenticate: no private key's signature recovers a contract account's address, and the key of an EIP-7702-delegated Account can change or clear its delegation onchain at any time. A signature that does not recover falls back to Universal Account verification, so an incorrect hint costs an RPC call but never rejects a valid signature.
Single authoritative encoding
Each proof has exactly one encoding: the RFC 9421 Signature-Input and Signature fields. This profile defines no fallback or alternative fields, because a second encoding of the same proof would need its own normalization rules and could be interpreted differently from the first. Where intermediaries cannot preserve these fields, deployments should verify at a trusted boundary before the fields are altered, or configure the intermediaries to forward them unchanged.
Backwards Compatibility
The proposal specifies an application-layer profile for RFC 9421 using the Signature-Input and Signature HTTP fields; non-supporting clients, servers, and intermediaries will ignore these as ordinary fields, allowing for incremental rollout.
The profile can coexist with existing authentication (e.g., cookies, API keys, OAuth, SIWE); applications must define precedence if multiple mechanisms are accepted. The standard does not register a new RFC 9421 algorithm; implementations recognize the profile by its signed tag and keyid and apply Universal Account verification.
Test Cases
Test vectors and expected results cover request signatures, content integrity, replay protection, and failure cases.
Implementations that accept Non-Replayable signatures MUST test a replay race by submitting the positive request concurrently: exactly one request may authenticate. Implementations MUST test that a route that does not accept Non-Replayable signatures rejects the positive request with nonce_not_supported. They MUST also test ERC-6492 before code lookup, ERC-1271 without ECDSA fallback for deployed and EIP-7702-delegated Accounts, strict EOA recovery for a code-free Account, that mode="eoa" verifies a recovering signature without an account-code lookup and otherwise falls back to Universal Account verification, and that received legal parameter order is preserved.
Reference Implementation
Signer and verifier pseudocode illustrates request signing and verification.
Security Considerations
Nonce handling models
Replay protection requires state: a verifier that accepts Non-Replayable signatures must prevent reuse of the same authorization proof. The specification uses a nonce parameter for Non-Replayable signatures and defines replay prevention in terms of uniqueness of (keyid, nonce) within a retention window.
The specification intentionally does not standardize how nonces are obtained (e.g., server-issued vs client-generated) because different deployment models have different constraints:
- Client-generated nonces (e.g., random 128-bit) avoid an extra round-trip and work well for agents and offline signing, but require verifiers to store seen nonces.
- Server-issued nonces (e.g., via an application endpoint) can enforce sequencing or tighter control, but introduce a handshake-like dependency and additional latency.
So that a signer never needs a round trip to obtain a nonce, the specification standardizes only the semantics: if nonce is present, the signature is Non-Replayable, and a verifier that accepts it must enforce uniqueness for the validity window it accepts. Implementations are free to choose storage backends (in-memory, shared cache, database) and concurrency strategies appropriate for their scale and topology.
Additionally, because nonce retention is stateful, verifiers must reject Non-Replayable signatures whose validity window exceeds what the verifier can safely retain nonce state for; otherwise "Non-Replayable" would not be a reliable property.
Nonce enforcement and concurrency
Verifiers must ensure that checking and consuming (keyid, nonce) is an atomic operation. In concurrent or distributed deployments, a non-atomic "check then insert" can allow two parallel verifications of the same nonce to both succeed due to a race condition. Implementations should use a shared store that supports atomic writes (e.g., transactional database writes or atomic operations in a shared cache) and must retain nonce state through the accepted signature's skew-adjusted expiry.
A retry that needs a new authentication attempt uses a fresh nonce. Nonce consumption prevents proof reuse; it does not guarantee exactly-once application execution. Applications needing operation deduplication should bind their idempotency identifier into the signature and enforce it independently.
Verification state
Non-Replayable requests require shared atomic nonce state. Replayable requests valid for more than 60 seconds require the early-invalidation state in Section 5.2; those valid for at most 60 seconds require no shared replay or invalidation state. Both require Account verification under Section 4.1, including code classification unless a mode="eoa" signature recovers locally. Verification uses no server-side session record, and application authorization remains independent.
Replay exposure of Replayable signatures
A captured Replayable request authenticates again until its skew-adjusted expiry. Request binding limits such a replay to the identical request, so the exposure is repeated execution of the same operation, and it requires access to the signed request, for example through a TLS-terminating intermediary, a log, or a compromised client. Verifiers should accept only Non-Replayable signatures, or deduplicate operations at the application layer, on routes where repeated execution is harmful, such as payments and other non-idempotent state changes.
A signer that needs single use includes a nonce. The request then authenticates only where the verifier consumes that nonce, so a successful response confirms the signature cannot be replayed. A request that carries both a Non-Replayable and a Replayable signature is as replayable as the Replayable one, because either signature can be presented alone.
Early invalidation
An invalidation request (Section 5.2.1) only ever invalidates: a not-before timestamp moves forward and an invalidated signature stays invalidated, so replaying a captured request has no further effect. The upper bound on not_before keeps a request from invalidating signatures created later than the verifier's skew-adjusted current time.
The content of the request selects what is invalidated, which is why the invalidation endpoint accepts only Request-Bound signatures: a Class-Bound signature accepted there would let a party that captures it invalidate the other signatures of the same keyid.
Per-signature invalidation is keyed by H and not by signature bytes because one signed message can have several accepted encodings: a contract Account treats signature bytes as opaque, and an ERC-6492 wrapper changes the bytes without changing the message.
Class-Bound signatures
A Class-Bound signature authenticates every request that matches its covered components, so a party that captures one can send requests the signer never sent, within that class and validity window. Verifiers should accept Class-Bound signatures only under explicit route policy for low-risk operations, and signers should keep their validity windows short.
Account classification
Without mode="eoa", an EIP-7702-delegated EOA is verified through ERC-1271, and one whose implementation lacks isValidSignature cannot authenticate while it has code. That path permits no ECDSA fallback, so verification follows the Account's current implementation. This does not protect against compromise of the EOA key, which can change or clear the delegation onchain at any time.
With mode="eoa", a raw-key signature from an EIP-7702-delegated Account authenticates without consulting its implementation. This grants nothing the key cannot already obtain onchain, but such a bypass leaves no onchain trace. If a protocol mechanism for deactivating a delegated EOA's key is adopted, verifiers honoring mode="eoa" would accept a deactivated key until this profile is revised.
Proxies and transformations
Effective-target reconstruction is only as trustworthy as the proxy boundary. Verifiers must trust forwarding metadata only from configured proxies and document reconstruction. Intermediaries are not required to preserve signatures: path normalization, query rewriting, decompression, or any other transformation of a covered component will break a covering signature.
HTTP caching
The shared-cache restrictions for requests containing Authorization in RFC 9111 Section 3.5 do not automatically apply to Signature and Signature-Input. Applications are responsible for preventing unauthorized reuse of authenticated responses by caches.
Interactive signing
When available, wallets SHOULD obtain the requesting origin from trusted interaction context and display it distinctly from the signed target authority. A target chosen by the requesting application does not establish that application's trustworthiness. Clients MUST apply their own authorization policy before signing.
Downgrade resistance
Applications supporting multiple authentication systems must define precedence. A failed signature under another tag must not fall back to this profile's authentication or to a broader bearer credential. Principal policy remains application authorization and does not alter profile conformance.
Duplicate Structured Field keys
Structured Fields parsing resolves a duplicated Dictionary member or parameter key by keeping the last occurrence; this profile adds no duplicate-rejection layer, so an unmodified RFC 9651 parser is sufficient. Duplicates do not create an authentication gap: a discarded earlier occurrence is semantically inert, and the surviving last value is either covered by signature-base reconstruction or checked by a bound validation rule, so any effective change yields bad_signature or the corresponding failure. Repeated field lines of a covered ordinary field are likewise harmless, because they change the combined field value and therefore the reconstructed signature base. Verifiers must parse each field exactly once and evaluate every rule against the values that parse produced; validating one parse result while authenticating another reintroduces smuggling risk.
Denial of service and state trust
Limits and local policy checks precede cryptography and RPC. Deployments should rate-limit using network and application signals without treating unverified keyid values as authenticated. Universal Account verification inherits the freshness, finality, and availability of the selected chain-state provider.
Discovery metadata
Discovery is an integration hint, not an authorization source. A malicious or compromised origin can publish misleading names, images, endpoints, and policies, so a signer keeps its own limits on the postures it is willing to sign and does not weaken them because a document advertises a weaker one. Clients must render its strings as untrusted text, constrain image retrieval and decoding, keep credentials off metadata fetches, reject unsafe redirects, and show the origin independently of publisher-controlled branding. A stale document can cause a failed first request but cannot make a verifier accept a request outside its runtime policy.
Principal policy disclosure
Evaluating Principal policy before cryptography keeps Accounts the application rejects from causing signature verification and RPC calls, but the resulting principal_not_allowed tells an unauthenticated caller whether an Account is accepted. A verifier for which that is sensitive evaluates Principal policy after cryptographic verification (Section 3.5) and accepts the cost of verifying signatures from Accounts it will reject.
Privacy and confidentiality
Stable Account IDs correlate requests. HTTP Message Signatures provide authenticity and integrity, not confidentiality; TLS remains required for non-public data.
Copyright
Copyright and related rights waived via CC0.
