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.
This article examines ERC-3005, a proposal for submitting batches of meta-transactions.
The following explanation translates, summarizes, and expands on the original proposal.
I also cover a range of other EIPs.
Overview
ERC-3005 defines a function called processMetaBatch as an extension to fungible token standards such as ERC-20.
The function receives, validates, and processes multiple meta-transactions in a batch.
A meta-transaction allows a user to authorize an operation without directly paying its Ethereum gas fees. A third party, called a relayer, submits the transaction and pays the network fees. ERC-3005 allows signed requests from multiple senders to be processed in one on-chain transaction.
The function verifies the individual signatures and associated data before executing token transfers. Relayers can therefore avoid submitting a separate Ethereum transaction for every request, potentially reducing aggregate gas costs.
The following article discusses signature-based token approvals and related meta-transaction patterns.
[ERC-2612] Combining ERC-20 Approvals and Transfers in One Transaction with Permit
Motivation
Many Ethereum accounts hold ERC-20 tokens but lack the ETH required to pay for a transaction. This makes transferring their tokens directly difficult.
Meta-transactions address this problem by allowing relayers to pay the gas fees. The proposal identifies a limitation in earlier approaches: they often relay individual requests or batch requests from the same sender, rather than providing a common token-level mechanism for batching requests from different senders.
ERC-3005 aims to process meta-transactions from multiple senders together. Relayers can submit many operations in one transaction, reducing transaction overhead and improving the efficiency of their infrastructure.

Specification
ERC-3005 proposes extending fungible tokens such as ERC-20 with processMetaBatch, a function for processing meta-transactions from multiple senders.
Meta-transaction data
The function needs to account for the following information when validating signed requests and transferring tokens.
- Sender address.
- Recipient address.
- Token amount.
- Relayer fee.
- Nonce.
- Expiration, represented by the applicable block number or timestamp.
- Token contract address.
- Relayer address.
- Signature.
Some values must be supplied explicitly, while others can be derived from the contract's state or execution context.
Arguments required by processMetaBatch
The caller supplies the following data.
- Sender addresses.
- Recipient addresses.
- Token amounts.
- Relayer fees.
- Expiration values.
- Signature components V, R, and S.
The nonce, token contract address, and relayer address can be determined within the function and therefore need not be supplied as separate arguments.
Calculating the message hash
Each meta-transaction is hashed using the following construction.
keccak256(address(sender)
++ address(recipient)
++ uint256(amount)
++ uint256(relayerFee)
++ uint256(nonce)
++ uint256(expirationDate)
++ address(tokenContract)
++ address(relayer)
)The sender signs the resulting message, and the contract uses the signature to authenticate the request.
Validation rules
- The signed nonce must be exactly one greater than the preceding nonce.
- Requests with a zero sender or recipient address are invalid.
- Expired requests must not be processed.
- Requests are invalid when the sender's balance is insufficient to cover the transfer amount plus the relayer fee.
- Invalid individual requests are skipped rather than deliberately reverting the entire batch.
Interface
function processMetaBatch(
address[] memory senders,
address[] memory recipients,
uint256[] memory amounts,
uint256[] memory relayerFees,
uint256[] memory blocks,
uint8[] memory sigV,
bytes32[] memory sigR,
bytes32[] memory sigS
) public returns (bool);Nonce management
mapping (address => uint256) private _metaNonces;
function nonceOf(address account) public view returns (uint256);The contract tracks a nonce for each user to protect against replay of previously processed authorizations.
Token transfer processing
For each successfully validated request, the contract performs the following operations.
- Update the sender's nonce.
- Transfer tokens to the recipient.
- Pay the relayer, identified by
msg.sender, the authorized token-denominated fee.
Variables
_metaNonces
mapping (address => uint256) private _metaNonces;A mapping that stores the meta-transaction nonce for each account. Using a sequential nonce prevents successful reuse of the same signed request.
Parameters
address- The account address.
uint256- The corresponding nonce.
Functions
nonceOf
function nonceOf(address account) public view returns (uint256) {
return _metaNonces[account];
}Returns the specified account's current nonce. Applications use this information when preparing and validating meta-transactions.
Arguments
account- The account whose nonce is requested.
Return value
uint256- The account's current nonce.
processMetaBatch
function processMetaBatch(
address[] memory senders,
address[] memory recipients,
uint256[] memory amounts,
uint256[] memory relayerFees,
uint256[] memory blocks,
uint8[] memory sigV,
bytes32[] memory sigR,
bytes32[] memory sigS
) public returns (bool);Processes a batch of signed meta-transactions, potentially involving different senders. After validating an individual request, the function performs the token transfer and accounts for the relayer's compensation. The intended behavior is to skip invalid requests and continue processing valid ones. Batch-level errors, such as malformed arguments or insufficient transaction gas, can still prevent execution.
Arguments
senders- An array of sender addresses.
recipients- An array of recipient addresses.
amounts- An array of token transfer amounts.
relayerFees- An array of fees authorized for the relayer.
blocks- An array of expiration block numbers, or the applicable expiration values in a variant implementation.
sigV,sigR,sigS- Three arrays containing the signature components for the respective requests.
Return value
bool- Indicates completion of batch processing, according to the implementation. It does not imply that every individual request succeeded.
Rationale
Integrated design
Earlier meta-transaction architectures, such as the Gas Station Network (GSN), use multiple cooperating contracts. Such designs can introduce additional complexity and execution overhead.
ERC-3005 instead integrates receiving requests, checking signatures, and transferring tokens into the token contract's processMetaBatch function.
This can simplify the execution path for the particular use case of signed token transfers.
Function parameter design
The function accepts several parallel arrays.
- Sender addresses.
- Recipient addresses.
- Transfer amounts.
- Relayer fees.
- Expiration block numbers.
- Signature components
v,r, ands.
Entries at the same index belong to the same request. The arrays must maintain consistent ordering and compatible lengths. Incorrect associations will cause validation failures or other execution errors.
Alternative representations: packing data instead of parallel arrays
An alternative is to encode each request into a packed representation and supply an array of encoded requests. This could reduce the number of explicit function arguments.
However, the contract would need additional decoding logic, increasing implementation complexity.
Why omit the nonce from the function arguments?
Although the nonce forms part of the signed message hash, the caller does not need to supply it explicitly. The required value is derived from the sender's current recorded nonce plus one.
This reduces the number of parameters and can help avoid Solidity's stack-too-deep compilation errors.
Can ERC-2612's nonces mapping be reused?
The ERC-2612 permit function also tracks nonces.
An implementation might consider sharing nonce storage between permit and batched meta-transactions, but this affects authorization sequencing and security.
The original proposal does not reach a definitive conclusion on reuse.
Optimizing token transfers
Using the conventional OpenZeppelin ERC-20 _transfer function directly for every request can introduce two issues.
- A reverting transfer can cause the whole batch to revert unless the failure is prevented or isolated.
- Repeated storage writes can increase gas consumption.
ERC-3005 proposes processing valid requests selectively and aggregating relayer compensation. This can reduce storage operations and transaction overhead, provided the implementation preserves correct balance and authorization accounting.
Reference implementation
function processMetaBatch(address[] memory senders,
address[] memory recipients,
uint256[] memory amounts,
uint256[] memory relayerFees,
uint256[] memory blocks,
uint8[] memory sigV,
bytes32[] memory sigR,
bytes32[] memory sigS) public returns (bool) {
address sender;
uint256 newNonce;
uint256 relayerFeesSum = 0;
bytes32 msgHash;
uint256 i;
// loop through all meta txs
for (i = 0; i < senders.length; i++) {
sender = senders[i];
newNonce = _metaNonces[sender] + 1;
if(sender == address(0) || recipients[i] == address(0)) {
continue; // sender or recipient is 0x0 address, skip this meta tx
}
// the meta tx should be processed until (including) the specified block number, otherwise it is invalid
if(block.number > blocks[i]) {
continue; // if current block number is bigger than the requested number, skip this meta tx
}
// check if meta tx sender's balance is big enough
if(_balances[sender] < (amounts[i] + relayerFees[i])) {
continue; // if sender's balance is less than the amount and the relayer fee, skip this meta tx
}
// check if the signature is valid
msgHash = keccak256(abi.encode(sender, recipients[i], amounts[i], relayerFees[i], newNonce, blocks[i], address(this), msg.sender));
if(sender != ecrecover(keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", msgHash)), sigV[i], sigR[i], sigS[i])) {
continue; // if sig is not valid, skip to the next meta tx
}
// set a new nonce for the sender
_metaNonces[sender] = newNonce;
// transfer tokens
_balances[sender] -= (amounts[i] + relayerFees[i]);
_balances[recipients[i]] += amounts[i];
relayerFeesSum += relayerFees[i];
}
// give the relayer the sum of all relayer fees
_balances[msg.sender] += relayerFeesSum;
return true;
}Security considerations
Forged meta-transactions
Each sender must authorize their request using a valid signature.
The contract uses ecrecover to recover the signer and checks that it matches the specified sender.
Requests that fail authentication are skipped.
Replay attacks
The proposal addresses two forms of replay.
- Reusing a successful meta-transaction in the same contract
The contract tracks a nonce for each sender so that an already consumed nonce cannot be used again.
- Reusing a meta-transaction in another contract
The signed message incorporates the token contract address through address(this).
This binds the authorization to that contract address. Separate chain-domain protection is also important where the same address can exist on multiple networks.
Signature verification
Every individual request must be authenticated. The proposed behavior is to skip requests with invalid signatures so that valid requests can still be processed.
Relayers do not earn the authorized fee for invalid requests, so validating requests before submission is advisable.
Delayed submission and unintended additional spending
A user may transfer tokens directly after signing a meta-transaction. A relayer holding the still-valid authorization might later submit it, resulting in an additional transfer that the user did not expect.
The proposal requires an expiration block number.
Requests are skipped when block.number exceeds that value.
Expiration limits the period during which an authorization remains usable, but does not prevent duplicate economic payments within that period.
Front-running
A different relayer could attempt to copy a pending signed request and submit it first.
The signed hash binds the request to the intended relayer address through the execution context. A different relayer therefore cannot successfully claim the same authorization under that signature.
Relaying multiple requests with the same nonce
A user may sign competing requests with the same nonce for different relayers. Only the first successfully processed request can consume that nonce. The other requests become invalid, and their relayers may waste gas.
The proposal discusses sharing sender, token, and nonce information among relayers through a coordination mechanism to reduce these conflicts.
Excessively long expiration periods
A user may be persuaded to sign a request with an unnecessarily distant expiration, leaving the authorization valid for longer than intended.
Two approaches are discussed.
- Enforce a maximum expiration horizon of 100,000 blocks at the contract level.
- Where the contract does not impose a maximum, have wallet or relayer software validate the proposed expiration and warn the user.
The original article estimates 100,000 blocks as approximately 17 days under historical block-time assumptions. The actual duration depends on the chain and its block production schedule.
Citation
Matt (@defifuture), "ERC-3005: Batched meta transactions [DRAFT]," Ethereum Improvement Proposals, no. 3005, September 2020. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-3005.
Conclusion
This article covered ERC-3005, a proposal for batching signed token transfers from multiple senders into one Ethereum transaction.
If you have questions, feel free to reach out via Twitter DM.
I also publish on the following platforms.



