EIPs Explained

EIP-999 · Withdrawn · Core · 2018-04-04

EIP-999: Restore Contract Code at 0x863DF6BFa4469f3ead0bE8f9F2AAE51c91A907b4

Proposed a one-time hard-fork state change to restore the self-destructed Parity WalletLibrary contract and unfreeze the multisig wallets that depended on it; it was Withdrawn.

What problem does it solve?

Parity's multi-signature wallets were deployed as small contracts. To save gas, each one used DELEGATECALL to send its logic to a single shared WalletLibrary contract at 0x863DF6BFa4469f3ead0bE8f9F2AAE51c91A907b4. In November 2017, a user took ownership of the library contract itself, because it had never been initialized, and then called its selfdestruct. The library's code was erased.

Every wallet that depended on the library lost all of its logic, and the Ether and tokens they held became permanently inaccessible. Ethereum had no way to restore a self-destructed contract, and changing that rule in general was judged too risky.

How it works

EIP-999 does not change any EVM rules. It proposes a single, hard-coded state change at a fork block. Constantinople was suggested:

  • Recreate the account at the library address with nonce 1.
  • Give it the code of a patched WalletLibrary with the selfdestruct removed and the library owner initialized to 0x0.
  • Set a handful of storage slots so the library itself is already initialized and cannot be taken over again.
  • Leave the account balance unchanged. No Ether is created or moved.

Two equivalent forms are given:

  • 999a writes the full bytecode directly into the account.
  • 999b copies the code hash of an already deployed, verifiable copy of the patched contract.

Once the library code exists again, every dependent wallet's DELEGATECALL works, and owners can move their funds as usual.

Sample code

The spec's state transition, as pseudocode (bytecode abbreviated):

LIB = "0x863DF6BFa4469f3ead0bE8f9F2AAE51c91A907b4"

if block.number == CNSTNTNPL_FORK_BLKNUM:
    acct = state.get_or_create(LIB)
    acct.nonce = 1
    acct.code = PATCHED_WALLET_LIBRARY_BYTECODE   # 999a (or: set codehash, 999b)
    acct.storage[0x00] = 1
    acct.storage[0x01] = 1
    acct.storage[0x04] = 0x44e1
    acct.storage[0xa5baec7d...ae2d] = 1
    # balance intentionally untouched

Things to know

  • This proposal was Withdrawn and never implemented. An informal coin vote in 2018 showed most participants opposed it, and core developers did not include it in any fork. The funds remain frozen.
  • The debate was about precedent rather than code. Supporters saw it as fixing an obvious bug. Opponents argued that hand-editing state for specific parties would undermine immutability and invite future requests.
  • The underlying lessons were to initialize library and implementation contracts, and to avoid destructible code behind a DELEGATECALL. Upgradeable-proxy patterns adopted those lessons.
  • SELFDESTRUCT has since been sharply restricted. EIP-6049 formally deprecated it, and EIP-6780 (Dencun) limits its effect to contracts created in the same transaction. See also EIP-4758 (Stagnant).

#parity #multisig #hardfork #state-change #withdrawn

Details

Authors
Afri Schoedon (@5chdn)
Status
Withdrawn
Type
Standards Track / Core
Created
2018-04-04

Machine-readable: Markdown · JSON