ERC-7766 · Withdrawn · ERC · 2024-09-01
ERC-7766: Signature Aggregation for ERC-4337
A withdrawn ERC-4337 extension that let a staked aggregator contract verify one combined signature for many UserOperations in a bundle, saving gas and calldata.
What problem does it solve?
In ERC-4337, each UserOperation carries its own signature, and the EntryPoint checks each one separately. For schemes such as BLS, many signatures can be combined into one short signature that is checked once. On rollups, where calldata posted to Ethereum is a large share of the cost, that can save a lot.
ERC-7766 described how accounts, bundlers and the EntryPoint coordinate to use such an aggregated signature.
How it works
- A new entity, the aggregator, is a contract that accounts trust to check signatures on their behalf. Aggregators must be staked, and bundlers whitelist the ones they support.
- An account opts in by returning the aggregator's address from
validateUserOp(in theauthorizerpart of its return value). - When a bundler accepts an operation, it calls the aggregator's
validateUserOpSignature(userOp). This checks the individual signature and returns a replacement value (often empty) to use on-chain. The bundler re-runsvalidateUserOpwith that value to make sure the result is unchanged. Throttling and banning follow ERC-7562 rules. - When building a bundle, the bundler groups operations by aggregator and calls
aggregateSignatures(userOps)to produce one signature per group. - On-chain,
handleAggregatedOpscalls each aggregator'svalidateSignatures(userOps, signature)once, then runs the usual per-account validation and execution. A bundle can mix several aggregators and non-aggregated operations.
Sample code
The aggregator interface and the extra EntryPoint entry point, adapted from the spec:
// PackedUserOperation is the ERC-4337 v0.7 struct.
interface IAggregator {
function validateUserOpSignature(PackedUserOperation calldata userOp)
external view returns (bytes memory sigForUserOp);
function aggregateSignatures(PackedUserOperation[] calldata userOps)
external view returns (bytes memory aggregatedSignature);
function validateSignatures(PackedUserOperation[] calldata userOps, bytes calldata signature)
external view; // must revert if invalid
}
struct UserOpsPerAggregator {
PackedUserOperation[] userOps;
IAggregator aggregator;
bytes signature;
}
// Added to the EntryPoint:
// function handleAggregatedOps(UserOpsPerAggregator[] calldata opsPerAggregator,
// address payable beneficiary);
A bundler that does not support the account's aggregator rejects the operation with JSON-RPC error code -32506.
Things to know
- Status is Withdrawn. The stated reason: no production adoption of aggregatable signature schemes in today's account abstraction ecosystem; the authors plan a separate approach for native account abstraction.
- The spec notes that the deployed
EntryPointalready had aggregation hooks on the roadmap, so this was an additive description rather than a breaking change. - Aggregators are among the most trusted contracts in such a system: a buggy or malicious one can authorise operations for every account that uses it, or invalidate many at once.
- For native account abstraction work, see the withdrawn EIP-7701 and EIP-8141, which superseded it.