What is it?¶
Blockchain is a record-keeping technology standing - among the others - behind cryptocurrency network. To understand that better, we can say that blockchain is a specific type of database storing data in blocks which are further chained together. In this case, ‘block’ means a group of information.
But cryptocurrency world is not the only place where blockchain is being used though. It is definitely the most obvious use case these days, but blockchain is also being used with legal contracts, product inventories, and any other place where a trustworthy, secure and fast system may be needed. for example:
personal identity security,
real estate processing platform,
and many more.
Types of blockchain networks¶
Over the years, blockchain has been evolving and new user needs have come up. Depending on how a blockchain is configured, there are several business cases it can fulfill.
In a public blockchain, anyone is free to join and participate in the core activities of the blockchain network. Anyone can read, write, and audit the ongoing activities on the public blockchain network, which helps a public blockchain maintain its self-governed nature. Public blockchains can be fully decentralized, democratized, and its transactions may stay authority-free.
Private blockchain is useful whenever there is a need to verify participants, allow entrance only by authentic and verified invitation, and to decide who can make transactions or authenticate blockchain transactions and changes. The ledger in this solution is a secure database based on cryptographic concepts, though not decentralized since it is closed, only allowed users can look into it. Within a private blockchain only the owner or the operator has the right to override, edit, or delete the necessary entries on the blockchain as required. Also, the consensus mechanism (for more information see ‘How is it secured?’ paragraph) works differently; its execution is dependent on the specific users. Further, mining rights and rewards are decided in advance. This type of blockchain is most commonly used in private business.
Permissioned blockchain is a mixed type of public and private blockchain. It has many customization options. For example, there could be a customized blockchain where anyone could join it but only a certain number of activities would be allowed to be performed by the user. Also known as semi-private, consortium or federated blockchain. The consensus process within this type of network is controlled by a pre-selected set of nodes.
How does it work?¶
Regardless of the type of blockchain network used, there is always a possibility of making transactions. No matter what type of transaction it is, once it is made it gets recorded and its authenticity must be verified by the blockchain network. This is done by computers within the blockchain that confirm that the details of the purchase are correct. After successful validation, a transaction is added to a blockchain block. A block has a defined capacity and whenever it fills up, it gets closed and chained to the previous block. We can compare that to actually building a chain: whenever an eye of the chain reaches expected size and shape, gets closed and is no longer able to change. In this way, every entry and all information is permanently saved to the block and stored. Consequently, we can build a transparent database and do not have to worry about any unwanted data changes since that is impossible without leaving a trace (see below for further explanation about possible inconsistency within blocks and possible changes within a chain).
When a new block is added to the chain it gets a timestamp, a unique self-hash, and a unique hash of the previous block. Timestamps are responsible for chaining blocks together. As blocks are set in a chronological order on the timeline of a blockchain life, timestamps become a specific and immutable connection between blocks. Hash in simple words is just a mathematical translation of the content inside a block saved in the form of a string of numbers and letters.
How is it computed?¶
Imagine there is a very long and complex mathematical equation. You have to take one part of it at once and solve that step by step till the end. To save some time, you could split the equation up and give out parts of it to several people who will solve it at the same time. The only thing left will be to sum up all of the resolved parts together. Voila, you’ve saved some energy and time.
Transactions on the blockchain network are computed in a similar manner. Every block is filled with data represented by code. That code needs to be computed and solved just like the mathematical equation. Thus, splitting all of the computation into several machines is more effective than using just one computing engine.
What exactly does it mean when we say a ‘transparent database’? Many databases within blockchain are set public, which means that anyone can join the network and view all of the transactions on that network. To do this, a user must be a part of the blockchain network or use one of the blockchain explorers that allow them to see the transactions occurring live. Within blockchain, there is no way of doing anything and to avoid ledger. At the same time, any sensitive data such as identifying information is encrypted and safe. They are still shown and called a ‘public key’. For example, a virtual wallet address is just encrypted information which is unreadable to humans and useless to a system that does not have a decryption key.
Where is it stored?¶
Blockchain like every other database-like structure needs to be stored. Blockchains that represent small product inventories can be stored on a group of computers existing in one place, because they do not have to store thousands of transactions and handle a big network traffic .
With bigger systems such as those for a cryptocurrency, it would be hard to store all of the data in one place even with a large amount of computers. To solve this problem, blockchain is spread all over the world and stored on a huge amount of machines which in a blockchain lingo are called ‘nodes’. That is why spreaded blockchain storage system is commonly known as a decentralized storage system.
Each node within a network has a full record of the data that has been stored on the blockchain since its inception. But what happens if one of the nodes gets an error in its data? Luckily, it could use thousands of other nodes as a reference point to get data correct again. That’s another proof of irreversibility and immutability of blockchain system because no node can alter any data. Although even if it tries, other nodes cross-referencing each other would easily pinpoint the node with the incorrect information.
How is it secured?¶
New blocks are always stored linearly and chronologically. Every block has a certain position on the chain called ‘height’. It was mentioned above that chain are immutable but that is actually some inaccuracy. Changes are possible only if majority in chain agrees to do so. It is called ‘reaching a consensus’ which is used in sake of security. To widen this topic a little, there needs to be explained why reaching a consensus is so important. As pointed out before, when a new block is added to the chain it gets a timestamp, unique self-hash and unique hash of the previous block. Because of that when any changes are being made, new hashes and timestamps gets created. Without reaching a consensus mechanism, any changes would be easily overlooked. Does it mean that this kind of attack is impossible? No. There is a case when hacker could overpower the chain. This is when in a particular chain majority belongs to the hacker. But this form of attack is incredibly unprofitability since handling a majority in a chain would be quite expensive and hacking a chain when most of the blocks belongs to attacker is largely fruitless which makes the whole attack completely pointless. This way taking part in the network is far more economically viable than trying to attack it.