Architecture (ERC-2771)
This page describes the ERC-2771 proof-of-concept flow as used with Watr testnet-style deployments: a user signs typed data, a relayer pays gas, and the forwarder delivers the call to an ERC-2771-aware recipient contract.
Personas and roles
- End user (Transaction Signer)
- Signs an EIP-712 meta-transaction request
- Does not need to hold the native gas token for the transaction flow
- Relayer (Gas payer)
- Holds native gas token
- Submits
execute(...)transactions to the forwarder
- Trusted forwarder
- Verifies signature, nonce, and deadline
- Appends the original sender to calldata and calls the recipient
- Recipient contract
- Uses
ERC2771Contextand_msgSender()to attribute actions to the user
- Uses
High-level flow

Key implementation constraints
- Forwarder domain name must match signing:
- EIP-712 domain
nameis part of what the user signs. - The signing code must match the forwarder deployment name.
- EIP-712 domain
- Recipient contracts must use
_msgSender():- Any access control or attribution based on
msg.sendermust be migrated.
- Any access control or attribution based on