ECIP 1080: SELFBALANCE opcode Source

AuthorBob Summerwill
Discussions-Tohttps://github.com/ethereumclassic/ECIPs/issues/266
StatusWithdrawn
TypeStandards Track
CategoryCore
Created2020-01-19

Simple Summary

This is a standalone ECIP for the addition of the SELFBALANCE opcode. This opcode was added to the ETH protocol as part of the broader EIP 1884: Repricing for trie-size-dependent opcodes which was activated in the Instanbul hardfork. The 1884 EIP was rejected during the ETC Core Developers call on 27th November 2019 because it broke backwards compatbility, but in this case the baby was accidentally thrown out with the bathwater.

Abstract

This ECIP is a standalone SELFBALANCE specification, which would be implemented as part of the “Phoenix” hardfork which would either “fix” Aztlán or would replace Aztlán.

The network participants who took part in the ETC Core Developers call on 27th November 2019 were under the impression at the time that the scope we agreed (“Instanbul without the backward-compatibility breaking parts of EIP-1884”) - ECIP-1061 / ECIP-1072 - would move the ETC protocol to a place where it was 100% compatible with the ETH mainnet.

Specification

Thanks to Wei Tang for identifying the mis-specification and for providing his recommendation on how to rectify it.

  • A new opcode, SELFBALANCE is introduced at 0x47.
    • SELFBALANCE pops 0 arguments off the stack,
    • SELFBALANCE pushes the balance of the current address to the stack,
    • SELFBALANCE is priced as GasFastStep, at 5 gas.

Rationale

See EIP 1884: Repricing for trie-size-dependent opcodes for the original rationale for the gas-repricings for ETH.

These changes are sensible, but they broke 680 deployed Aragon smart contracts along with various other deployed smart contacts by applying the repricings retroactively and unconditionally.

This new opcode does not break backwards compatibility. For compatibility with ETH it is both necessary and desirable.

Implementation

The following clients with Ethereum Classic support already implement the SELFBALANCE opcode, but not in this standalone form yet. The work to support standalone would be minimal.

  • Parity Ethereum
  • Multi-Geth
  • Hyperledger Besu

This proposal is licensed under the Apache License, Version 2.0, based on specifications developed by Wei Tang within the Core Paper project (https://corepaper.org/).

Core Paper Copyright 2019-2020 Wei Tang.

Bob Summerwill, the author of this proposal attests that his is the sole author of this specific document based on Wei Tang’s work and that he is able to contribute this work to the ECIP process under the Apache 2.0 licence. He further attests that he neither holds nor is aware of any patents, trademarks, copyright issues or other IP hinderances associated with this work.