Under the Block Of Ethereum

Blocks in Ethereum

All the transactions are grouped together to create a block and such block is chained together to create a blockchain.

In Ethereum, a block consists of

  • a block header
  • List of Transactions
  • List of Ommers

block img.png

What the hack are Ommers

When two blocks are created simultaneously by a network, only one block will be added to the blockchain, when this happens the leftover block is called an ommer block. they were used to called the uncle blocks, but the community decided the name should be not gender-specific.

it's essential to ensure that data within the blockchain is verified and added by consensus also equally important to keep the data from being changed. To ensure this blockchain uses a data structure known as the Merkle tree to be more specific Ethereum uses the modified version Markle Patricia tree.

ommers block was, in essence, bugs in the code - unintended and accidental byproduct of the mining process. however, Ethereum community decided to keep the ommer block for several reasons :

  • by creating the ommer blocks the network speeds up
  • To decrease the centralization of incentives for larger mining pools. these pools community claim the majority of the cryptocurrency rewards, leaving little for individual miner -

blocl1.png

here -- from block B two-block were generated and only one is chosen to the add-in the blockchain which is block c and Block c2 Becomes the ommer block

Block Header

here is the list of things a block header consists

image.png

  • ParentHash: a hash of the parent block's header.
  • ommersHash: a hash of the current block's list of ommers.
  • beneficiary: the account address that receives the fee for mining this block.
  • stateRoot: is a hash of state trie's root node.
  • transactionRoot: the keccak 256-bit hash of the root node of the transaction trie's root node
  • receiptsRoot: the hash of the root node of the trie that contains the receipts of all transactions listed in this block.
  • logsBloom: a Bloom filter(data structure) that consists of log information.
  • difficulty: difficulty level of this block, this means how hard it was to mine this block
  • number: the number of the block or height of the block. the first block (genesis block ) has the number zero
  • gasLimit:the current gas limit per block.
  • gasUsed: the sum of the total gas used by the transition in this block.
  • timestamp: the UNIX time when the block was created
  • extraData: any extra data. when a miner is creating the block, it can choose to add anything.
  • mixHash: hash used to verify that a block has been mined properly
  • Nonce: a hash that, when combined with the mixHash, proves that the block has gone through proof-of-work.

Transcations

The block body contains a list of transactions that have been included in this block.

summary-final.png