🧗 When did Ethereum reach its all time high in mining difficulty?
Every Ethereum node stores the entire state of accounts and smart contract.
When you query any node about the state, for example,
- What is the balance of an ETH account?
- Who owns this NFT?
Every node should provide the same response.
How to achieve that when the nodes are distributed and each has its own copy of the state?
Any state changes are trigged by transactions. To achieve the same shared global state, all nodes must agree to process the same transactions in same order. This is called CONSENSUS.
This is achieved by allowing one of the nodes to propose the next block (of transactions and their order). Every other node verifies and process the transactions in the proposed block to update their state. The block proposer gets a reward for doing so.
Because there is a reward, it is natural for every node to constantly propose blocks.
To avoid every node from flooding the network with their own proposals and to ensure every node agrees on the same block, Ethereum used a mechanism called PROOF OF WORK (PoW).
In PoW, each node processes the pending transactions, organizes them into a block, and then follows the process outlined below to propose their block.
- Calculate the hash of their block and a random number (aka nonce).
- If the resulting hash is less than a specific value (aka target), they can propose their block.
- If not, they change the nonce and repeat the process described above until they meet the condition or someone claims to have solved it.
Node 1 solved the mining puzzle.
If some other node claims to solve it, phew! 😤 their effort has gone to waste. They verify and add the newly received block to the blockchain and start the process all over again to find the next block. This process of solving puzzles to propose blocks is called MINING.
Since this is a trial-and-error approach, the node that can compute the hashes quickly is more likely to solve the puzzle first. As a result, miners invest in powerful hardware that consumes a lot of electricity.
On average, it takes ~10-15 seconds for some node in the network to solve the puzzle and propose a block. When more miners join the network, it results in more hash power, and the puzzle can be solved much faster.
The Ethereum network adjusts the difficulty after every block so that the expected time to find the next block is ~10-15 seconds. When more nodes join the network, the difficulty is increased. The difficulty decreases as nodes leave the network.
difficulty is stored in the block header. We can understand mining activity during a specific time period by observing the block difficulty.
🕵️ When did Ethereum reach its all time high in mining difficulty?
SELECT DATE_TRUNC('day', `time`) as day, --1. Take average of difficulty column FROM --2. Read from blocks table GROUP BY day --3. Plot the data in a bar chat to visually observe the mining difficulty
Click here to solve the quest.
💡 Choose your option below 💡