EIP-101 Serenity Currency and Cryptographic Abstraction (Serenity Currency and Crypto Abstraction)
No call decision · Account abstraction · EIP status Stagnant · created 2015-11-15
A 2015 proposal to remove the signature verification, nonce management, and ether balance concepts fixed at the account level, and have account code handle them directly instead.
Why it is needed
Ethereum accounts handle ECDSA signature verification, nonce checking, and ether balances in a fixed way at the protocol level. Because of this, using new cryptographic schemes such as quantum resistant signatures, or applying custom security policies such as multisig, requires routing through an intermediary contract every time. This proposal moves signature verification, nonce incrementing, and ether transfer logic out of the protocol and into account code, and simplifies the transaction structure, so that account security schemes can be changed freely while also making the protocol itself simpler.
What changes
Today
- Accounts have four fields, nonce, balance, code, and storage, and can only use ECDSA signatures
- Ether is stored directly as a balance number on each account object
- The amount of ether sent via msg.value can be read directly with an opcode
- Transactions have many fixed fields: nonce, gasprice, startgas, to, value, data, v/r/s, and so on
After EIP-101
- Accounts have only two fields, code and storage, and the signature scheme is freely defined by the account code
- All ether is held by a single contract at address 0, and account code calls it to send and receive ether
- The msg.value opcode is removed, and ether transfers are handled within code via a cheque mechanism
- Transactions are simplified to four fields: to, startgas, data, and code
Who is affected
- Wallet developers: Signature generation and nonce management logic must be newly implemented to match the standard account code
- Miners: Before including a transaction, the account code must be pre-executed up to a maximum of 50000 gas to verify that the fee will be paid
- Contract developer: Multisig or new signature schemes can be implemented directly in account code, without an intermediary contract
- Client teams: The account model, transaction structure, and ECRECOVER handling logic all need to be redesigned
In depth
Reducing account fields to code and storage only
The nonce and balance fields are removed from the account's RLP encoding, leaving only the code and storage fields. Functions such as signature verification, nonce management, and holding ether are no longer enforced by the protocol and are instead implemented directly by account code. ECRECOVER and nonce incrementing logic are also no longer part of the lowest level protocol spec.
Moving ether to a single contract at address 0
Ether is no longer held by individual account objects but entirely by a premined contract at address 0. The web3 eth.getBalance command is remapped to query this contract. However, the original text notes that ether continues to play a special role under Casper PoS.
Removing msg.value and cheque based transfers
Since the msg.value opcode is removed, calls carrying a value are compiled into three stages: in the outer scope a cheque is created against the ether contract, in the inner scope if the called contract reads msg.value the cheque is cashed and stored at a standard memory address, and after the outer scope call any cheque that has not yet been cashed is voided.
Reducing transaction fields to to, startgas, data, and code
Transactions have only four fields: to, startgas, data, and code. If the receiving account does not exist, a new account is created using the transaction's code; if it already exists, the code field is ignored. Code bytes are charged gas at the same rate as data.
Minimizing transaction validity checks
Only the following are checked: whether the RLP format is valid, whether to is 20 bytes, whether startgas is an integer, and whether code is empty or its hash matches the to address. No other constraints apply. The block gas limit remains in place, so miners who stuff in many useless transactions are penalized.
Adding the tx.gas opcode
In addition to the existing msg.gas opcode (the gas remaining in the current subcall), a tx.gas opcode is added at index 0x5c that refers to the original gas amount allocated at the start of the transaction. Standard account code uses this value to calculate the actual gas used and settle the fee.
Standard account code and the miner's pre-validation procedure
The original text presents a sample of standard account code that performs ECDSA signature and nonce checks. It builds a signature hash, recovers the signer via the ECRECOVER contract, compares it against the stored nonce, increments the nonce, executes the actual call using the remaining gas minus 50000, and finally pays the fee. Miners decide whether to include the transaction by first executing this code up to a maximum of 50000 gas and checking whether 50000 gas remains and whether the fee payment code exactly matches this pattern.
Expected effects and current status
The original text explains that this structure allows free experimentation with signature algorithms (including quantum resistant schemes such as Lamport signatures), nonce techniques, and UTXO style approaches, treats ether at the same level as a subtoken, and simplifies the protocol itself by reducing the indirection steps needed for custom accounts such as multisig. The Implementation section only says "Coming soon," meaning no actual implementation exists, and the current status is Stagnant with no further progress.