EIP-867 Standard Ethereum Recovery Proposal (ERP) format (Standardized Ethereum Recovery Proposals)
No call decision · Other · EIP status Stagnant · created 2018-02-02
This is a meta EIP that specifies that recovery proposals (ERPs) for reverting lost or misdirected ether be written in a standard format. It does not address whether any specific proposal is adopted or make any actual state change.
Why it is needed
On Ethereum, incidents where funds are sent to the wrong address or lost occur from time to time. However, recovery proposals for reverting such incidents have no fixed format, so authors write them differently and evaluation criteria are unclear, which makes debates easily devolve into subjective arguments. As a result, recovery proposals have almost never been approved. This EIP aims to standardize the documentation items a recovery proposal (ERP) must include, a machine-readable verification script, and a state change object format, so that proposal content can be objectively verified and clients can apply it consistently.
What changes
Today
- Fund recovery proposals are written differently by each author with no fixed format
- There is no objective standard for judging a proposal's validity, so debates become subjective
- There is a risk that clients implement recovery actions differently
After EIP-867
- Every ERP includes a Summary, Detailed Description, Justification, Verification Script, and State Change Object
- The verification script produces, in a machine-reproducible form, the recovery target and amount
- Clients read the State Change Object (SCO) file and apply it identically at the specified block
Who is affected
- Victims of lost funds and proposal authors: An ERP must be written in the standard format with justification and a verification script to be considered for approval review.
- Client development teams: Implementation burden is reduced since clients only need to read the SCO file in the designated directory and apply the fixed actions, such as weiTransfer or storeCode, at the targetBlock.
- Validators and miners: A block to which an ERP has been applied contains extra data holding the erpId, and the header of a block received from a peer must be verified to contain this.
- Ordinary users: This EIP itself does not move any funds; actual state changes occur only when an individual recovery proposal is separately reviewed and approved.
In depth
The scope the ERP covers
This EIP addresses the problem of reverting lost or misdirected funds, specifically cases where the directly affected parties have no disagreement about the outcome. Existing recovery proposals have been written ad hoc and evaluated subjectively, so they have almost never been approved. This EIP does not support or oppose any particular recovery proposal, and its adoption itself does not change blockchain state. Its purpose is to establish a standard format and client implementation guidelines that subsequent ERPs should follow.
ERP document components
Each ERP must include a Preamble (EIP number, title of 44 characters or fewer, authors' real names), a Simple Summary (for non-experts), a Detailed description (the proposed action and selection criteria), a Justification, a Verification script, a State Change Object (the verification script's output), and optionally an Appendix (supporting evidence). An ERP that fails to meet even these minimum items is not considered for approval review.
Criteria for judging Justification
The justification must concisely show that the action cannot be resolved without an abnormal state change and that the directly affected parties are unlikely to object. The original text gives three examples. A sufficient example presents concrete evidence such as the incident's course of events, the block range, transaction history, and the parties' official announcements. An insufficient example requests a refund by presenting only an address with no evidence, and an unacceptable example is one like a service dispute where the parties' claims conflict and no objective judgment can be made.
Verification script requirements
The verification script must be a javascript file that can use web3.js, written as concisely as possible so reviewers can easily audit it. It must not require an unlocked Ethereum wallet, and it must hard-code the highest block number considered at execution time so results do not vary between runs. The script's output is a single State Change Object, and clients must not manually process this output or use it merely as a reference for writing code; they must bundle it directly into the client and process it at the designated block as is.
State Change Object format
An SCO is a single JSON object with the fields erpId (an identifying string for the ERP, e.g. EIP-1234, converted from ascii to hex and placed in the target block's extra data), targetBlock (the block at which to apply the state change), actions (an array of State Change Actions), metadata.sourceBlock (the highest block considered when the script was run), and metadata.version (the verification script's version).
Two kinds of State Change Action
weiTransfer moves ether from one address to another using the fields type, fromAddress, toAddress, and value (in wei, an integer greater than 0). storeCode stores code at a specific address using the fields type, toAddress, expectedCodeHash (the hash of the code that must already exist at toAddress, or an empty string if there should be no code), and code (the new bytecode to store). For both actions, toAddress must always be a valid address and cannot be 0x0.
Client implementation guidelines
At process startup, the client scans the SCO files in the designated directory and builds a mapping (erpsByTargetBlock) from targetBlock to filename. When starting to process a new block, if there is an ERP corresponding to the current block, applyRecoveryActions is called, and these actions are applied as a single batch in the order stored in the SCO file; if any one fails, the whole batch fails. It must guarantee that no account can transfer more than its current balance, and affected blocks must include extra data containing the erpId converted to hex; if the block was received from a peer, this header must be verified to be present. Each ERP is linked via a PR that adds a single SCO file per client repository.
Scope limitations and current status
This EIP states that it does not address which recovery proposals should actually be accepted, or how to organize a collective ERP representing multiple victims. The current status is Stagnant. There is no discussion or fork-inclusion decision related to this proposal in the core developer call records.