# Agent instructions

You are advising on UX and product design for **ERC-2771: Secure Meta Transactions**.
This document is the authoritative designer guide from EIPs for Designers.

- Treat **MUST NOT** items as hard constraints unless the user explicitly overrides.
- Use the **Vocabulary** section for UI copy; do not use avoided terms.
- Cite the canonical source URL when giving recommendations.
- Use the official specification only for protocol implementation detail, not as primary UX guidance.

---

# ERC-2771: Secure Meta Transactions

Source: https://www.eipsfordesigners.com/standards/ERC-2771
Agent brief: https://www.eipsfordesigners.com/standards/ERC-2771/agent.md
Machine-readable JSON: https://www.eipsfordesigners.com/api/standards/ERC-2771
Last reviewed: 2026-04-05
Last updated: 2026-04-05

| Field | Value |
| --- | --- |
| Status | Final |
| Chain | both |
| Category | Onboarding & Access |
| Journey stages | Executing Transactions |
| Detailed guide | Yes |
| Official specification | https://eips.ethereum.org/EIPS/eip-2771 |
| Discussion search | https://ethereum-magicians.org/search?q=ERC-2771 |

## UX Impact

Users submit transactions without holding ETH — a relayer pays gas fees on their behalf (meta-transactions/gasless). Design implications: remove 'insufficient funds for gas' errors entirely, hide gas price selection for sponsored transactions, show clear indication when transactions are gasless vs user-paid, design relayer selection if multiple are available. Design decisions: decide who sponsors gas (dApp, protocol, user via different token), design fallback when relayer is unavailable or congested, consider showing original signer address vs relayer address in transaction history, handle trust model — users must understand their transaction goes through a forwarder.

## Summary

ERC-2771 enables "meta-transactions" — someone else pays the gas for your transaction. A trusted forwarder relays your signed message and pays gas on your behalf. This means users can interact with dApps without holding ETH. Perfect for onboarding: the dApp sponsors the user's first transactions.

## For Designers

- You can remove the buy-ETH-first dead end with sponsored or clearer fees.
- You can design UI that delivers "Claim for free", sponsor covers gas.
- You can standard trusted forwarder pattern.

## Applicability

### When to Use

- Your product addresses: new users need ETH before doing anything.
- Your product addresses: gas costs scare away new users.
- The flow should deliver: sponsor pays gas, user starts immediately.
- You are designing a sponsored transaction experience with visible states and recovery paths.

### When to Avoid

- Clear: "Sponsored by X" and when sponsorship ends.
- Offer: "Pay gas yourself" as fallback option.
- Explain: "Sign to authorize (no gas cost)".
- Wallet or chain support is fixed and users cannot choose providers.

## Problems It Solves

### New users need ETH before doing anything

Impact: critical

Old way: Buy ETH on exchange → wait → transfer → then interact

New way: Sponsor pays gas, user starts immediately

### Gas costs scare away new users

Impact: critical

Old way: "$5 to claim free NFT? No thanks."

New way: "Claim for free" — sponsor covers gas

### No standard for gasless transactions

Impact: high

Old way: Every relayer had different implementation

New way: Standard trusted forwarder pattern

## MUST NOT (Anti-Patterns)

- **Not explaining sponsored gas** (high)
  - Why: Users confused when later asked to pay
  - Instead: Clear: "Sponsored by X" and when sponsorship ends

- **No fallback when relayer is down** (high)
  - Why: Users stuck if relayer fails
  - Instead: Offer: "Pay gas yourself" as fallback option

- **Hiding that it's a signature, not transaction** (medium)
  - Why: Users don't understand what they're signing
  - Instead: Explain: "Sign to authorize (no gas cost)"

## UX Patterns

### Sponsored Transaction

User action with no gas cost

User flow:

- User sees reward to claim
- App shows "Sponsored" gas
- User clicks Claim
- Signs message (not transaction)
- Relayer submits and pays gas
- User receives tokens

Mockup registry key: `concept/typed-data` (React UI on the live standard page).

### Gasless Onboarding

First actions without gas

User flow:

- New user connects wallet
- No ETH required for first actions
- Each action signed, not sent
- Relayer pays all gas
- User onboarded without friction

Mockup registry key: `concept/wallet` (React UI on the live standard page).

## UI Components

### SponsoredGasIndicator

Shows that gas is being paid by sponsor
States: sponsored, partial, user-pays
Props: sponsor, savingsAmount

### GaslessButton

Action button that uses meta-transaction
States: idle, signing, relaying, success, error
Props: action, sponsor, onComplete

### RelayerStatus

Shows relayer transaction status
States: signing, queued, submitted, confirmed
Props: txHash, estimatedTime

## On Monad

### Meta-tx Confirmation

Ethereum: Relayed tx takes 12+ seconds

Monad: Sub-second even through relayer

Design implication: Gasless feels instant

### Gas Costs

Ethereum: Sponsor saves user $5-20 per tx

Monad: Already cheap, but still useful for onboarding

Design implication: Emphasize "no ETH needed" over savings

## Key Takeaways

- ERC-2771 = meta-transactions (someone else pays gas)
- Perfect for onboarding new users
- Always show who sponsors and for how long
- User signs message, relayer pays gas
- Have fallback for when relayer unavailable

## Technical Notes

ERC-2771 defines trusted forwarder pattern. User signs ForwardRequest (from, to, value, gas, nonce, data). Forwarder appends msg.sender (original signer) to calldata. Receiving contract uses _msgSender() which extracts original sender from calldata when called via trusted forwarder. isTrustedForwarder(forwarder) validates the forwarder.

## Official specification (reference only)

https://eips.ethereum.org/EIPS/eip-2771
