{"id":"eip-6780","version":1,"language":"en","title":"EIP-6780","hidden":false,"content":"**EIP-6780** is an[ Ethereum Improvement Proposal](https://iq.wiki/wiki/ethereum-improvement-proposal-eip) restricting the functionality of the SELFDESTRUT opcode, which previously allowed contracts to self-destruct and wipe their code and storage. Now, it only functions for contracts created within the same transaction. This ensures a cleaner, more manageable state, enhancing long-term stability and security while still allowing for legitimate use of the function. [\\[2\\]](#cite-id-w0flrtggxp8)[\\[3\\]](#cite-id-5wah0oiplng)  \n  \n$$widget0 [YOUTUBE@VID](s7fm6Zz_G0I)$$  \n  \n# Overview  \n  \nEIP-6780 - \"SELFDESTRUCT only in same transaction\" modifies the functionality of the SELFDESTRUCT opcode in preparation for the Verkle Tree architecture to be used in future [Ethereum](https://iq.wiki/wiki/ethereum) applications. The SELFDESTRUCT opcode is a powerful tool that lets [smart contracts](https://iq.wiki/wiki/smart-contract) delete themselves, sending the remaining funds to a designated address. It’s akin to streamlining Ethereum’s internal housekeeping practices for a smoother-running network.[\\[1\\]](#cite-id-rqxbnl0y4yf)  \n  \nCurrently, Ethereum applications use the [Merkle Tree](https://iq.wiki/wiki/merkle-tree) architecture, and the SELFDESTRUCT opcode can be used to make significant changes to account states, such as deleting code and storage. However, when the Verkle Tree architecture is used in future Ethereum applications, it will not be easy to modify or delete accounts because Verkle Tree architecture stores each account in a different account key that is not connected to the root account.  \nTherefore, EIP-6780 proposes a modification to the functionality of the SELFDESTRUCT opcode. According to EIP-6780, the modified SELFDESTRUCT opcode will no longer have the ability to change or delete accounts when used, and will only be used to transfer ETH to the caller, except in the case where SELFDESTRUCT is called in the same transaction created by a [smart contract](https://iq.wiki/wiki/smart-contract).  \n  \nContracts exist on [mainnet](https://iq.wiki/wiki/mainnet) that currently use SELFDESTRUCT to limit who can initiate a transaction with a contract. By destroying the contract in the same transaction so nobody has a chance to call it.[\\[5\\]](#cite-id-aofvbmdypi)  \n  \n<br>  \n$$widget0 [YOUTUBE@VID](sIr6XX8yR8o)$$  \nWhile EIP-6780 doesn't directly simplify the specification, it significantly improves implementations by:  \n  \n* Limiting storage edits per block: This facilitates the implementation of Verkle trees and eases client development.  \n* Guaranteeing code persistence: This strengthens transaction verification in account abstraction wallets, preventing DoS vulnerabilities.  \n* These new invariants pave the way for further simplification, potentially leading to the complete removal of SELFDESTRUCT in the future.[\\[3\\]](#cite-id-5wah0oiplng)  \n  \n# Authors  \n  \n* Guillaume Ballet  \n* [Vitalik Buterin](https://iq.wiki/wiki/vitalik-buterin)  \n* Dankrad Feist","summary":"EIP-6780 is an Ethereum Improvement Proposal limiting the SELFDESTRUCT opcode's functions to transactions within the same smart contract for enhanced security and stability.","categories":[{"id":"defi","title":"Decentralized Finance"}],"promoted":0,"tags":[{"id":"Ethereum"},{"id":"Glossary"},{"id":"Blockchains"}],"metadata":[{"id":"references","value":"[{\"id\":\"rqxbnl0y4yf\",\"url\":\"https://eips.ethereum.org/EIPS/eip-6780\",\"description\":\"Ethereum Investment Proposals - EIP-6780: SELFDESTRUCT only in same transaction\",\"timestamp\":1712368853387},{\"id\":\"w0flrtggxp8\",\"url\":\"https://www.ccn.com/education/glossary/eip-6780-restrict-selfdestruct/#:~:text=Share%20on,for%20a%20smoother%2Drunning%20network.\",\"description\":\"CCN - EIP-6780 (Restrict SELFDESTRUCT)\",\"timestamp\":1712369779861},{\"id\":\"5wah0oiplng\",\"url\":\"https://www.linkedin.com/posts/david-arnal-garcia_ethereums-purge-simplifying-the-protocol-activity-7180998184289067010-5UO2/\",\"description\":\"LinkedIn - Ethereum's \\\"Purge\\\": Simplifying the Protocol for a Stronger Future\",\"timestamp\":1712370638503},{\"id\":\"1z7182ojju3\",\"url\":\"https://medium.com/@lollipop3labs/eip-6780-selfdestruct-only-in-same-transaction-b2864db1f947\",\"description\":\"Medium - EIP-6780 “SELFDESTRUCT only in same transaction”\",\"timestamp\":1712376461863},{\"id\":\"aofvbmdypi\",\"url\":\"https://ethereum-magicians.org/t/eip-6780-deactivate-selfdestruct-except-where-it-occurs-in-the-same-transaction-in-which-a-contract-was-created/13539\",\"description\":\"ethereum-magicians.org -  EIP-6780\",\"timestamp\":1712382694145}]"},{"id":"website","value":"https://eips.ethereum.org/EIPS/eip-6780"},{"id":"youtube_profile","value":"https://www.youtube.com/watch?v=sIr6XX8yR8o&list=PLZmWIkdMcWY6sdsjqgQQCcnDqw8lE0WWE"},{"id":"reddit_profile","value":"https://www.reddit.com/r/ethereum/comments/16hojha/dencun_eip6780selfdestruct_only_in_the_same/"},{"id":"medium_profile","value":"https://medium.com/@lollipop3labs/eip-6780-selfdestruct-only-in-same-transaction-b2864db1f947"},{"id":"previous_cid","value":"QmSmjdEe7Z8TG3txjA4yMVhAZ3PAWBzMFwphyBavBYQhtk"}],"user":{"id":"0x6753061a4cffbc0A617e57E956A298D88702a94B"},"author":{"id":"0xF8bD29570D276c593125205A714D2623B311D2ce","profile":null},"media":[{"name":"sIr6XX8yR8o","id":"https://www.youtube.com/watch?v=sIr6XX8yR8o","size":"0","type":null,"source":"YOUTUBE"},{"name":"s7fm6Zz_G0I","id":"https://www.youtube.com/watch?v=s7fm6Zz_G0I","size":"0","type":null,"source":"YOUTUBE"}],"views":14,"events":[],"linkedWikis":{"founders":[],"blockchains":[]},"ipfs":"QmSmjdEe7Z8TG3txjA4yMVhAZ3PAWBzMFwphyBavBYQhtk","transactionHash":"0x3abd247036edd819c1f91286c51543d00d83fe54d49765bde70ee3ef6fe667f7","created":"2024-04-06T02:44:40.906Z","updated":"2024-04-07T02:09:06.564Z","images":[{"id":"QmUUHZGSrbkxLXYUrHsqZvzAq9J59oKuVABy31Kgz9cYMt","type":"image/jpeg, image/png"}]}