A blockchain (or distributed ledger) is a timestamped, cryptographically secured chain of blocks, where blocks contain information on transactions, participants and a hash unique to each block.
In effect, a blockchain can be thought of a distributed database as the blocks store information but it requires common agreement for new entries and once a block has been agreed upon it cannot be altered later on.
Bitcoin was the first practical application of the distributed ledger idea but the concept has been around much longer. In 1976, a research paper titled New Directions in Cryptography outlined the idea of a shared ledger and in 1991 Stuart Haber and W. Scott Stornetta envisioned a system similar to the blockchain in How to Timestamp a Digital Document. While Bitcoin has had phenomenal success in its short history, its rise in popularity exposed some of the flaws of blockchain technology.
How Does a Blockchain Work?
We can also understand a blockchain from the perspective of accounting. In double-entry bookkeeping, each transaction is represented by two entry. One for the receiver and one from another account for the sender. For instance, a company may record their financial statements in this way, but the problem is that without an audit their statements may exaggerate their financial position.
With a distributed ledger, the concept of triple entry bookkeeping arises. Since all transactions between sender and receiver are distributed and cryptographically sealed, verification of a company’s financial accounts for instance can be independently verified using the blockchain.
Since blocks are chained together chronologically, to rewrite a block would require an enormous amount of computing power because each block is hashed and timestamped once added to the blockchain and would require each preceding block to be changed as well. The timestamping of each blocks ensures that an immutable record of the order of transactions is maintained.
A blockchain is a database that is distributed because a copy of the information is stored amongst all of the computers of the network’s participants. These copies are kept by miners and users who run nodes to check the status of transactions, giving them to miners to process after agreeing on which order transactions happen to ensure that there is no tampering of the blockchain. Nodes also check that miners follow the protocol rules to produce blocks with valid transactions.
For instance, if someone tried to create two transactions worth 2 coins but they only held 1 coin. From the copy of the blockchain, nodes would be able to determine how much money an address has, since the order of transactions and their associated timestamp is broadcast to all nodes. Once the majority of nodes realise that someone tried to spend their balance of 1 coin twice, they would agree on which transaction happened first and ignore the other.
Trade-offs with Different Ledgers
The 'Blockchain Trilemma' explains the trade-off of a permissionless distributed ledger between decentralisation, security and scalability. Decentralisation refers to the diversity of ownership and stewardship of the network and improves security in some ways as there is no central point of attack. Security relates to how well prepared a blockchain is for an external attack and often increased security comes at the cost of scalability.
Most ledgers, including Bitcoin’s, are secured by Proof of Work which is considered secure as a massive amount of energy would have to be expended to rewrite any blocks. However, Proof of Work affects latency and throughput and scaling these blockchain networks has proven difficult with the most popular cryptocurrency Bitcoin only able to handle seven transactions per second.
Proof of Stake is an alternative mechanism that improves the scalability of a blockchain but at the expense of security. While a cryptocurrency with Proof of Stake can handle more transactions and requires faster verification of these transactions, this comes with the “nothing at stake” problem. Stakers can stake their coins on any version of the blockchain and there is no reason why a participant would not stake on competing chains as it maximises their return, leading to potential consensus issues and attacks.
There is also a distinction between public and private distributed ledgers. The explanation so far has outlined a typical public, permissionless blockchain, which is a network anyone is permitted to join. However, there are also private (or permissioned) distributed ledgers. A permissioned blockchain is different as it is mainly utilised by a company or organisation for its property of immutability but places restrictions on who can participate and what transactions they can do.