This article introduces Blockchain Technology to Beginners without any technical knowledge. This article explains what Blockchain Technology is, rather than explaining why I should care.
It can be confusing to use the term “blockchain technology” for different things. They may be referring to The Bitcoin Blockchain, The Ethereum Blockchain, other virtual currencies, digital tokens, or smart contracts. But most of the time, they refer to distributed ledgers, which are a collection of transactions that are replicated across multiple computers rather than being stored on one central server.
A blockchain system is a package that includes a regular database and some software. It adds a new row to a database, validates that the rows are in compliance with pre-agreed rules, and listens to and broadcasts new rows across a network to its peers, ensuring that all peers have the same data.
What’s the Blockchain?
A blockchain is a file. A blockchain is merely a data structure. This is how data is stored and logically assembled. Databases (rows and columns, tables), text files, comma-separated values, images, lists, etc. are all examples of data structures. A blockchain can be thought of as a competitor to a database.
Pages in a book are made up of blocks in a chain.
A book can be described as a series of pages. A book’s pages contain:
- Text: For example, the story
- Information about the book: The title of the book is often at the top, along with the chapter number and title. At the bottom of the page is the page number that tells you where you’re at in the book. Meta-data is a form of data about data.
Similar to a block in a blockchain, each block must contain:
- The contents of the block are, for instance, in bitcoin, the bitcoin transactions, and the miner incentive reward.
- A header is a file that contains data about the block. The header in bitcoin contains technical information about the block and a reference back to the previous block. It also includes a fingerprint (hash), of the data contained within this block. This is crucial for ordering.
Block Ordering on a Blockchain
Page by page. Predictable page numbers make it easy for you to identify the order of pages in books. It would be simple to shuffle the pages and put them in the right order so that the story is clear.
Block by block. Each block refers to the previous block using blockchains. This is not done by a ‘block number’ but by the block’s fingerprint. This is more clever than a page number, as the fingerprint is determined from the contents of each block.
Internal consistency. You can validate the data by using a fingerprint rather than a timestamp, or a numerical sequence. You can create block fingerprints in any blockchain by using certain algorithms. You can ensure that the blockchain is internally consistent if the fingerprints match the data. Anyone who wants to alter any data must first regenerate all fingerprints. The blockchain will then look different.
This means that it may be slow or difficult to create a fingerprint (this will be explained in detail in later section), and it might also be slow or difficult to re-write the blockchain.
How is New Data Communicated?
Peer-to-peer is one method of sharing data within a network. Client-server is another way to distribute data in a network. Peer-to-peer file sharing is a method of sharing files on BitTorrent networks. This allows users to share files without the need for centralized servers. BitTorrent is resilient because there is no central server that can be shut down.
Client-server
Data is often stored on servers in offices. You can log in from any location to access your data. Clients trust that 100% of the data is held on the server. The majority of the internet is client/server. This means that the website is stored on the server and you are the client whenever you access it. This model is efficient and traditional in computing.
Peer-to-peer
Peer-to-peer is more like a gossip network. Each peer has 100% of the data or as close as possible, and updates are shared amongst each other. Peer-to-peer is less efficient than client/server in that data is replicated multiple times. Each change to the data generates lots of gossips. Each peer can operate independently and continue to function even if it loses connectivity with the rest of its network. Peer-to-peer networks can be more resilient because there is no central server to control them. Therefore, it is much harder to shut down peer-to-peer networks.
Peer-to-peer: The downsides
The peer-to-peer model can lead to problems even if all peers are “trusted”. If each peer updates at a different speed and has slightly different states, how can you determine which state is “true”?
Worse scenario, you don’t have to trust all your peers in a peer-to-peer network. How can you make sure that the system isn’t easily corrupted?
Common conflict occurs when multiple miners create blocks in roughly the same order. Blocks take some time to be shared across networks so which block should be considered the legitimate one? This is how you can resolve it. It is the longest chain rule. The “longest chain rule” is the rule that resolves conflict in bitcoin.
Let’s take an example. Let’s assume that all nodes in the network have synchronized blockchains and are now on block number 100.
- Block 101 is valid if it is created by three miners around the globe at the same time. Each Block 101 may look different. They may have a different payment address for 25 BTC block rewards and contain different transactions. Let’s call them 101a 101b 101c.
- It would be reasonable to assume that Block 101 is the first one you see. Let’s suppose you see 101a first. Then you can build the next block, trying to make 102a.
- In a matter of seconds, you might see 101b. Keep an eye out for this if you do see it. If you later see 102b, you can use the “longest chains rule” to determine which 100 or 101b valid 102b chain you should consider. This means you should disregard the shorter (…100 and 101a chains. Instead of trying to make 101a, you should instead try to make103b.
To resolve conflicts that are common in distributed networks, the “longest chain rule”, is the rule that the bitcoin blockchain ecosystem uses.
You can however make decisions using a trusted or senior validator to decide in these cases if you have a more trusted or centralized blockchain network.
How Do I Change the Rules of the Network?
How will network participants come to an agreement on changes as these rules change over time? What happens if half of the network believes a transaction is valid and half don’t?
This is a simple problem to solve in a private network that has access to upgrades.
It’s more difficult in an uncontrolled public network.
There are two parts to upgrading bitcoin.
- Sugest the change (BIPs). The first stage is called the proposal stage. Here improvements are discussed and then written up. A “BIP” is shorthand for a Bitcoin Improvement Proposal. If the proposal is accepted by Github and written into Bitcoin core software, it will be part of an upgrade. This version of Bitcoin Core is the most popular “reference implementation” for the protocol.
- The change can be adopted by miners. Nodes and block-makers (miners), can download the upgrade and run it, but only if necessary. For example, a change that reduces the mining reward by 25 BTC per block to zero BTC could be imaginable. We will see how many miners decide to run this! ).
If the majority of bitcoin’s network chooses to use a new version, new-style blocks will be created quicker than the minorities. The minority will then be forced to change or be ignored in a hard fork. The majority of miners who have high computational power are able to influence the implementation of new software.
Controlling Who Can Create Data
The bitcoin network allows anyone to download and write software, and then start validating transactions or creating blocks. Simply go to https://bitcoin.org/en/download and run the Bitcoin core software.
Your computer will be a full node, which means that it can do the following:
- Connecting to the bitcoin network
- Storing the Blockchain
- Exploiting the blocks
- Listening to transactions
- Validating transactions
- Download the blockchain
- Validating blocks
- Block creation
The source code to this “Bitcoin core” software is published on Github: https://github.com/bitcoin/bitcoin. You can also check the source code, compile it and then run it yourself, rather than downloading pre-packaged software from bitcoin.org. You can also write your own code as long as it follows protocol.
This is how Ethereum works.
Permissions are not required
You don’t have to sign up, log into, or apply for the network. You can simply join the network by clicking on “Start Now”. This is similar to the SWIFT network where you cannot just download software and listen to SWIFT messages. This is why some refer to bitcoin as ‘permissionless’ while SWIFT would be considered permission.
Permission is not the only way
It is possible to use blockchain technology in a private, trusted network. It is possible that you do not wish to publicly publish the rules for valid transactions or blocks. You might want to be able to change the rules of the network. It’s easier to manage a trusted private network rather than a public, untrusted free-all such as bitcoin.
How Do You Defend Against the Bad Participant?
Permissionless networks, also known as open networks, are vulnerable to attack by anyone. There must be a way to make the network as a whole trustworthy, even if certain actors aren’t.
What are the possible actions of the bad participant?
Untrueful miners can:
- Refuse to relay valid transactions to other nodes
- Try to create blocks that include/exclude specific transactions.
- Create a longer chain of blocks to make blocks previously accepted into the main chain.
He Can’t
- Make bitcoins from air
- Steal bitcoins out of your account
- pretend to be someone else or make payments on your behalf
He can, but only his ledger version will contain these transactions. This will be rejected by other nodes, so it is crucial to confirm transactions across multiple nodes.
The effect of a dishonest miner on transactions is extremely limited. If the network is honest, they won’t reject invalid transactions from him. They will also hear valid transactions from honest nodes even if they refuse to pass them on.
If the bad participant t has enough block creation power, he may delay your transaction by refusing inclusion in his blocks. Your transaction will be confirmed by the other honest nodes, so they will include it in their blocks.
Worse scenario, the bad participant may be able to create longer chains of blocks than the rest, invoking the “longest rule” to eliminate the shorter ones. This allows him to unwind a transaction and spend bitcoin twice.
How Can You Make It Difficult for Dishonest Miners to Create Blocks?
This is only an issue for ledgers where block makers aren’t trusted.
You want to make it difficult or costly for bad guys to add blocks. This is accomplished by making it computationally difficult to add blocks in bitcoin. It is a term that means it takes a lot of computing power and can be translated to being financially costly (computers must be purchased and then maintained).
Block-makers must guess a number that when combined with other block data contents will produce a hash/fingerprint smaller than a given number. This number refers to the difficulty of mining, which is proportional to the network processing power. In a self-regulating loop, it becomes more difficult for computers to join the process of processing blocks.
This is known as Proof of Work (PoW). You are proving to the network that you did enough guesswork by publishing the block with a fingerprint smaller than the target number.
PoW makes it computationally challenging to add a block. This has resulted in a rise in mining costs (both equipment and running costs), hence the need for incentives.
The price of bitcoin determines how much power it can be used to protect the network, just as gold’s price affects the equipment you can buy. The more mining is available, the more money a criminal must spend to bully the network.
Miners are known for doing a lot of mining which increases the difficulty and raises the network security. They receive bitcoins as a reward. As the block rewards decrease, the transaction fees are reduced and miners start to collect the incentive.
It’s all great in theory. But, it becomes more complicated the more you study this. With the bitcoin solution, incentives might not have worked as planned.
Next Steps
While it is helpful to understand blockchains within the context of bitcoin, you shouldn’t assume all blockchain ecosystems require tokens, proof-of-work mining, longest chain rule, and other bitcoin mechanisms. Bitcoin is the first attempt to maintain a decentralized public ledger without formal governance or control. Ethereum is the next generation of blockchains with smart contracts. It is not easy.
However, other problems can be solved using private or internal distributed ledgers or blockchains. There are always tradeoffs, pros, and cons to every solution. You need to evaluate each case individually.