Interpretation of the four EIPs that will be activated in the Ethereum Shanghai upgrade

Fourteen Lords
2022-11-05 20:04:13
Collection
Let's dive deep with the Fourteen Lords to understand the role, principles, and application directions of those EIP proposals that are about to activate on the mainnet.

Author: Shisi Jun, Shisi Jun

Another major update is coming after the Ethereum Paris upgrade (the Merge, consensus transition to POS) ------ the Shanghai upgrade! Currently, the Ethereum core community has thousands of professional developers and has experienced 15 mainnet upgrades since 2015. This Shanghai upgrade will provide unlocking capabilities for the $23 billion worth of POS-staked ETH locked on-chain, along with the integration of many EIPs for GAS optimization.

Join Shisi Jun to delve into the roles, principles, and application directions of the EIP proposals that will soon be activated on the mainnet.

image

This article is 2300 words long and takes 5 minutes to read.

1. Background

1.1 Mainnet Upgrades

Ethereum proposed four major phases in 2015: Frontier, Homestead, Metropolis, and Serenity. It is well known that the "Serenity" phase is marked by the transition of Ethereum's consensus algorithm from POW mining to POS staking two months ago. Today, it is the leading public chain that is energy-efficient, secure, and sufficiently decentralized.

Each mainnet upgrade is named after a city, such as Berlin, Paris, and Shanghai, and historically, many mainnet upgrades have brought about significant changes.

1.2 Review of August 5, 2021 - London Upgrade

At block height 12,965,000, Ethereum completed the hard fork upgrade codenamed "London," which involved five proposals.

The most influential was the launch of EIP-1559, proposed by Ethereum founder Vitalik Buterin. From then on, every transaction on Ethereum would burn the base gas fee, automatically reducing the circulating supply of ETH, marking the beginning of the deflationary era for Ethereum tokens.
For example:

EIP-1559 changed the logic of gas fee calculation from "first come, first served." Previously, users had to pay higher miner fees to ensure their transactions were packaged promptly, leading to potentially unlimited increases in gas fees.
After the upgrade, transaction fees were divided into a base fee and a tip. The tip incentivizes miners to compete for block inclusion, while the base fee is burned. Although there is still a bidding component for block inclusion, miner revenue decreased by about 20%, and the economic model shifted to a deflationary one.

Essentially, the design of EIP-1559 leveraged the advantages of a second-price auction model, resulting in all transactions within the same block paying a similar price, making it fairer for users (as transactions paying the base price are always included, distinguishing between urgent and regular transaction needs).

2. Shanghai Upgrade

Why the Urgency?

In the past, it was common to have major upgrades once every year or two. Significant upgrades like the Merge would typically undergo 1-2 years of stable testnet operation before transitioning to the mainnet. So why is the Shanghai upgrade so urgent? Why are the EIPs to be included basically finalized just two months later?

The core reason is that after the Merge, all transactions on the Ethereum network will no longer be validated by energy-intensive "miners," but by individuals and organizations that have deposited or staked large amounts of ETH as "validators." For validators, their staked ETH can generate and collect new ETH, which serves as their reward for validating transactions and protecting the network.

However, currently, Ethereum only allows ETH to be deposited but not withdrawn, with a total staked value of nearly $23.5 billion "trapped" in the Ethereum network.

If the withdrawal feature is not opened up soon, the attractiveness of staking ETH will significantly diminish, and fewer people will enter the Ethereum network, which will undoubtedly have a huge impact on Ethereum's future development and network security.

3. Detailed Interpretation

image

According to the latest GitHub submission on October 28, the Shanghai Upgrade Record

3.1 EIP-3651: Warmer COINBASE

What is it?

The translation of this title can indeed be confusing. Here, COINBASE does not refer to the exchange company but to a concept from Bitcoin, where the first transaction in a block is a special transaction called a coinbase transaction, originally designed for miners to collect gas tip income from mining.

"Warmer" and "colder" refer to whether this transaction is executed with preloaded data, affecting the gas fee for miners packaging the coinbase transaction.

If there is no preloaded data, it is "colder," resulting in higher gas fees.
If there is preloaded data, it is "warmer," resulting in lower gas fees.

What is its use?

Currently, transactions packaged by miners may be used for more purposes, such as in ERC-4337 for collecting user signatures and executing transactions in bulk. Additionally, similar principles can be applied to implement various token combination logic for meta-transaction payments.

Before EIP-3651, there was a greater incentive to use ETH for payments.

After EIP-3651, there is a greater incentive to use ERC20 for payments.

In summary, it is a proposal that affects the incentive structure of transaction types.

3.2 EIP-3855: New PUSH0 Instruction

What is it?

In the EVM (Ethereum Virtual Machine), which executes contract code, there are various instructions, but previously there was no instruction designed to push the value 0 onto the stack. This EIP introduces the PUSH0 (0x5f) instruction, which pushes the constant value 0 onto the stack, requiring 2 gas.

What is its use?

The absence of PUSH0 led to some operations relying on 0 as an offset, such as remote calls and returns, where many parameters were 0. Previously, to operate on 0, one had to use the instruction PUSH1 0 (which pushes a number, 0), consuming 3 gas. Additionally, PUSH1 and 0 each occupy a byte of initialization code storage, resulting in a deployment cost increase of 2*200 gas.

This EIP also calculated the gas loss incurred: in existing accounts, 340,557,331 bytes were wasted on PUSH1 00 instructions, meaning deployment losses reached 68,111,466,200 gas.

In summary, it is a proposal to reduce meaningless gas consumption.

3.3 EIP-3860: Increase Initialization Code Size Limit

What is it?

When deploying contracts, there is a limit on the size of the initialization code, which is restricted to 24,576 bytes based on EIP-170. Now, the maximum size limit for initcode has been doubled to 49,152 bytes, with an additional gas cost of 2 applied for every 32 bytes of initcode.

What is its use?

Clearly, a larger code capacity allows the smart contract system to do more. The current 24kb code size makes it difficult to implement a system with a single contract. The previous temporary solution involved deploying multiple contracts that called each other, but cross-contract references are inherently high gas cost operations.

In summary, it is a proposal to increase the upper limit of the smart contract system and reduce gas consumption.

3.4 EIP-4895: Beacon Chain Withdrawals as an Operation

What is it?

This can be said to be the core of the Shanghai upgrade. Essentially, it implements the withdrawal operation for staked ETH, introducing a system-level instruction called withdrawal based on the information from the Beacon Chain (consensus layer), which directly controls the ETH balance of a specified address unconditionally.

There are many ways to execute withdrawal operations, and the characteristics of this withdrawal operation are as follows:

It is initiated by the system rather than by a specific user, making it simpler and easier to audit.

There is no gas cost; the system initiation is controlled by the withdrawal limits of the consensus layer, eliminating the need for gas to perform anti-DDoS protection.
It directly updates the balance of the execution layer without an EVM execution process, adopting the simplest implementation strategy.

What is its use?

Don't forget that there are still 14 million ETH, worth a total of $23.5 billion, "trapped" in the Ethereum Beacon Chain.

4. What is the Focus of Ethereum Moving Forward?

The following image is the latest roadmap released by Ethereum founder Vitalik Buterin. The green parts of the image represent the progress made. It can be seen that there are still many goals related to performance, security vulnerabilities, privacy, and account systems (based on 4337) that have found implementation paths.
image

image

Appendix

https://www.youtube.com/watch?v=CcL9RJBljUs\&t=336s

https://docs.google.com/presentation/d/1N6aX-GE-kus73vlq-v7D-z2iwUI4N4ss1tiPamfoTi4/edit#slide=id.g1231e3828e8089

https://twitter.com/EthereumCN/status/1588825937629835265

ChainCatcher reminds readers to view blockchain rationally, enhance risk awareness, and be cautious of various virtual token issuances and speculations. All content on this site is solely market information or related party opinions, and does not constitute any form of investment advice. If you find sensitive information in the content, please click "Report", and we will handle it promptly.
ChainCatcher Building the Web3 world with innovators