Blockchain 101: All you need to get started with your crypto journey

A blockchain is a distributed database that is used to maintain a continuously growing list of records called blocks. But what does this mean? Consider a decentralized database that is managed by multiple participants, this can also be called as Distributed Ledger. Blockchain is a type of Distributed Ledger, containing blocks of transactions. These transactions are recorded with an immutable cryptographic signature called a hash. Not all distributed ledgers apply this concept of sequence of blocks being connected via cryptographic signatures. Blockchain is a type of distributed ledger designed to record transactions digitally without the need for third-party interference.

What is the need for blockchain technology?

How is blockchain secure and immutable?

To understand why blockchain is immutable, let’s look at the structure of a blockchain and how transactions occur:

Structure: Every block in a blockchain contains the following details

  1. Previous hash: This contains the cryptographic hash of the previous block in the blockchain
  2. TimeStamp: This contains the timestamp of when the block was added to the chain
  3. Hash: The cryptographic hash of the current transaction
  4. Data: The actual data stored on the block (Note that this data is public)
  5. Nonce: How many iterations occurred before finding a valid block (More on this later)

How does a transaction occur?:

  1. Now we know that, when a new block is added, the following data is added: index, previous hash, timestamp, data, hash and nonce. Except for the hash and the nonce, the rest of the data is fixed. Let us see how these values are calculated.

Calculation of hash:

But what makes the hash valid in a given blockchain? In any given blockchain, there is a set agreement that the hash must contain a given number of preceding zeros. For example: 0000132243352353523535 has 4 preceding zeros.

While all the other data is fixed, finding the perfect nonce to match these criteria is an important step in the blockchain. A given block is valid only if the hash containing the given number of preceding zeros can be generated using the nonce and the rest of the data. Also, as the number of 0's increases, the number of possible valid hashes for the given data decreases, and hence the complexity increases.

This is also called as block mining, and the procedure implemented to mine a block is called the Proof of work system

How does this make blockchain immutable?

  1. Block A has the previous hash 0, a nonce and a unique hash having four 0s
  2. Block B has previous hash equal to block A's hash, Block B has its own hash generated using the previous hash (block A's hash) and unique nonce.
  3. Block C has previous hash equal to block B's hash, Block C also has its own hash generated using the previous hash (block B's hash) and unique nonce.

Let’s say, someone, tampers with the data in block A:

  1. The hash in block A becomes invalid for the given nonce because the data changed.
  2. The hash in block B also becomes invalid because its previous hash (block A’s hash) changed.
  3. The hash in block C also becomes invalid and so on.

The only way to successfully mutate one block is to mine the block again and every block after the given block. The blockchain is distributed and the new blocks keep getting added all the time. Because of this, it is impossible to mutate blockchain.

Types of blockchain

  1. Public blockchain: The ledger is not owned by anyone. There is no consent required to mine the blocks. Anyone in the world can participate and maintain the blockchain.
  2. Private blockchain: Only the trusted parties can take part in the transactions occurring in the blockchain.

What does native currency mean?

What are Smart Contracts?

What is tokenization?

While this article has mainly talked about blockchain technology and has closely associated it with cryptocurrencies, and financial transactions, those are not its only uses. Blockchain is used in the field of networking, trustless authentication, supply-chain management, and many other fields, sky is the limit :)