Blockchain

Key Concepts in Blockchain

Key Concepts in Blockchain

Chaining Blocks

As mentioned earlier, the transactions or digital code for every transaction is embedded in a block. These blocks are mined by several mining nodes and chained together. Each block contains information about transactions. To maintain the authenticity of the chain, the hash of a block is added to the code of the next block.  Irrespective of who mines the block, it’s mandatory to include the hash of the previous block. This process of chaining the blocks ensures that the blockchain is secure and immutable. 

 Public Key Cryptography

Public key cryptography is an encryption algorithm that uses a pair of keys for decryption – a public key and a private key. The keys are large prime numbers that are generated in pairs. The private key is created using a secure random number generating utility like ‘ssh-gen’ and the public key is created using the private key. The security aspect of the keys relies on the level of difficulty in solving the mathematical problem associated with the numbers. The greater the difficulty in solving the problem, the harder it is to decode the number.

The private key or secret key is used to encrypt a message and the associated public key is used to decrypt the message.  A unique pair of keys is associated with any transaction that is initiated on the blockchain. The private key is used as a digital signature of the transaction and proves its authenticity. Public key cryptography is used along with digital signatures to keep blockchain transactions secure. 

What is Hashing?

Security is a very important feature of blockchain, and hashing is one of the techniques used to achieve it. Hashing uses a mathematical function that accepts an input and converts it into a unique encrypted output. The output is a fixed-length alphanumeric value that depends on the hash function being used. SHA256, MD5, RIPEMD are some of the hash functions. The output is always the same for a given data but cannot be reversed.  

What is a Merkle Tree?

Every block has hashed data embedded into it. The data on a block is considerable and the total data on a blockchain may exceed three hundred gigabytes. Downloading a blockchain to verify a transaction will require a lot more resources than the process already does. A better solution is provided by the Merkle tree.

A Merkle tree or hash tree is a data structure that stores the data of all the blocks of a blockchain. Every transaction in a block is individually run through a hashing algorithm to generate a hash of each transaction. The first set of hashes is referred to as leaves. Now, two hashes are combined and a new hash is generated for the combination. This process is repeated till a single hash, known as the root, is obtained. All the hashes between the leaves and the root are referred to as branches. The root hash is combined with other important information and run through a hashing algorithm to produce a unique hash for the block. This is stored as a header in the immediate-next block.  

A Merkle tree makes it efficient to verify a particular transaction in a block by using the hashes provided, without downloading the entire blockchain.      

What is a Distributed Ledger?

The above-mentioned form of distributed record-keeping is like a ledger maintained by every stakeholder. The distributed ledger is an immutable database existing on many computers (or nodes) with many people using it. Each node engages in the administration of the database as well as recording, sharing, and synchronizing the transactions in their respective electronic ledger. If an update must be made, the majority of the nodes must verify and agree to it. The strength of blockchain lies in this verification, transaction tracking, data immutability, security, and higher resistance to tampering.

Cost Savings & Efficiency

The distributed ledger eliminates the need for a trusted third party to verify the transactions or ownership of assets. Any record of ownership of assets like money, property, art is managed on these distributed ledgers on a peer-to-peer network. Eliminating the third-party or intermediaries, like a bank, to process transactions also eliminates the charges associated with the intermediaries. This makes the transactions more cost-effective. Since the dependence on the efficiency of designated authorities is removed, the transactions can be done faster.

Accessible & Transparent

The traditional system is based on control of the database by designated authorities. However, in a blockchain, the distributed ledger is accessible and open to participants of a transaction.   

Secure & Immutable

The information in the distributed ledgers is hashed using an SHA-256 mechanism. Each block in the blockchain carries the following information:

  • Index or serial number of the block 
  • A timestamp that denotes the time when the block was created
  • Data and digital signatures from its preceding block.
  • Hash of the previous block – the digital footprint of data
  • Nonce – a random whole number required for hashing a block
  • Hash of the current block

The cryptographic encryption provides an added security feature that restricts hacking and tampering of data – a key to data immutability.