How does Blockchain technology work?

Blockchain has gained popularity recently. It can be relatively difficult to understand in-depth, however, fairly easy to grasp the basics. So, what is Blockchain?

If you want to have a brief introduction, checkout the video below.

What is a Blockchain?

First, it is a database. Initially, it can store arbitrary data, while infamous Bitcoin uses Blockchain as a ledger to store records of financial transactions.

It is also distributed, which means multiple nodes store all the records locally and get frequent data updates simultaneously.

Data representation

Blockchain structure is represented as a chain of blocks. Each block has a header and a payload.

Representation of chain of blocks

Block header

Block header mostly contains meta-information that is used for Blockchain security and integrity. Header contents depend on a certain implementation, however, all the implementations would most likely contain at least the following fields:

  • size (each block header should be of a fixed size)
  • version (this field references a version of the Blockchain)
  • creation time (a time when this block was created)
  • block header hash (ensures integrity of the block)
  • previous block header hash (ensures integrity of the chain by referencing a previous block)
  • hash of the payload (ensures integrity of the payload)

If you want to learn more about hash functions, check out an article about hash functions.

Block payload

Payload can hold any arbitrary data based on what the Blockchain is used for. For example, in Bitcoin payload holds a list of transactions in a form of a ledger (every normal transaction is represented 2 times – as a debit operation and as a credit operation).

Consensus between nodes

We now know that Blockchain is a chain of blocks and how each block looks like. However, what about block creation? And how are new blocks added to the chain? Essentially, one or multiple nodes can come up with a new block, by forming its header and payload, and send it over the network. Other nodes should verify this block and, in case if verification succeeds, the block is added to the chain. This requires some cooperation between the nodes.

Blockchain is a decentralized system – there is no single point of regulation or control. Instead, multiple nodes act as regulators. In such systems, there should be a strict work protocol that all the participants adhere to so that the system can function properly. In Blockchain words, they should reach a consensus. There can be multiple different consensus approaches. The most popular ones are:

  • Proof of Work (used in Bitcoin)
  • Proof of Stake (used in Ethereum)

Proof of Work

In ‘Proof of Work’ approach a node should perform some work, usually some heavy computations, to prove its involvement in the process. In the case of Bitcoin, a node tries to come up with a value that meets certain requirements and is lower than the value supplied by the network (target value). Bitcoin adjusts computation complexity, by lowering or raising target value, to have predictable computation speed. In the case of Bitcoin, it takes a lot of effort and only big clusters of computers can perform such operations.

Proof of Stake

‘Proof of Stake’ approach was created to address performance issues of ‘Proof of Work’ approach. Instead of performing heavy computations, a node can verify the percentage of data that is proportionate to the percentage of coins it holds. So, nodes with bigger stakes can do more verifications and vice versa. This also means that nodes with bigger stakes would have more influence on the network in general, which sort of makes sense because they also have bigger interest in ensuring that the network functions properly.

Transparency

Any blockchain can be either private (permissioned) or public (permissionless).

Public chains

Public blockchains are available to everyone and anyone can obtain the latest copy of data (chain of blocks). This also means that all the data in the block is publicly available. While this is great for storing open data like food and minerals supply chain, it is not very useful for financial data of private entities. Such cases can be addressed by adding some anonymity to the data. For example, in Bitcoin all transactions are open, however, transaction participants are anonymous. They are represented by digital wallets that can’t easily be traced to certain people or organizations.

Private chains

Private blockchains require permission to access data. There can exist different levels of permissions that would apply to different parts of data. A good example would be if a person (or an entity) added some data to the blockchain and can grant permissions to legal entities to use parts of the data.

Conclusion

In this article we looked at what Blockchain is and how it is designed. Please, note that a lot of resources use Bitcoin and Blockchain terms interchangeably which is incorrect. While Bitcoin is base on one form of the Blockchain, Blockchain itself can have much more different implementations and applications in the real world.

0