EIP-101 · Stagnant · Core · 2015-11-15
EIP-101: Serenity Currency and Crypto Abstraction
An early 'Serenity' idea to strip ether and signature checks out of the base protocol and let every account define its own validation code, an ancestor of today's account abstraction work.
What problem does it solve?
In Ethereum, every account is protected by the same thing: an ECDSA signature over secp256k1, plus a nonce that must go up by exactly one. Ether also has a special place in the protocol, stored directly in each account. That makes the core protocol more complex, and it locks users into one signature scheme and one replay-protection model.
EIP-101, written by Vitalik Buterin in 2015 for the planned "Serenity" upgrade, asks: what if the protocol did not know about signatures, nonces or even ether at all? Each account could choose its own cryptography (for example Lamport signatures for quantum resistance), multisig would become native, and ether could be handled like any other token.
How it works
The proposal makes the base layer much smaller:
- Accounts have only two fields: code and storage. No balance, no nonce.
- All ether lives in a special contract at address
0.getBalanceis remapped to query it, and themsg.valueopcode disappears. - A transaction has only four fields:
to,startgas,dataandcode. Apart from basic format checks, there are no validity rules; "anything goes". - If
todoes not exist yet, it is created with the suppliedcode, which must hash to thetoaddress. - A new
tx.gasopcode lets code see the gas originally given to the transaction.
Signature and nonce checks move into each account's own code. The spec gives a standard "user account" contract that verifies an ECDSA signature, checks and increments a sequence number, makes the requested call, and pays the miner for gas.
To protect miners, they run a transaction's code for at most 50,000 gas. Then they check that the gas-payment code at the end exactly matches the standard pattern. Sending value becomes a "cheque" flow through the ether contract.
Sample code
Illustrative pseudocode of the standard account logic described in the spec:
# data layout: v | r | s | seq | gasprice | to | calldata
def account_main(data):
h = sha3(data[96:]) # what was signed
signer = ecrecover(h, data.v, data.r, data.s)
assert signer == OWNER # signature check (could be any scheme)
assert data.seq == storage[-1] # replay protection
storage[-1] += 1
call(gas=msg.gas - 50000, to=data.to, input=data.calldata)
# fixed, pattern-matched epilogue: pay the miner
ether_contract.send(block.coinbase, data.gasprice * (tx.gas - msg.gas + 50000))
Things to know
- This proposal is Stagnant and was never adopted. Ethereum still has native ether balances, nonces and ECDSA-signed transactions.
- The ideas lived on. EIP-86 and EIP-2938 took later protocol-level steps toward account abstraction (neither shipped). ERC-4337 achieves much of it without a protocol change, and EIP-7702 lets ordinary accounts run code.
- The "pattern-match the gas payment" rule shows the hard part of abstraction: miners or builders must know a transaction will pay before doing much work. Every later design has to solve this problem too.