Block? chain

Block? chain

Table of contents

It is very easy to mumble the many seemingly abstract terms that are found in the blockchain without properly understanding them.

Personally, it took a while to realize that the chain referred to in blockchain refers not to actual chains as seen in the many images associated with the Blockchain but the string of numbers found on each block.

But hey, let's not get ahead of ourselves. Let's attempt at understanding what a block in the Blockchain is.

What is a block?

A block is a collection of data.
Transactions in the blockchain are stored in blocks.
real bkks.png Generally, blocks in the blockchain, comprises the following:

a. Block Number
Blocks in the blockchain are numbered sequentially from the first block -the genesis block, up to as much blocks that can be obtainable.
Screenshot (922).png Although this snippet from etherscan does not capture from the first block, it evidences the sequential arrangement of blocks, 15524389 - 15524393 which is the latest block.

b. Nonce
Nonce basically means - number used once.
It is a number added to an encrypted block in a blockchain such that when it is successfully gotten, the miners are able to decipher the hash of a block and get the reward for mining that block.

c. The hash
Blockchain uses a mechanism for protecting the data stored in it. One of the forms of protection it uses is known as hashing.

Hashing is a form of protection that converts information/data into characters of a fixed size. These characters are usually letters and numbers, generally referred to as a string and technically known as, the hash.

Hashing offers a one way protection- as though the information/data can be converted into an hash, the hash cannot be made to reproduce the information.
Also, any change in a hashed file, will occasion a change in its hash as well.

The Bitcoin blockchain uses the Secure Hashing Algorithm 256 -SHA256.
It is called SHA256 because it has a 256-bits length which produces a 32-byte hash.

A block on the blockchain contains its hash and the hash of the previous block.
Each subsequent hash is tied to the previous hash, thus ensuring the consistency of all blocks.
This also makes keeping track of a transaction easier because one can trace the hash.

This is where the blockchain derives it name from, multiple blocks linked together (by its hashes)to form a chain.

However, one question readily comes to mind:

If each block contains the hash of its previous block, which hash would the first block contain- considering there's no block before it and therefore no inputs to be converted to a hash?

This answer is better illustrated.

Ethereum Blocks #0 _ Etherscan,.._page-0001.jpg

This snippet from etherscan illustrates that the first block would have nothing as its previous/parent hash. Hence, the zeroes.

d. Transaction data
Earlier, we had stated that the blockchain is a ledger used to store information.
A block contains the details of all the transactions that are stored on that block. Bitcoin's blocksize is limited to 1MB although this can contain a large number of transactions.

In conclusion, we have been able to touch on the following:

  • Block
  • Block number
  • Nonce
  • Hash
  • Transactional data