ERC-5719 Signature replacement interface
Stagnant · Signatures & auth · created 2022-09-26
Lets a smart contract wallet provide a URI from which a client can obtain a valid replacement signature, without interacting with the original signer, when the wallet's signature has become invalid due to a signer change or similar event.
Why it is needed
Signatures from regular accounts (EOAs) that sign directly with a private key remain valid forever once valid, but signatures from smart contract wallets using EIP-1271 are not idempotent. If the internal set of signers changes, the wallet imposes a signature expiration, or the wallet implementation upgrades to a new version that changes the signing scheme, a signature that was valid in the past can become invalid at some point. Protocols that rely on signatures staying valid for a long time, such as exchanges using off-chain order books, can have settlement blocked as a result. The bigger problem is that the original signing wallet (or its owner) may not be online at the moment the signature needs to be verified, so a standard, non-interactive way to replace the signature is needed.
What to implement
function getAlternativeSignature(bytes32 _digest) external view returns (string);: Returns a URI pointing to JSON containing replacement signature information for the given digest (the digest that was signed).
In depth
The getAlternativeSignature function
The wallet contract MUST implement function getAlternativeSignature(bytes32 _digest) external view returns (string). The argument _digest is the digest that the now-invalid original signature corresponded to. The return value MUST be a URI string pointing to a JSON object containing the replacement signature information.
The replacement signature JSON schema
The JSON object pointed to by the URI has two properties, blockHash and signature. blockHash is a string representing the block.hash that the signature should be valid against, and signature is the replacement signature string for the given digest.
The client processing procedure
The client first verifies the signature using EIP-1271, and if valid, uses it as is. If invalid, it calls getAlternativeSignature(_digest), and MUST treat the signature as invalid if the call fails, no URI is returned, or the content is invalid. The newly received signature is also verified with EIP-1271, and if it fails, the same process is repeated. However, if the URI returns the same signature as before, it MUST be treated as invalid, and the client MUST impose a limit on the number of retries, with that limit left up to the client to define.
Why the URI approach was chosen
A URI can accommodate both centralized and decentralized solutions. For example, a server could re-encode a Merkle proof in real time, or an IPFS link could point to a directory containing precomputed signature variants. The reason getAlternativeSignature points to an off-chain source is the assumption that the wallet will not have an on-chain record of every digest it has signed. If such a record existed, the wallet could have simply ignored the invalidated signature in isValidSignature and verified the digest directly, without needing this EIP at all.
Backward compatibility
Existing wallets that do not implement getAlternativeSignature can still sign messages unchanged. However, if such a wallet's signature becomes invalid, the client will simply discard that signature at step 3 of the procedure (checking response validity).
Standard status
This proposal is currently in Stagnant status, meaning discussion is no longer actively progressing and has paused. The content may change or discussion may resume in the future.
Things to watch out for
- The risk of using a signature as a secret value: Some applications use the signature itself as a secret value. Under this EIP, if a wallet exposes the signature externally, there is a risk that the secret could leak in such applications.