Block Anatomy of a Blockchain

So far in this article series, we have discussed the Blockchain, its roadmap, and some of its key concepts. Now, we will be diving a little deep into blockchain and breaking down a single unit or a block in the blockchain and learning about it.


This content originally appeared on DEV Community 👩‍💻👨‍💻 and was authored by Siddharth Singh Baghel

So far in this article series, we have discussed the Blockchain, its roadmap, and some of its key concepts. Now, we will be diving a little deep into blockchain and breaking down a single unit or a block in the blockchain and learning about it.

Lets get started gif

Blockchain Structure

  • One can imagine a Blockchain as a linked list. Similar to a Linked List the blocks of a blockchain are connected through something, that something in the linked list is the address of the previous node but in the blockchain, it is the Merkle-Hash value of the previous block, which is stored in the successor block.

Blockchain structure showing hash codes connecting the previous block

  • An obvious question might arise in your mind, how many blocks
    can be present in a blockchain?
    The answer is any number of blocks are possible, as long as the
    maintainers are good with that. You can check this link to see how many blocks of
    some famous blockchains are created to date.

  • Here is an image of Ethereum's block count.

Ethereum block count

Block Structure

  • A block in a blockchain constitutes of two components, Header (which is further divided into six components) and Ledger - the main transaction database. Below is the image to roughly visualize a block in a blockchain.

Block structure of a blockchain showing Block header - Version, Merkel Hash root, previous hash code, bits, timestamp and nonce  and block ledger with few transactions

  • The block structure in the image above does not show all the components of the block's head, but I will be listing all of them in the next section.

Block-Header

The Block-Header is an 80 bytes long string consisting of six components -

  • Version (4 bytes)
  • A hash code of the previous block (32 bytes)
  • The current block's Merkle-Hash code value (32bytes)
  • Timestamp (4 bytes)
  • Bits (4 bytes)
  • Nonce value (4 bytes)

Version - It is as the name is the version number of the protocol used in the chain.

Previous block hash - The block header contains a 256-bit long Merkle Hash code value of the previous block to stay connected with the blockchain. The first block in any blockchain is called a Genesis block - A block that doesn't have any previous block hash.

Merkle Hash value - Merkle hash code value of each block is a combination of all the hashes changed during each transaction in a block. It is a 256 bit long Hash code which acts as an identity or name for a block.

Timestamp - Each block contains a Unix time timestamp. In addition to serving as a source of variation for the block hash, they also make it more difficult for an adversary to manipulate the block chain.

Bits - Bits can be understood as a level of difficulty assigned to the miners for the process of proof-of-work. Adding a new block in a blockchain is a tremendously difficult task, miners have to solve a very tough mathematical puzzle (not literally a puzzle) in order to add a block. The difficulty of that puzzle is stored in the Bits field.

Nonce - It is that puzzle that miners are trying to solve extensively to get rewarded. Nonce itself is a full article topic so I will not be emphasizing it too much here.

Block Ledger

The Block ledger contains the details of all the transactions stored in a block. A block can store up to 2000 transactions. The maximum size a block can achieve is 1MB, depending upon the number of transactions recorded in a particular block. As long as the chain length increases it becomes impossible to update or manipulate these transactions and this makes the blockchain immutable.

Conclusion

That was all about the block structure of a blockchain, I covered all the components of the block's structure. Hope you like the article. More articles on this series coming every week, so stay tuned.

Writer's Support

  • If you find the article useful show some love ❤️ by following me on linkedin or github or instagram or twitter or everywhere 🤩.

    Image description


This content originally appeared on DEV Community 👩‍💻👨‍💻 and was authored by Siddharth Singh Baghel


Print Share Comment Cite Upload Translate Updates
APA

Siddharth Singh Baghel | Sciencx (2023-01-07T16:26:29+00:00) Block Anatomy of a Blockchain. Retrieved from https://www.scien.cx/2023/01/07/block-anatomy-of-a-blockchain/

MLA
" » Block Anatomy of a Blockchain." Siddharth Singh Baghel | Sciencx - Saturday January 7, 2023, https://www.scien.cx/2023/01/07/block-anatomy-of-a-blockchain/
HARVARD
Siddharth Singh Baghel | Sciencx Saturday January 7, 2023 » Block Anatomy of a Blockchain., viewed ,<https://www.scien.cx/2023/01/07/block-anatomy-of-a-blockchain/>
VANCOUVER
Siddharth Singh Baghel | Sciencx - » Block Anatomy of a Blockchain. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2023/01/07/block-anatomy-of-a-blockchain/
CHICAGO
" » Block Anatomy of a Blockchain." Siddharth Singh Baghel | Sciencx - Accessed . https://www.scien.cx/2023/01/07/block-anatomy-of-a-blockchain/
IEEE
" » Block Anatomy of a Blockchain." Siddharth Singh Baghel | Sciencx [Online]. Available: https://www.scien.cx/2023/01/07/block-anatomy-of-a-blockchain/. [Accessed: ]
rf:citation
» Block Anatomy of a Blockchain | Siddharth Singh Baghel | Sciencx | https://www.scien.cx/2023/01/07/block-anatomy-of-a-blockchain/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.