![code zero zero zero destruct zero code zero zero zero destruct zero](http://cdn-webimages.wimages.net/051c009c208a15509205f171b93fd50efa0625.jpg)
But if we _have_ such a scheme, and it works, then we no longer need to care about giving contracts the ability to delete themselves voluntarily. However, by then it was clear that almost no contract developers were actually using the self-destruct feature: figuring out when to self-destruct is too hard and the rewards are too little.īy 2019-21, it has become clear that we need some other form of state management, whether rent or "expiring" long-untouched parts of the tree (aka "partial statelessness"). In 2015, () to get around this and potentially allow accounts that send away all of their ETH to be safely deleted. However, the addition of nonces removed all hope of EOAs being deleted: the nonce could not be reset to zero. If I had 100 coins and I sent you 10, you could simply republish this transaction on-chain ten times to clear my entire balance. In January 2014, Andrew Miller pointed out something that in retrospect was face-palmingly obvious: in the Dec 2013 spec, EOAs were vulnerable to replay attacks. A gas refund would encourage them to do this.
#Code zero zero zero destruct zero code#
Externally-owned accounts (EOAs), the thinking goes, would automatically be destroyed when their balance drops to zero, and contracts could have a self-destruct clause in the code to delete themselves when they are no longer needed. However, there was (in my head) a general impression that to prevent state from filling up with vestigial garbage without limit, we need it to be possible for any object that can be created to be destroyed. At the time, there was little rigorous thought being done about long-term state size management. `SELFDESTRUCT` (originally called `SUICIDE`) was introduced very early on in Ethereum's history in fact, it was present even in this () from December 2013. # A history: `SELFDESTRUCT` is not necessary To deal with the existing contracts that use `SELFDESTRUCT`, I propose some ways to eliminate the harmful aspects of `SELFDESTRUCT` with minimal disruption. This post describes some reasons why the `SELFDESTRUCT` opcode brings more harm than good to the Ethereum ecosystem, and so should be neutered or removed in some way.
![code zero zero zero destruct zero code zero zero zero destruct zero](https://static.wixstatic.com/media/381e5f_f0df69c7abec4190a7a3a2b5f532ea73~mv2.jpg)
# Pragmatic destruction of `SELFDESTRUCT`