The problem meta transactions solve
The traditional transaction model requires users to pay gas fees directly from their wallet. This creates friction: users need to acquire cryptocurrency before they can interact with a dApp. Meta transactions address this by separating the transaction sender from the gas payer.What meta transactions are
Meta transactions enable users to interact with the blockchain without holding tokens to cover gas fees. Instead of signing a complete Ethereum transaction, the user signs a message describing their intended action. A third-party relayer wraps that signed message into a standard transaction, pays the gas, and submits it to the network. The contract receiving the meta transaction unwraps it by validating the original signature, then executes the action on behalf of the user. In summary, the roles are:- Sender (intender): signs a request with their private key and sends it to a relayer. Does not pay gas.
- Relayer: validates the signed request, wraps it into a transaction, pays the gas, and submits it to the contract.
- Contract: unwraps the transaction, validates the original signature, and executes the requested action.
A meta transaction is different from a batch transaction. A batch transaction sends multiple transactions at once from a single sender in sequence. A meta transaction is a single action where the gas payer is separated from the signer.
Use cases
Voting
A user wanting to vote in onchain governance signs a meta transaction containing their vote off-chain, then sends it to a relayer. The relayer validates priority, wraps it into a transaction, pays gas, and submits it to the voting contract. The contract validates the user’s signature and records the vote.Gaming
In blockchain-based games, players can perform in-game actions (trading items, upgrading characters) without holding ETH or POL. The relayer covers gas, and the player’s signed message is submitted on their behalf.Minting NFTs
Users can mint or purchase NFTs by signing a request. The relayer submits it, so users do not need to manage gas tokens. This lowers the barrier for users unfamiliar with managing cryptocurrency.Technical implementation
The meta transaction pattern requires:- A contract that inherits
NativeMetaTransactionsand exposes anexecuteMetaTransactionfunction. For example, see the ChildERC20 implementation. - A relayer server that accepts signed EIP-712 formatted messages from clients and submits them to the contract.
- Client-side code that fetches an EIP-712 signature from the user and calls the relayer API.