- The blockchain is like a database, it is a way of storing records of value and transactions. Almost anything can be recorded on the blockchain.
- Most transactions today between people requires an intermediary to provide trust, security and facilitate the transaction e.g. banks, financial institutions
- Blockchain technology removes the need for an intermediary, allowing people to transact directly between each other.
- Billions of people in the world live in countries where they can’t trust intermediaries such as banks, governments and legal systems for transactions or accurate record keeping. Blockchains are particularly useful in these cases to help provide trust and assurance to people when transacting between each other.
- Bitcoin is mainly used for payments. Blockchain-based systems have a wide range of uses to transfer almost anything of value.
History of Block-chain technology !
- Cryptography is the underlying foundation of the blockchain. Cryptography dates back thousands of years when messages were written in codes to protect them from enemies.
- Several papers were published during the 80’s and 90’s theorizing the use of cryptography combined with secure data chains and creation of digital currencies.
- 1982 – David Chaum wrote a paper titled “blind signatures for untraceable payments”, David Chaum is credited as being the inventor of digital cash and blind signatures.
- 1990 – David founded DigiCash which created an untraceable digital currency using cryptography, private and public keys and signatures. DigiCash declared bankruptcy in 1998 and its assets were sold to eCash technologies.
- 1997 – Adam Back created a proof-of-work algorithm to limit email spam known as hashcash. It required the sender of an email to prove they solved a computer puzzle before sending an email. This used computing power and resources, making it more expensive to send bulk spam emails.
- 1998 – Nick Szabo, proposed a decentralized digital currency called “bit gold”. This incorporated proof-of-work combined with a network of computers that accepted the proof-of-work as valid and incorporated it into the next puzzle with a timestamp. Bit gold was never created as a real currency, it only existed in theory.
- 1998 – Wei Dai published another paper titled “b-money, an anonymous, distributed electronic cash system”. The paper outlined the foundations for cryptocurrencies, including Bitcoin, and the paper is referenced in Satoshi Nakamoto’s Bitcoin paper.
It was the work during the 1980s to 2000s, along with the academic papers published, that laid the groundwork for Bitcoin and the blockchain.
- 2008 – Satoshi Nakamoto (which is widely regarded as a pseudonym) posted a paper on the internet entitled “Bitcoin: A Peer-to-Peer Electronic Cash System”. This paper outlines the creation of Bitcoin and blocks of transactions linked in chains. The paper never directly uses the words “block chain” together when referring to this method.
- 2009 – Bitcoin became more than just an idea in an academic paper when Satoshi Nakamoto created the Bitcoin network along with the first blockchain. This first blockchain was a core feature of Bitcoin, preventing double spending and acting as a distributed public ledger for all transactions on the Bitcoin network.
- Nakamoto is credited with the mining of the first block on the Bitcoin network known as the “genesis block” with the message in it:
“The Times 03/Jan/2009 Chancellor on brink of second bailout for banks”
This message may have been left as proof that the date the first block was created was on or after the 3rd of January, along with being a comment about the failures within the current structure of banking and currency markets.
- The creator of Bitcoin and the blockchain, Satoshi Nakamoto, is still unknown. People suspect Nick Szabo or Wei Dei of being the creators of Bitcoin however they both deny it.
- 2015 – Ethereum blockchain launched, allowing decentralized applications and smart contracts to run on the blockchain. This enhanced functionality of blockchain technology is known as Blockchain 2.0.
Working of Blockchain !
● In order for a transaction to be processed and considered valid, it is grouped with other transactions and added to a new block.
● This new block is added “on top” of the previous block in the blockchain. Each block refers to the previous block number, linking them together like a chain, which is where the name “blockchain” comes from.
● The chain of blocks in the blockchain links all the way back to the first block on the chain known as the “genesis block”
● With a decentralized blockchain each block of transactions on the blockchain is validated by the network. Everybody on the network receives information about transactions on the network, it is not controlled by a centralized database owned by one company or institution.
● Once a block of transactions has been added to the blockchain, it is difficult to reverse. Every block added on top is a confirmation that the transaction won’t be reversed. The more blocks on top, the harder it is to reverse until it is unfeasible. On the Bitcoin network 6 blocks are accepted as confirmation the transaction won’t be reversed.
● With distributed consensus, the majority of computers on the network need to agree that a transaction is valid before it is accepted on the blockchain.
● Double spending is where someone on the network attempts to duplicate transactions. This is generally done by sending transactions more than once before one of them is confirmed and accepted onto the blockchain.
● A double spending attack is where a user controls more than 50% of the computers on the network. This allows the user to double spend transactions by controlling which transactions are accepted and rejected.
● Mining is the process of validating transactions and adding new blocks to the blockchain. Small rewards are given for each new block added to the blockchain, like mining a small reward out of a big block.
● Proof of work involves solving a computer puzzle to add a new block to the blockchain. It is difficult to solve but easy to prove, like a combination lock. It provides evidence that computing power and resources were used and contributed to the network.
Decentralized peer-to-peer networks aren’t new. Napster and BitTorrent are P2P networks. Instead of exchanging movies, members of the blockchain network exchange facts. Then what’s the real deal about blockchains?
P2P networks, like other distributed systems, have to solve a very difficult computer science problem: the resolution of conflicts, or reconciliation. Relational databases offer referential integrity, but there is no such thing in distributed system. If two incompatible facts arrive at the same time, the system must have rules to determine which fact is considered valid.
Take for instance the double spend problem: Alice has 10$, and she sends twice 10$ to Bob and Charlie. Who will have the 10$ eventually? To answer this question, the best way is to order the facts. If two incompatible facts arrive in the network, the first one to be recorded wins.
In a P2P network, two facts sent roughly at the same time may arrive in different orders in distant nodes. Then how can the entire network agree on the first fact? To guarantee integrity over a P2P network, you need a way to make everyone agree on the ordering of facts. You need a consensus system.
Consensus algorithms for distributed systems are a very active research field. You may have heard of Paxos or Raft algorithms. The blockchain implements another algorithm, the proof-of-work consensus, using blocks.
Blocks are a smart trick to order facts in a network of non-trusted peers. The idea is simple: facts are grouped in blocks, and there is only a single chain of blocks, replicated in the entire network. Each block references the previous one. So if fact F is in block 21, and fact E is in block 22, then fact E is considered by the entire network to be posterior to fact F. Before being added to a block, facts are pending, i.e. unconfirmed.
Some nodes in the chain create a new local block with pending facts. They compete to see if their local block is going to become the next block in the chain for the entire network, by rolling dice. If a node makes a double six, then it earns the ability to publish their local block, and all facts in this block become confirmed. This block is sent to all other nodes in the network. All nodes check that the block is correct, add it to their copy of the chain, and try to build a new block with new pending facts.
But nodes don’t just roll a couple dice. Blockchain challenges imply rolling a huge number of dice. Finding the random key to validate a block is very unlikely, by design. This prevents fraud, and makes the network safe (unless a malicious user owns more than half of the nodes in the network). As a consequence, new blocks gets published to the chain at a fixed time interval. In Bitcoin, blocks are published every 10 minutes on average.
In Bitcoin, the challenge involves a double SHA-256 hash of a string made of the pending facts, the identifier of the previous block, and a random string. A node wins if their hash contains at least n leading zeroes.
// a losing hash for Bitcoin 787308540121f4afd2ff5179898934291105772495275df35f00cc5e44db42dd // a winning hash for Bitcoin if n=10 00000000009f766c17c736169f79cb0c65dd6e07244e9468bc60cde9538b551e
Number n is adjusted every once in a while to keep block duration fixed despite variations in the number of nodes. This number is called the difficulty. Other blockchain implementations use special hashing techniques that discourage the usage of GPUs (e.g. by requiring large memory transfers).
The process of looking for blocks is called mining. This is because, just like gold mining, block mining brings an economical reward – some form of money. That’s the reason why people who run nodes in a blockchain are also called miners.
Note: By default, a node doesn’t mine – it just receives blocks mined by other nodes. It’s a voluntary process to turn a node into a miner node.
Boons of Blockchain !
● Transparency – Blockchain offers significant improvements in transparency compared to existing record keeping and ledgers for many industries.
● Removal of Intermediaries – Blockchain-based systems allow for the removal of intermediaries involved in the record keeping and transfer of assets.
● Decentralization – Blockchain-based systems can run on a decentralized network of computers, reducing the risk of hacking, server downtime and loss of data.
● Trust – Blockchain-based systems increase trust between parties involved in a transaction through improved transparency and decentralized networks along with removal of third-party intermediaries in countries where trust in the intermediaries doesn’t exist.
● Security – Data entered on the blockchain is immutable, preventing against fraud through manipulating transactions and the history of data. Transactions entered on the blockchain provide a clear trail to the very start of the blockchain allowing any transaction to be easily investigated and audited.
● Wide range of uses – Almost anything of value can be recorded on the blockchain and there are many companies and industries already developing blockchain-based systems. These examples are covered later in the book.
● Easily accessible technology – Along with the wide range of uses, blockchain technology makes it easy to create applications without significant investment in infrastructure with recent innovations like the Ethereum platform. Decentralized apps, smart contracts and the Ethereum platform are covered later in the book.
● Reduced costs – Blockchain-based ledgers allow for removal of intermediaries and layers of confirmation involved in transactions. Transactions that may take multiple individual ledgers, could be settled on one shared ledger, reducing the costs of validating, confirming and auditing each transaction across multiple organizations.
● Increased transaction speed – The removal of intermediaries and settlement on distributed ledgers, allows for dramatically increased transaction speeds compared to a wide range of existing systems.
Impact on the finance industries !
● Transferring value between companies and countries is currently a slow process. Blockchain technology offers enhanced speed of transactions with the potential for real-time instant transfers.
● Blockchain technology can replace layers of authentication with transparency of transactions.
● Many banks, central banks, governments and financial companies are already utilizing blockchain technology or are currently researching and developing them.
● Share trading involves a transfer of ownership between people. Blockchains can be utilized to replace intermediaries and process trades with the Nasdaq already implementing a working blockchain.
● Many administrative and settlement functions performed by financial institutions are outdated and manual. These functions could potentially be replaced with blockchains and distributed ledgers.
Impact on other industries !
● It is not just financial services companies implementing blockchain-based systems. Blockchain technology has a wide range of uses across different industries.
● Blockchain-based technology can be used to transfer and record almost anything of value.
● Many companies are already developing their own blockchain systems, with some blockchain-based systems already working and available now.
● In the future, intermediaries and platforms may be replaced with blockchain platforms.
● Blockchain technology is a much closer reality than many people may be aware of. In the next few years there is likely to be a range of industries implementing blockchain technology.
Ethereum, Smart contracts and decentralized applications !
Ethereum is a platform on top of a blockchain with a programming language that allows developers to create and run decentralized applications and smart contracts on the powerful, distributed computing platform and blockchain underlying the Ethereum platform.
● The Bitcoin currency and network is primarily used for financial transactions. Ethereum has a currency “Ether” but it is designed to be exchanged for computing power, not for financial transactions outside of the Ethereum platform.
● Decentralized apps (dApps) have no single server or entity controlling it, dApps run across a network of computers.
● Smart contracts are contracts that are written in computer code and operate on a blockchain or distributed ledger.
Smart contracts automatically verify, execute and enforce the contract based on the terms written in the code without the need for third party intermediaries such as lawyers or courts to enforce the contracts.
● Anything of value can be exchanged using smart contracts, they do not only refer to legal contracts. Smart contracts reduce risks associated with transacting on the blockchain network, as transactions and payments are handled automatically by the network.
● There are many companies already developing blockchain-based decentralized applications and smart contracts on the Ethereum platform.
● The Ethereum platform is the next step in the future of blockchain technology that includes smart contracts and decentralized apps, referred to as “Blockchain 2.0”
Anticipations Regarding blockchains !
- Open source decentralized vs closed source centralized – There is no clear winner for the future direction of development yet. Both open source decentralized blockchains will be developed alongside closed source centralized/consortium blockchains to suit different requirements.
- Distributed ledgers: Distributed ledgers that do not use a blockchain but have many of the benefits of a blockchain is a trend that may compete with blockchain based ledgers in the future.
- Less cryptocurrencies and more blockchain tokens: A trend that is currently occurring is companies using tokens on the Ethereum platform instead of their own blockchains and cryptocurrencies. This trend looks set to continue as the functionality of the Ethereum platform allows development of Decentralized Apps and Smart Contracts.
- Blockchain 2.0: Blockchain technology now has significantly increased functionality such as Decentralized apps (dApps) and Smart Contracts that were not part of the original blockchain code. Blockchain 2.0 is used to refer to the future of blockchain technology including these enhancements to separate it from the original blockchain capabilities.
- More regulation and acceptance: Governments and companies have moved towards accepting cryptocurrencies as legitimate forms of payment along with investing heavily in blockchain infrastructure and technology.
- Blockchain in everyday life: Even if the blockchain-based technology isn’t as revolutionary as predicted, it still looks set to become a part of every life through distributed ledgers, payment options or software alternatives for existing options.