- Brief overview of blockchains
- History of cryptocurrencies and blockchain
- Under the hood (high level overview of key blockchain technologies)
Brief overview of Blockchains
In its simplest form, a Blockchain, conceptually, is just a series of blocks or records that each contain some meaningful information. These blocks or records could be as simple as a few lines of text!
Blockchain merely refers to the structure of the technology, where each block of data is cryptographically secured and bound to the next (more of that to come) based on the contents of each block, ultimately creating a ledger or database of records.
The contents of each block can be anything from the details of a transaction, personal credentials, product data, shipping information, location data — essentially any information you can find in a traditional database, or even a part of a digital file e.g. PDFs, audio/video files (think BitTorrent or cloud storage).
In practice, a blockchain is typically (but not always) shared with parties of two to three or more who may not know, therefore trust each other. Therefore, one can think of a Blockchain as a shared database or document that is owned and constantly updated by a group of people who have been granted prior access, as opposed to a central database that is controlled and maintained by a central authority.
Based on the very brief overview above, three properties become apparent, which forms the basis of any well-constructed blockchain:
- Encrypted: Every new block is secured and bound to the previous block using cryptographic techniques called hash functions
- Immutable: Due to the encrypted process by which the Blockchain is created, previous blocks in the chain cannot be modified without changing the contents of the blocks that follow, all the way to the very first block (genesis block)
- Decentralised and Distributed: Shared, controlled and concurrently maintained by a network of users/computers as opposed to a single entity
Thus, Blockchain, defined broadly, is a mechanism for agreeing on the state of a shared database between multiple parties who may not hold mutual trust.
History of cryptocurrencies and blockchain
Back in 2008, a digital payment experiment was started by a person or group by the name of Satoshi Nakamoto. Their intention was for it to be created as an alternative to our current financial system, and a solution to the inherent problems that come with it such as monetary control, manipulation, and reliance on a central body or trusted third party.
Bitcoin became the first widely used implementation of the Blockchain concept, which, as we have already learnt is a digital ledger of transaction records. Just like your bank account, it represents nothing more than a balance of numbers (i.e. your bank balance).
The only difference is that the entire Bitcoin ledger is viewable by anyone and updated by a group of validators in the network using a consensus mechanism, without governance from a central authority.
A better way to think about a cryptocurrency is that it is a new asset class that enables a decentralised application. Bitcoin was only successful because there was a shared network of users enabling and growing the application, incentivized by the value of Bitcoin as a cryptocurrency.
Today, there are over 1,600 different cryptocurrencies, all supporting different protocols and decentralised applications. One thing to note however, is that not all blockchains require an application/protocol specific cryptocurrency — for example, blockchain enabled logistics and shipment tracking applications.
The word decentralisation is often mentioned in discussions involving blockchain, but what does it really mean? By definition, being decentralised means “the movement of departments of a large organization away from a single administrative centre to other locations”. Within the context of software, decentralisation means that information flowing through the network is not required to pass through a single point. Instead, many points connect, known as a peer-to-peer network (BitTorrent is a good example).
The internet has, in a relatively short amount of time, enabled the creation of enterprises that have grown into behemoths, amassing incredible amounts of power and wealth since the nineties. While they have provided us convenient and affordable access to the things we like such as music, movies, online shopping, many blockchain enthusiasts firmly believe that our web experiences could be greatly improved by decentralisation.
Internet giants such as eBay, Google, Facebook and Uber are examples of centralised enterprises who, along with their respective databases, are all one entity. The decentralised versions of such platforms would no longer belong to the creators, but to its community, and it is the community who have the ability to build various business models on top of the database and subsequently, have a fairer share in the rewards that are generated.
As an example, OpenBazaar, an open source software akin to a decentralised eBay, went live in April 2016, and has since been operating with no fees or restrictions. Each user contributes to the network equally and controls their own store and private data.
There are both clear advantages and disadvantages of using a decentralised approach but ultimately, the decision as to whether your project (or which part of your project) needs a blockchain, and the degree of decentralisation you plan to implement will depend on your ideas and objectives.
Under the Hood — Key Blockchain Technologies
“Blockchain, defined broadly, is a mechanism for agreeing on the state of a shared database between multiple parties who may not hold mutual trust.”
Going back to this definition — the ‘mechanism for agreeing on the state of a shared database’, otherwise known as the consensus algorithm, is what we will focus on here.
Coming to an agreement in a network is not trivial, and even more so in blockchain networks. Blockchains only work if its participants can agree with each other and not allow for double-spend or fraudulent entries in the ledgers.
Proof of Work
Without a central authority or trusted third party such as a bank to validate activity, there needs to be a way for the network to come to an agreement. When Bitcoin was created, the solution that Satoshi came up with managed to solve this problem through a mechanism called Proof of Work.
In the PoW system, ‘miners’ validate and add new records to the ledger by solving cryptographic challenges using computational power. In simpler terms, miners are participants in a network who are presented with a challenge that can only be solved by running an extremely large number of computations. We won’t go into too much detail here, but once the solution is found it can be quickly verified on the network, and the ‘miner’ that provided the solution is awarded a financial incentive for performing the work.
To perform the work to get the right solution requires a huge amount of computational power and thus, electricity. It is because of this cost that it is impractical for a miner to perform the work on an invalid transaction, as every other computer on the network would reject the invalid transaction.
The Proof of Work algorithm is by no means perfect however, due to its high energy consumption requirement which can lead to centralisation of mining activity and control in geographical locations with cheaper access to electricity, as well as the risk that large mining hardware manufacturers can potentially dictate the rules or even supply of mining hardware, favouring a certain group over others.
Proof of Stake
Another popular consensus algorithm, called Proof of Stake, looks to address the problems of Proof of Work by using a different approach to secure the blockchain.
Similar to miners on the Proof of Work consensus are validator nodes on a Proof of Stake consensus network. To operate a validator node, a user locks up, or stakes a specific number of tokens belonging to that blockchain. Nodes then vote to validate new transactions. The main difference with rewards for the validation of blocks on the majority of PoS consensus algorithms come in the form of transaction fees, as opposed to newly created currency in PoW systems.
Note: Tokens are essentially a form of cryptocurrency purchased and used for a purpose specific to the network it belongs to — think of a chip that can only be used at a particular casino, or gaming tokens purchased for a particular arcade.
The weight of each vote, as well as the size of the financial reward depends on the amount and duration that tokens are staked. The more tokens a user holds and the longer a user has held them, the higher the chances of being selected.
If a user were to launch an attack on the network, it would take significant capital in both time as well as their staked tokens. The community can also vote to erase the coins generated from the attack through what’s called a hard fork, making it unprofitable for the attacker.
Good PoS systems also have processes in place to randomise the selection of validator nodes to prevent the richest users from always being selected to validate transactions and thus, collecting all the rewards from doing so.
All consensus algorithms have their strengths and weaknesses, and they are by no means perfect — this is why we continue to see new algorithms appear all the time.
PoW and PoS are just two examples of consensus algorithms out of many. Hopefully this provides you with a good introduction to some of the ways blockchains are secured within a decentralised, trust-less environment.
Public and Private Blockchains
Not only can different blockchains use different algorithms for reaching consensus, they can also have different rules around who can view and modify its data.
The concept of private blockchains has become very popular over the past few years, as it meets very specific requirements in cases where increased privacy and access are needed, while at the same time offering the functionality and benefits of a decentralised ledger.
The difference between a public and private blockchain is essentially what it sounds like — instead of having a fully open and uncontrolled network secured by the blockchain’s respective mechanisms and consensus algorithms, it is possible to have systems where access permissions are more tightly controlled, with rights to modify or read the blockchain restricted to select users while still maintaining a state of decentralisation.
In general, there are three categories that blockchain applications fall under:
- Public blockchains: Anyone can read, send transactions, participate in consensus process, typically secured by economic incentives and consensus algorithms. Generally considered to be fully decentralised.
- Consortium blockchains: Blockchains where consensus is controlled by a pre-selected set of validator nodes e.g. 15 financial institutions each operating a node, of which 10 must sign every block in order for the block to be valid. Read access can be public or restricted. May be considered partially decentralised.
- Private blockchains: Blockchains where write permissions are centralised to one organisation. Read access may be public or restricted. Use cases include database management, auditing, logistics and goods tracking. Typical application is internal to a single company, and as such public access may not be necessary in many cases.
There are some clear advantages to operating a private blockchain:
- Ease of changing the rules of the network, revert transactions, modify balances etc.
- Validators are known, which significantly reduces the risk of an attack or collusion
- Transactions can be cheaper, as fewer nodes are required for validation
- Ability to restrict permissions can provide a greater level of privacy if required
While public blockchains may be easier to explore, whether you want your blockchain to be public or private will depend on your objectives, as each of them will serve different purposes and use cases. Here’s where you can consider the more flexible nature of private, or consortium blockchains.
Ultimately, adoption of blockchain use will be driven by networks, so partnerships across industries are important, and can be led by shared technology providers.Page Break
Smart Contracts and DApps
So far, we have seen how a blockchain can be used to store a simple distributed ledger. But people have built complex distributed ledgers which don’t just store numbers, they can store code. That code is often called a smart contract.
Smart contracts are just like contracts in the real world, except they are digital — essentially tiny programs stored inside a blockchain. Smart contracts are written in code, under a set of rules which the parties involved in the contract agree to interact with each other. If and when the rules are met, the agreement is automatically enforced. The smart contract code facilitates, verifies, and enforces the negotiation or performance of an agreement or transaction.
Some common and potential use cases include Initial Coin Offerings, Digital Identity Management, Banking/Financial Services Contracts and Mortgages.
As Smart Contracts are stored on the blockchain, they inherit some useful properties thanks to the distributed and immutable nature of blockchains. Being immutable means that once a smart contract is created, it can never be changed. Being distributed means that the output of the contract is validated by everyone on the network, so a single person cannot manipulate the contract to their own benefit, such as releasing funds, because others on the network will spot the attempt and mark it as invalid.
So where and how can I use a smart contract?
At the moment, there are a handful of blockchains that support smart contracts, the largest being Ethereum, written on the Solidity programming language, which was specifically created and designed to support smart contracts.
Decentralised Applications (DApps)
Another term you will come across is ‘DApp’, short for Decentralised Application. As the name suggests, a DApp is an application where the backend code runs on a decentralised peer-to-peer network rather than a single computer. DApps have existed for as long as P2P networks have been around — they are a type of software program designed to exist on the Internet in a way that is not controlled by any single entity.
Strictly speaking, DApps do not need to run on top of a blockchain network — BitTorrent is a perfect example. It is a decentralised app running on a P2P network, but not on a blockchain (which in itself is a specific and different kind of P2P network).
What about a Blockchain DApp?
A Blockchain DApp is essentially a DApp which uses smart contracts to execute commands and retrieve information from the Blockchain it is built on.
We briefly mentioned a few use cases of smart contracts earlier including Digital Identity Management, Banking/Financial Services Contracts and Mortgages, but there’s no reason why the Ubers, AirBnBs and eBays of today can’t be rebuilt as decentralised applications, utilising smart contracts to exchange money, property, shares or anything of value in a transparent, conflict-free way while avoiding the services (and exorbitant costs) of a middleman.
Although it’s hard to accurately predict where blockchain technology will take us, we already have a sneak peek into what the decentralised future has in store for us, with a significant number of DApps successfully transacting large volumes of transactions worth millions of dollars’ equivalent in crypto-assets per day, right now.
These numbers are bound to increase, as increasingly more DApp developers familiarise themselves with blockchain and DApp development, as well as the existing blockchain projects that will be moving out of beta and into full production.Page Break
When to Decentralise
Finally, on to the most important question of all — when/why should you use a blockchain?
Objectively speaking, there is certainly a lot of hype around the impact that Blockchains can bring — but with the right applications, the benefits are very clear and have already been demonstrated with a number of high profile applications by the big players across various industries such as IBM, Microsoft, SAP, DHL, Mastercard and Maersk.
Whether you are starting from scratch or looking to introduce blockchain to an existing project, before you jump ahead and start investing in blockchain development, you should ask yourself some very important questions:
- Why does our project need to use a blockchain?
- What is the use case? Which one of the many functions in your company or project would benefit from Blockchain technology?
To get you started, here are a few points to consider:
Distributed Databases vs Traditional Databases
First and foremost, Blockchains are a technology for shared databases, so you need to start by knowing why you are using a database, and if a database is required, whether a decentralised or traditional solution will better suit your requirements.
Blockchain technology in itself is a significant innovation in data management. The ability of distributed ledgers to facilitate consensus within a trust-less environment is a feat that traditional databases have so far not been able to achieve.
If trust within the network and data security is more important, moving away from more traditional, centralised data management solutions may be the ideal option for you.
However, traditional databases, such as the ones developed by Oracle and SQL, have been providing successful data management solutions for years. They are deployed on millions of servers worldwide, running trillions of queries, containing thoroughly tested, debugged and optimised code, and process thousands of transactions per second with relative ease.
So if fast and reliable performance is a priority for your project, the advantages of existing database solutions might appeal more than a blockchain.
As before, Blockchains are a technology for shared databases, or in other words, databases with multiple writers. What this means is that you need to be in a situation where there is more than one person/entity generating activity that updates the database.
In many cases, those who are writing to the database may also hold a copy of the database themselves, and relay transactions to other participants across the network.
Absence of trust
If you have multiple entities writing to the database, there needs to be a level of mistrust between those entities — perhaps due to different economic or political incentives behind their participation.
Whether the database is shared between a single or multiple entity/organisations, if you need a way for users of your application to collectively agree on updates to your database in a fair manner, a Blockchain solution could potentially be the answer.
When there is an absence of trust is where Blockchains really shine. They remove the need for trusted intermediaries by managing updates to databases in a systemic and fair manner from multiple non-trusting participants. No central authority or entity is needed to verify and authenticate these changes and where they originated from.
The question comes down to whether or not you need this disintermediation. Does your business or project need a central authority in order to run? Or do you need a means by which multiple non-trusting participants can write to your database without a third party intermediary?
Other reasons for choosing to use a Blockchain could be lower costs of doing business, transaction fees, more efficient transactions, regulation, or simply the inability to find a suitable intermediary.
Last but not least — one of the best features of the Blockchain is its ability to facilitate the interaction of transactions from multiple writers between each other without the need for a trusted intermediary.
You may have a database of user identities shared by several applications in which multiple entities validate different aspects of a user’s identity, or perhaps a transport and hospitality ecosystem where a ride sharing app relays a user’s location and profile with bars, cafes and restaurant partners to provide dining and entertainment offers.
Although each application provides their service independently of the others, a Blockchain is able to bring applications together because of how transactions can be created by multiple writers collaboratively without any of them exposing themselves to risk.
To sum up, if your project does not fulfil most of these conditions, you may want to consider a non-Blockchain solution such as regular file storage or centralised databases. You should be able to clearly define your consensus algorithms and specify the rules of your application in terms of the transactions which the database allows, and be confident about who you can trust to act as your validators.