Pre-delegated Signature Verification
Abstract
This ERC defines a signature verification procedure that enables signature validation for accounts that intend to delegate via EIP-7702 before onchain delegation occurs. The standard introduces a detectable signature wrapper containing an EIP-7702 authorization and initialization data, allowing verifiers to simulate the delegation and validate signatures through ERC-1271 in a single atomic operation, whilst falling back to ERC-6492 verification if the signature is not wrapped.
Motivation
EIP-7702 enables EOAs to set code in their account, but signatures are often generated before onchain delegation occurs. Current verification methods cannot validate these pre-delegation signatures against the intended delegate logic.
This proposal addresses this limitation by:
- Standardizing a signature format that embeds delegation intent
- Defining a verification procedure that simulates delegation atomically
- Maintaining compatibility with existing ERC-1271 infrastructure, including Create2-based predeployed verification (ERC-6492)
Specification
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 and RFC 8174.
Signer Side (e.g. Wallets)
This ERC proposes that wallets can wrap signatures into a predelegate verification-compatible format that is constructed as follows:
wrapped_signature = signature
|| context
|| context.length
|| MAGIC
MAGIC = 0x8010801080108010801080108010801080108010801080108010801080108010
context = abi.encode(authorization, init_to, init_data)
authorization = abi.encode(chain_id, address, nonce, y_parity, r, s)Where:
signature: The signature to be verified by the delegate'sisValidSignaturemethodMAGIC: Detection marker for EIP-7702 accountsauthorization: Signed EIP-7702 authorizationinit_to: Optional address of the initializer. Can be the account itself, or an external initializer (e.g. account orchestrator)init_data: Optional initialization data to be executed before validation
Requirements
- Signers SHOULD NOT wrap signatures if the account has already been delegated.
init_dataMAY be empty if the account has no initialization data.- If
init_datais not empty, contracts MUST ensure that verification ofinit_dataoccurs on initialization. init_toMAY be empty if there is noinit_dataOR the initializer is the account itself
Verifier Side (e.g. Apps, Libraries,)
The verification procedure is performed by consumers of the account contract (e.g. applications, services, libraries, etc.).
Given inputs (account: address, digest: bytes32, wrapped_signature: bytes), verifiers MUST implement the following procedure (pseudocode):
- Check if
wrapped_signatureends withMAGIC - If
MAGICis not found: - Otherwise:
- Parse the wrapped signature:
length = wrapped_signature.lengthcontext_length = wrapped_signature[length-64:length-32]signature = wrapped_signature[0:length-64-context_length](authorization, init_data, init_to) = abi.decode(wrapped_signature[length-64-context_length:length-64], (bytes, bytes, address))(chain_id, delegation, nonce, y_parity, r, s) = abi.decode(authorization, (uint256, address, uint256, uint8, bytes32, bytes32))
- If
account.code == bytes.concat(hex"ef0100", delegation):- Perform standard ERC-1271 verification:
account.isValidSignature(digest, signature)- If success, return successfully.
- If failure, attempt
ecrecoververification.
- Perform standard ERC-1271 verification:
- Perform a multicall to initialize the account and validate the signature:
init_to.call(init_data)account.isValidSignature(digest, signature)- Return the result of (b).
- Parse the wrapped signature:
Requirements
- Verifiers MUST follow the verification procedure as specified
- Verifiers MAY use a (pre)deployed multicall contract or a deployless multicall mechanism.
- Verifiers MUST include an
authorizationListparameter containingauthorization(in thewrapped_signature) in theeth_callrequest for Step 3(iii).
Rationale
Offchain Verification
The procedure for 0x8010...8010 signatures is intended for offchain signature verification, as onchain contracts cannot apply a delegation in a transient or simulated manner.
Atomic Simulation Context
The design executes initialization and validation atomically (via a verifier or multicall contract) to ensure state changes from initialization are visible during validation. This mirrors the execution flow when a EIP-7702 delegation transaction includes authorization.
Backwards Compatibility
This ERC leaves the inner signature unaltered in the wrapped signature foramt, rather than ABI-encoding it. The assumption is that most ERC-1271 isValidSignature implementations rely on a static length for the signature, and will therefore parse the inner signature correctly when reading up to the defined context. This ensures wrapped signatures can still be validated if they are passed to ERC-1271 isValidSignature as-is for whatever reason.
Test Cases
TBD
Security Considerations
TBD
Copyright
Copyright and related rights waived via CC0.
