Reader small image

You're reading from  Solidity Programming Essentials. - Second Edition

Product typeBook
Published inJun 2022
PublisherPackt
ISBN-139781803231181
Edition2nd Edition
Concepts
Right arrow
Author (1)
Ritesh Modi
Ritesh Modi
author image
Ritesh Modi

Ritesh Modi is a technologist with more than 18 years of experience. He holds a master's degree in science in AI/ML from LJMU. He has been recognized as a Microsoft Regional Director for his contributions to building tech communities, products, and services. He has published more than 10 tech books in the past and is a cloud architect, speaker, and leader who is popular for his contributions to data centers, Azure, Kubernetes, blockchain, cognitive services, DevOps, AI, and automation.
Read more about Ritesh Modi

Right arrow

Blocks

Blocks are an important concept in Ethereum. They are containers for a transaction. A block contains multiple transactions. Each block has a different number of transactions based on the gas limit and block size. The gas limit will be explained in detail in later sections. The blocks are chained together to form a blockchain. Each block has a parent block, and it stores the hash of the parent block in its header. Only the first block, known as the genesis block, does not have a parent.

A typical block in Ethereum is shown in the following screenshot:

Figure 1.12 – A typical block in Ethereum

Figure 1.12 – A typical block in Ethereum

There are a lot of properties associated with a block, providing insights and metadata about it, and the following are some of the important properties along with their descriptions:

  • The difficulty property determines the complexity of the puzzle/challenge given to miners for this block.
  • The gasLimit property determines the maximum gas allowed. This helps in determining how many transactions can be part of the block.
  • The gasUsed property refers to the actual gas used for this block for executing all transactions in it.
  • The hash property refers to the hash of the block.
  • The nonce property refers to the number that helps in solving the challenge.
  • The miner property is the account identifier of the miner, also known as coinbase or etherbase.
  • The number property is the sequential number of this block on the chain.
  • The parentHash property refers to the parent block's hash.
  • The receiptsRoot, stateRoot, and transactionsRoot properties refer to the Merkle trees discussed during the mining process.
  • The transactions property refers to an array of transactions that are part of this block.
  • The totalDifficulty property refers to the total difficulty of the chain.
Previous PageNext Page
You have been reading a chapter from
Solidity Programming Essentials. - Second Edition
Published in: Jun 2022Publisher: PacktISBN-13: 9781803231181
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Ritesh Modi

Ritesh Modi is a technologist with more than 18 years of experience. He holds a master's degree in science in AI/ML from LJMU. He has been recognized as a Microsoft Regional Director for his contributions to building tech communities, products, and services. He has published more than 10 tech books in the past and is a cloud architect, speaker, and leader who is popular for his contributions to data centers, Azure, Kubernetes, blockchain, cognitive services, DevOps, AI, and automation.
Read more about Ritesh Modi