Blockchain – a brief introduction
Blockchain
How did it start?
The idea of a blockchain, that's to say a distributed transaction processor, is a very old one. The theoretical advantages have been known for a while, but it was not feasible in practice. Until technology came along. The system design for the Blockchain was created when Satoshi Nakamoto was designing a new electronic currency. He came across the double-spending problem.
Double spending problem
When someone concludes a transaction and pays with digital currency, how can you make sure that this person - whether deliberately or by accident - is unable to carry out the transaction twice (or more often)? In other words, how do you validate a transaction and make sure it's carried out honestly for both buyer and seller?
The double-spending problem is usually resolved by a third party being added to a transaction: a broker or intermediary. This third-person, trusted by the other two parties, checks whether the transaction is carried out honestly.
But Nakamoto wasn't looking for a solution involving a third person and came up with a 'block chain' (two words at that time). In 2009, Nakamoto published 'Bitcoin: A Peer-to-Peer Electronic Cash System' in which he explains the blockchain technique and resolves the double-spending problem without the addition of a trusted intermediary.
The principles of this Bitcoin blockchain can be found in all other blockchain solutions. But and this is important: blockchains and Bitcoins are absolutely not synonyms. The only connection between the two is that Bitcoin makes use of a blockchain to validate its transactions.
Blockchain
So what is it exactly?
The term blockchain is, and will always be, somewhat intangible and vague. That's because it's a broad term used to describe multiple kinds of technology. The basic idea, however, is quite simple.
Blockchain
Blockchain is a digital system in which transactions are completed and the history of those transactions can be tracked in a network. The word transaction can be used to mean anything here: financial agreements, data exchange, contracts, etc. The transactions are stored in blocks (more about that later) which are interconnected by way of encryption.
Different blockchains have their own validation rules and often a different method of encrypting. But transactions in different blockchains always adhere to the same principles, which guarantee that a transaction will be carried out honestly and successfully.
Principles of blockchain transactions
- Party A initiates a transaction.
- The transaction is sent to all the participants of a network.
- Each participant checks whether the transaction complies with the validation rules set up for that.
- Validated transactions are stored in a block and secured by means of encryption.
- All the participants check whether the securing through encryption has been successful.
- The block, now approved, is linked to the previous block through encryption.
- The transaction is now recorded in the blockchain and can no longer be adjusted or removed.
Blockchain
Why do people want it?
The keyword in blockchain is trust. Just as is the case with other transaction methods, blockchain guarantees a reliable transaction (not complete reliability, but no other method can guarantee that either). Other transaction systems, such as banks, put their faith in one or more authorities (including themselves). An authority ensures a dependency and is also a risk factor. Validation of transactions by an authority must always go through a single point, and if that point disappears, validation is no longer possible.
Blockchain is distributed and sustainable. The bookkeeping on transactions is shared and brought up to date with everyone with each new block. The existence of the blockchain is carried by everyone in the network and is not dependent on any authority or organisation. Neither is there any central truth - if there are differences between participants, that's because no truth has yet been determined.
Even more unique about blockchain is the fact that the transactions are transparent and controllable. Everyone in the network can view all transactions. All the participants can validate transactions and verify the identity of owners without the intervention of an authority or third party. Ownership is derived here from transactions that are public.
Trust comes from consensus. All participants in the network must agree on every transaction. A consensus algorithm determines the rules with which a transaction must comply. The algorithm and resulting rules vary from one blockchain to another.
A final feature of the blockchain is the immutable security, due to encryption. No one can modify a transaction once it has been added to the blockchain. Transactions are recorded cryptographically and form the basis, or a part of the basis, for all subsequent transactions, meaning they have to remain unchanged in order to keep the whole chain valid.
Blockchain
How does it work?
The functional features of the blockchain, as described above, naturally result from the technical characteristics of the blockchain. Let's look at that in more detail. We're talking about distribution, cryptography, and consensus. The details of these technical features vary from one blockchain to another, but we're talking here globally enough to be able to speak of generic features.
I - Distribution
Participants in a blockchain (known as the nodes in the network) each have access to a copy of the current version of the blockchain. That allows them to validate new transactions using their own copy. The peer-to-peer feature of a distributed network ensures that a transaction takes places directly between sender and receiver, without the intervention of an intermediary. The fact that a blockchain is distributed also means that nodes can drop out without the integrity or stability of the network being endangered.
In a centralised network structure, transactions would first have to go through the central point before arriving at the receiver. This is a vulnerable structure. Because if the central point drops out, transactions are no longer possible. Facebook, for example, is central; all your posts are stored in one central location. And everything you see on Facebook is also stored in one central location.
A decentralised network still suffers from central points through which transactions must go. In a decentralised network, the central points of the groups are connected to each other. When a central point drops out, not all groups are still accessible. So the central points are still vulnerable.
Email can be regarded as decentralised. The email service you use saves your mail on a server. A receiver can be using a different email service and saving mail in another location. The servers communicate with each other and ensure that you can both read the emails sent to you.
In a distributed network, also known as meshor peer-to-peer, participants are free to connect to each other. When a participant drops out, there are still many possibilities for making a connection, or new connection, through other participants. The many connections make the network resistant to attack and give it great resilience.
II - Cryptography
All transactions are secured in blocks, with a certain number of transactions in each block. In addition to the transaction (the body), a block contains a header. This header identifies information about the block and blockchain protocol; the version of the protocol, for example, and a reference to the previous block. A blockchain begins with a first block, called the genesis. This block is given a unique value in the header, the Genesis hash (a hash is a cryptographic function with which a unique value of a certain number of characters is generated). The header also contains the merkle root which is simply the hash of all transactions. There are other things in this header, such as a time indication and a nonce, which is a unique and random series of numbers. All this is intended to make the header as unique as possible.
The block after the Genesis block is Block 1. This block contains the hash of the header of the Genesis block. This way, the transactions from the Genesis block are cryptographically secured in Block 1. With each new block, the previous block's data, so including the hash of the header of the previous block, is used to secure all previous transactions. This cryptographic feature is the essence of a blockchain.
This is also where the name cryptocurrency comes from: these types of payments are secure thanks to cryptography.
III - Consensus
Every blockchain has its own method of validation. With Bitcoin, this is called the proof of work protocol - proof that someone has applied a significant amount of processing power to solve a cryptographic problem. This is a problem that is deliberately difficult to solve but extremely easy to verify. One example of this is iteratively trying to achieve a certain hash. This is called mining because the person who solves it is rewarded. Another method is proof of stake, where the validation of the following block is selected randomly. This is to overcome that the individual with the most processing power has a monopoly on the validation of transactions.
Every blockchain can use a different consensus protocol. They are usually improvements on existing protocols or are more suitable for the intended application. Many consensus protocols are an improvement on proof of work, and in addition to proof of stake, there is also proof of burn and proof of space, for example.
Blockchain
What are the applications?
Many blockchains offer the possibility of carrying out a transaction with new cryptocurrency coins or tokens. These have a particular value that can be expressed in market capitalisation (price times circulating stock), the relative market value as compared to other cryptocurrencies. Bitcoin's domination is no longer as complete as it was and is now around 35% in the market; the actual percentage can be found on Coinmarketcap. In the case of Bitcoin, you only secure a cryptocurrency transaction, whereas, with blockchain, you can secure much more.
The market capitalisation of other cryptocurrencies has increased, logically. For example, Ethereum is the second cryptocurrency with a market capitalisation of more than 15%. Ethereum started up in 2014 and was set up to secure smart contracts.
Smart contracts
These are applications that you can programme yourself, and which prevent cancellation, censure, fraud, or intervention by third parties by means of blockchain. One of the applications is concluding contracts with multiple parties where you can dynamically organise all the varying terms and conditions with each party.
Smart contracts are a huge step in blockchain options and we can in all honesty call them a second generation. You're no longer speaking 'merely' of distributed databases but actually about distributed apps or dapps.
As we already said: not all blockchains are for cryptocurrency. As well as financial solutions and smart contracts, there are also supply chain solutions. You can secure the transactions accompanying a production process, from product origin to consumer's end product. This gives insight into, for example, the extent of Fairtrade involved, allowing you to be sure of the origin of your product. Take, for example, a coffee grower who cultivates beans and secures where and when they were grown and with what. Or where, when, and for what price the beans were sold. By the time you bring the finished coffee home, you, the consumer, know exactly and with certainty, everything that's happened with the coffee.
In addition to the examples described, the blockchain can be useful in many other domains. Security, communication, data, identity, gaming, gambling, and privacy, for example. Another application is securing learning experience and competencies. Imagine that coffee bean is a student; they aren't traded but they learn at school, in companies, and online. It would be great for the student (eternal student) if all this learning and work experience could be secured in an innovative way. And there are lots more applications possible.
Blockchain
How do I personally set one up?
We'll close with a bit of theory specifically for software developers (and analysts and testers). Since 2016, it's been quite possible to set up a blockchain in Azure.
In fact, Microsoft's Blockchain as a Service (BaaS) contains all the features mentioned above. BaaS is a network based on Ethereum for which you can use Virtual Machines as nodes. You can create a blockchain with multiple nodes, hashing, mining, consensus, distribution, and more. Being on Azure, it's also easy to combine other services such as Blockchain-Data analytics and Blockchain AI with BaaS.
Sources
Blockchain - a brief introduction
Blockchain – a brief introduction