EXPLAIN BLOCKCHAIN TO YOUR FRIENDS

Introduction to Blockchain

A Functional Breakdown

Nicolas Malloy
7 min readAug 31, 2018

A Blockchain is a sequential archive used to keep records of data. Computer Scientists/Cryptologists Stuart Haber and W. Scott Stornetta originally proposed the technology in 1991 as a means for time-stamping the creation of intellectual property using digital documents. They believed by using this method property rights could be fixed before others had the opportunity to perform copywrites (Yermack, 2017). It wasn’t until 2009 that Blockchain gain momentum when an unidentified person using the alias Satoshi Nakamoto applied the technology as the basis for creating a digital cryptocurrency. This asset is well-known today as Bitcoin.

Blockchain is an open (available to anybody), distributed ledger that can record transactions between two parties efficiently and in a verifiable and permanent way. (Lakhani & Lansiti, 2017). Once data is recorded inside a Blockchain it becomes very difficult to change it. As the name suggests a Blockchain contains blocks. Each of the blocks are comprised of three elements:

• Data

• Hash

• Hash of the Previous Block

The data stored inside of a block varies depending upon the use-case for the Blockchain. For instance, if the Blockchain were designed to support a cryptocurrency then the block would contain data pertaining to the sender, receiver, and the quantity of coins included in the transaction.

The hash is used to create a unique and inherently secure identification for both the sender and receiver. The uniqueness of the hash is comparable to the uniqueness of an individual’s irises or their finger prints. In this way a hash identifies a block and all of its contents. The hash is always unique (just like the finger print). When a block is created a corresponding hash is calculated. Subsequently, if the contents of the block change the hash value will also change and thus it is no longer the same block. Simply put, changing the contents of a block results in the creation of a new block (Decuyper, 2017).

This relationship between the contents of the block and the hash is useful when seeking to determine if the contents of the block have changed by comparing the value of the current hash with the value of the hash of the previous block. The hash of the previous block is also contained in the current block.

A Chain of Blocks

These three elements of a block are what create the chain. Overtime, as each leading block is altered a new leading block is created. The continuous creation of new unique leading blocks extends a chain of inter-linking blocks or a Blockchain. Figure 1 characterizes the chain of blocks for block 1, 2, and 3 out the nth block.

Figure 1 Blockchain

This simple example clearly shows the three elements of a block as previously defined. The data contained in Block 1 is the text “Hello”. Using an undefined hash, a unique hash is created. Because this is the first block in the chain there is no previous hash. Therefore, its hexadecimal value must be 0000. The first block in a Blockchain is called the genesis block. The second block, Block 2 reflects a change to the data in Block 1 which now contains Hello World. As expected the hash value is different because of the change and the previous hash now lists the hash value for Block 1. The third block, Block 3 reflects yet another change although this time the change corresponds with a modification to the font type data contained in Block 2 which is now shown in all caps. Again, the change drives the creation of a new hash and the storage of the previous blocks hash. This process will continue for as long as changes to leading blocks occur out to the nth block.

Now suppose that a change was made to the data in Block 2 as shown in Figure 2.

Figure 2 Blockchain Tampering

By design the Blockchain does not consider changes like this to be acceptable. As previously noted, a change must be instantiated as a new record or “block” like in Figure 1. Once a block has been created its contents are considered read-only. Figure 2 indicates that the previous hash contained in Block 3 no longer matches the hash contained in Block 2. This results in Block 2 being marked as an invalid block and subsequently all blocks that follow out to the nth block are treated the same.

Proof of Work (PoW)

Unfortunately, this simple check is not enough to protect the Blockchain from changes to its blocks. Due to the incredible speed at which computers can process information it is possible for a change to be made to any given block in a chain while simultaneously modifying all the preceding blocks to create the illusion that nothing has occurred. The solution to this problem is called PoW. PoW takes advantage of the fact that the computer’s ability to make these changes relies entirely upon the speed at which it’s capable of processing. To mitigate this risk PoW slows down the rate at which new blocks can be created. This latency acts as a buffer and prevents blocks from being tampered with (Decuyper, 2017).

Decentralization

An added layer of security on top of PoW that protects the integrity of the Blockchain is its distributed-ness. Instead of the Blockchain being stored on a single centralized node it is shared on a Peer to Peer (P2P) network. Figure 3 shows the topology of a P2P network comprised of four people.

Figure 3 P2P Network Topology

A P2P network is a distributed network of computers configured such that they can share certain types of data with any of the selected users who are a part of the network. In the case of a Blockchain database, users are defined as nodes participating in the P2P system network. When a new node joins the network, they must receive a copy of the Blockchain which has records and equates to proof for every change that was ever recorded on it. Figure 4 shows each of the nodes on the network and their matching copies of the Blockchain.

Figure 4 Distributed Blockchains

When a new block is created by an individual on the network a copy of that block is sent to each node on the network as shown in Figure 5.

Figure 5 Adding a New Block

Consensus

When a block is received each node on the network verifies it to make sure it hasn’t been tampered with. If the new block is proven to be identical for each users’ copy of the Blockchain then it is considered valid and each node adds it to their copy of the Blockchain. This process of verifying the integrity of the Blockchain is call consensus. Once more than fifty percent of the nodes on the P2P network have reached consensus that the block is valid the block becomes accepted. Through consensus nodes can determine which blocks are valid and those that are not. If blocks are tampered with they will be rejected by other nodes in the network. (Decuyper, 2017).

Blockchain Providing Authentication for the IoT

Reliable authentication is a common obstacle for systems participating in the IoT. Whether you’re dealing with centralized networks, supply chains, or combat systems the inability to authenticate can be the difference between success and failure or life and death. The use of hashes, PoW, decentralized P2P networks, and consensus make Blockchain a very safe and secure way to store and maintain data for the IoT.

To successfully tamper with a Blockchain a bad actor would need to first change all the blocks on the chain, then redo the PoW for each of the newly modified blocks, and finally control more than fifty percent of all the nodes on the P2P network. With these security guards in place that is just about impossible to do. (Decuyper, 2017). The data on a Blockchain represents the truth and the IoT depends on information like this to function properly. System operability is highly dependent upon seamless transmission/receipt of secure and authentic data. Blockchain meets this need. IoT Industry’s dealing with data or transactions of any kind are likely to be disrupted by use cases based on Blockchain technology.

--

--

Nicolas Malloy

AV System Safety Engineer | Passionate about Resilience Engineering and Data Science