Most of us wonder how the data being stored in Blockchain, we covered that in our last few blog series where we talk about Merkle tree, Patricia Tree and Merkle Patricia tree.
Before I understand block structure , Do I need to know anything else ?
Yes, you need to be aware about different types of Trees (tries) and you can read below articles to get understanding about that tries.
Can I know what is Block in Blockchain ?
Blockchain is combination of two words. Block and Chain so it is chain of blocks where blocks are tie together.
Block are used in Blockchain to store mainly transnational data along with other meta data information.
How block look like in Blockchain ?
Every Blockchain platform maintain it's own block structure, you can go over below link to understand that block structure in Bitcoin and we will make you aware about Block structure in Ethereum.
It mainly consist of two parts as shown below.
- Block Header
Block Structure in Ethereum Blockchain
Let's understand Ethereum Blockchain block structure and see how it is different from Bitcoin block structure. We will talk about mainly block header.
Ethereum Block Structure contains below items as shown in below diagram. Note that this does not cover each and every item but cover majority of it.
Previous Block Hash
Immutable is one of the main feature of Blockchain, that means once information added to Blockchain, it is impossible to change the information. This is achieved in Blockchain with "pointer to previous block hash" section in the block. Here reference to previous block is added to current block and that is similar to link list concept.
Transaction Root Hash
Blockchain block contains n number of transaction but block header include only root node hash of all the transactions that are there in that block.
Receipt Root Hash
Ethereum generate receipt for each and every transaction and that receipts store in form of Trie so this is root hash of that trie.
State Root Hash
State play very important role in Ethereum. It is key value pair where key is account address and value is account balance and other parameters for that account. It is stored in Ethereum Trie and this is root hash for that.
Timestamp is the epoch Unix time of the time of block initialization.
This is difficulty level set in the block to mine it. This change during mining if block mining taking time or less time. More the difficulty, more tough for miner to mine the block.
In short, it is integer value that miner use when they perform mining to generate required hash.
This is the gas limit set for that block.
It is sum of all the gas used by all of the transactions in that block.
Extra data related to the block.
Count of current block, it start from 0. O is for Gensis block which is very first block in the Blockchain.
Can you show me any live example ?
Below is the example of Block from Ether scan. Note that Ether Scan does not show all the parameters as you don't see state root hash, receipt root hash below.