Introduction

Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.

I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.

I also build and publish a variety of tools, libraries, and open-source projects.

ERC-7272 proposes Ethereum Access Tokens (EATs), signed messages that allow an issuer to authorize specific smart contract calls after evaluating a user's eligibility.

This article explains the following proposal, with additional context and examples.

You can find my other proposal articles here.

Overview

An Ethereum Access Token is a signed message that grants an Ethereum account permission to access a specific on-chain resource.

EATs use EIP-712 typed structured data. EIP-712 defines a format for hashing and signing structured messages so applications can present and verify the relevant fields consistently.

For background on EIP-712, see:

EIP-712: Typed structured data hashing and signing

Like JSON Web Tokens (JWTs), EATs can represent short-lived authorization. JWTs are widely used in web applications to convey claims associated with authenticated sessions. EATs are designed specifically for on-chain verification and authorization of smart contract function calls.

JWT

JSON Web Tokens are a compact format for communicating claims between parties. A signed JWT uses a cryptographic signature or message authentication code to protect the integrity of its claims.

Components

A typical signed JWT contains three parts.

  • Header
    • A JSON object identifying the token type and the signing or MAC algorithm, such as HMAC-SHA256 or an RSA-based signature algorithm.
  • Payload
    • A JSON object containing claims such as the issuer, expiration time, or user identifier. Applications can define additional claims as needed.
  • Signature
    • A cryptographic signature or MAC computed over the encoded header and payload. Verification detects unauthorized modifications.

Usage

An authentication server can issue a JWT to a client after authenticating the user. The client presents the token in subsequent requests, and the server verifies its integrity and applicable claims before accepting it.

This avoids requiring users to submit their passwords for every request.

Advantages

  • Self-contained claims can reduce database lookups when additional server-side checks are unnecessary.
  • Tokens can be carried in HTTP headers and used by multiple services with an agreed trust configuration. Browser CORS restrictions still apply.
  • Signature or MAC verification protects against unauthorized modifications.

Limitations

Signed JWT payloads are generally readable by anyone holding the token. Confidential claims require suitable encryption or another mechanism. Expiration, audience checks, issuer validation, revocation policies, and secure token handling remain important.

An EAT acts as an authorization credential for a specific operation or resource on Ethereum. An off-chain service can grant an account permission to invoke a gated contract function without publishing the underlying eligibility information on-chain.

Motivation

EATs provide a flexible access-control layer for smart contracts, particularly where authorization depends on changing conditions or information evaluated outside the blockchain.

Benefits and use cases

  • Short-lived access control: Authorization can be limited to a particular action and validity period rather than granting permanent permissions.
  • Dynamic eligibility rules: An issuer can change its off-chain eligibility criteria without redeploying the consuming contract, provided the on-chain trust configuration remains appropriate.
  • An alternative to on-chain registries: Applications may use signed authorizations instead of continuously maintaining on-chain records of eligible accounts.
  • Privacy: Sensitive eligibility information can remain off-chain. The authorization itself and its associated on-chain call may still be publicly visible.

Example

An off-chain verifier might assess whether a user meets the requirements for receiving a token or interacting with a regulated smart contract. It can evaluate credentials or compliance status before issuing an EAT.

A common message format improves interoperability and can simplify integration between issuers and on-chain applications.

Specification

The following diagram illustrates an example DeFi application in which a user interacts with an off-chain service and subsequently obtains access to a gated smart contract function.

Ethereum Access Token authorization flow Source: https://eips.ethereum.org/EIPS/eip-7272

Workflow

  1. User authentication. The user provides sufficient information to the off-chain service to demonstrate eligibility.
  2. EAT issuance. An authorized issuer signs the access token and provides it to the user. The user receives authorization for a particular contract call.
  3. Contract interaction. The user submits the EAT with the transaction and invokes the gated function within the authorized time window.
  4. EAT verification. During transaction execution, the contract verifies the access token before allowing the protected operation.

Fine-grained access control

An EAT-based access-control mechanism must verify the relevant execution context:

  • The function being called matches the authorized function.
  • The function parameters match those authorized by the issuer.
  • The caller matches the authorized account.
  • The token is still within its validity period.
  • The target contract matches the authorized target.
  • The token was signed by a recognized issuer.

Binding authorization to these fields reduces the risk that a valid token can be used for an unintended operation.

Ethereum Access Token structure

An EAT is based on structured data hashed and signed using EIP-712.

Main components

ts
{
 uint8 v,
 bytes32 r,
 bytes32 s,
 uint256 expiry
}
  • Signature: The v, r, and s components of the issuer's ECDSA signature.
  • Expiration (expiry): A Unix timestamp defining the authorization deadline. For an unexpired token, the current block timestamp must precede the deadline, subject to the implementation's precise boundary rule.

The original Japanese article reverses the timestamp comparison in its explanation. An expiry timestamp in the past does not represent a valid, unexpired authorization.

Payload structure

ts
struct AccessToken {
    uint256 expiry;
    FunctionCall functionCall;
}

struct FunctionCall {
    bytes4 functionSignature;
    address target;
    address caller;
    bytes parameters;
}

The EAT payload contains two structures: AccessToken and FunctionCall.

AccessToken

Contains the expiry timestamp and a FunctionCall describing the authorized operation.

FunctionCall

Contains the following fields.

  • functionSignature: The function selector, which is expected to match msg.sig.
  • target: The address of the contract being called.
  • caller: The authorized caller, expected to match msg.sender in the verification context.
  • parameters: The encoded function parameters, excluding the signature components and expiry fields supplied for access-token verification.

By signing these fields using EIP-712, an issuer can authorize a specific caller to invoke a particular function on a particular contract with designated arguments. The expiration limits the time during which the authorization can be used.

EAT verification

Token structure

The submitted authorization includes the ECDSA signature components v, r, and s and the expiry timestamp. The signed payload also binds the function selector, target contract, caller, and parameters.

The verifier reconstructs the relevant structured data and checks the authorization against the actual execution context.

Verification process

The reference architecture separates token consumption from verification using two contracts.

  • AccessTokenConsumer: Integrated into a contract that exposes gated functions. It supplies the access-token checks needed before protected operations execute.
  • AccessTokenVerifier: Verifies the token through its verify function, checking expiration, recovering the signer from the signature, and determining whether that signer is an authorized issuer.

The consuming contract must supply the correct call context and enforce the verifier's result. A valid signature by itself does not authorize a different call or guarantee that the underlying operation is safe.

Rationale

Single-use authorization

The reference implementation prevents an EAT from being reused by tracking its consumption. Other implementations may adopt different consumption policies.

Single-use enforcement is particularly important when an otherwise valid signature could authorize repeated state-changing calls.

EIP-712

Using EIP-712 lets EATs work with established Ethereum signing and verification infrastructure. A correctly configured signing domain can bind the authorization to a particular chain and verification context.

EIP-712 does not itself provide replay protection. Implementations must enforce the applicable domain, expiry, and consumption rules.

Zero-knowledge proofs

Zero-knowledge proofs allow a party to demonstrate a claim without revealing its underlying witness. They can also introduce additional proof-generation and verification complexity.

EATs instead rely on signed messages. Ethereum provides the ecrecover precompile for recovering addresses from ECDSA signatures, making signature verification relatively straightforward.

Different zero-knowledge proof systems may require different verification implementations. A signed EAT offers a simpler interface, but relies on trusting the authorized issuer to evaluate eligibility correctly.

The reference design combines single-use authorization, EIP-712 signing, and ordinary signature verification. It trades the stronger privacy or trust-minimization properties of certain proof systems for a relatively straightforward issuer-based access-control model.

Compatibility

The proposal supports gating ordinary smart contract functions, excluding receive and fallback functions from its intended access-token interface.

  • Gated functions: A protected function executes only when the applicable authorization conditions are satisfied, including presentation of a valid EAT.
  • receive and fallback: These are special Solidity entry points. The receive function is used for calls with empty calldata when it is defined. The fallback function handles unmatched function selectors and may handle empty calldata when no receive function exists.

Although contracts can implement restrictions in these special functions, the proposed EAT interface is designed for explicitly identified function calls and their parameters.

Implementation

Security considerations

Replay attacks

A replay attack occurs when an existing authorization is reused in a way that was not intended by its issuer.

The reference implementation uses _consumeAccessToken to mark an access token as consumed, preventing subsequent reuse under its consumption rules. Implementations should also ensure that the authorization is bound to the correct chain and contract and cannot be consumed in an unintended context.

The original article links to the following discussion of reentrancy. Reentrancy is a separate vulnerability class from signature replay, although both require careful consideration of repeated execution.

https://chaldene.net/solidity-reentrancy-attack

Security of off-chain issuance

Access to protected on-chain resources depends on tokens issued by an off-chain service. Compromise of the issuer's signing keys or eligibility checks can result in unauthorized access tokens.

The issuer's key management, authorization policies, monitoring, and revocation mechanisms therefore form part of the application's security model.

Expiration

The validity period should balance security and usability. Excessively long periods increase the time during which a leaked or otherwise misused authorization may remain valid. Extremely short periods may cause legitimate transactions to expire before inclusion.

Applications should account for transaction inclusion delays and define their expiration boundary precisely.

Citation

Chris Chung (@0xpApaSmURf), Raphael Roullet (@ra-phael), "ERC-7272: Ethereum Access Token [DRAFT]," Ethereum Improvement Proposals, no. 7272, July 2023. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-7272.

Conclusion

ERC-7272 proposes signed access tokens that bind off-chain authorization to a specific on-chain operation. By specifying the caller, target, function, arguments, and expiration, an EAT can provide fine-grained access control without requiring the underlying eligibility information to be stored on-chain.

If you have questions, feel free to contact me on Twitter.

Twitter @cardene777

You can also find my work on the following sites.

https://chaldene.net/