Understanding Ethereum’s Mean-Past-Time Average: Why 11 Blocks Instead of 12?
Ethereum, a decentralized blockchain platform, has been around since April 2014. One of the key features that sets it apart from other cryptocurrencies is its ability to calculate and display the mean-past-time average (MPTA) for block timestamps. While this may seem like a simple concept, there are reasons behind the choice to use the last 11 blocks instead of the last 12.
Background of BIP-113
In 2016, Ethereum developers introduced a proposal that would allow the platform to calculate and display MPTA. This was done by introducing the mean-past-time average (MPTA) function in the Ethereum smart contract, which uses timestamps from the last 11 blocks as input for its calculation.
Why not use the last 12 blocks?
So, why does Ethereum choose to use the last 11 blocks instead of the last 12? The answer lies in the specifics of BIP-113. According to the proposal, the MPTA function uses the timestamps of the last 11 blocks as input for its calculation. This is because the goal of the MPTA calculation is to determine the “median” past time, which specifies the midpoint between two consecutive timestamp ranges.
To achieve this, the Ethereum implementation ensures that the MPTA function takes into account the difference in timestamp lengths between the last 11 and the last 12 blocks. By using the last 11 blocks, the calculation effectively averages the timestamps from both ranges, resulting in a single value that represents the median past time.
Result: One hour offset
By doing so, Ethereum is able to calculate MPTA for block timestamps that are too short to display accurately. Using the last 11 blocks allows the platform to provide a more accurate representation of average past time without having to wait for an additional block.
Conclusion
Ultimately, the choice to use the last 11 blocks instead of the last 12 blocks is due to the specifics of BIP-113 and the requirements for calculating MPTA. Using the last 11 blocks allows Ethereum to provide a more accurate representation of average past time without having to wait for an additional block. This feature has been a cornerstone of Ethereum’s operation since its launch in April 2014.
Further reading:
- For more information on BIP-113 and Ethereum’s implementation of MPTA, please see the Ethereum white paper.
- In addition, you can find detailed explanations of MPTA calculation in various online forums and communities dedicated to Ethereum development.