How Blockchain Works

Writers Note: To get the most out of this post, read it once from start to finish (it is short).  Do not worry about total comprehension on the first pass.  Definitions and descriptions of a semi-complex system are not meant to be comprehended in less than 5 minutes so take the extra 5 minutes and read it again.   Doing so will help you will learn and comprehend.  Thank me later with comments and questions.  Thank you! 

As discussed in my previous blog post, “The History of Blockchain,” Blockchain has been in development since the idea first came into fruition in 1991 when Stuart Haber and Scott Stornetta wrote a paper titled “How to Time-Stamp a Digital Document.”  Now, in 2022, blockchain technology has been deployed across many industries.  

We see supply chain management and verification of its providence (i.e. knowing where your coffee beans came from).

We see cryptocurrency being used to buy and sell normal goods. 

We see international money transactions, changing from one currency to another, occurring faster, and with fewer fees because blockchain has automated the transaction and made it transparent to all parties.  

So how does it work?

Some quick technical jargon…

Blockchain is a system in which a record of transactions is made and maintained across several computers or servers that are linked in a peer-to-peer network (P2P).

This system creates an immutable ledger that facilitates the process of tracking transactions or assets. 

Assets can be tangible (house, land, car, cash, jewelry ) and intangible (NTF’s, patents, copyrights, branding).

Key elements that make up a blockchain are: 

Distributed ledger technology, also referred to as DLT,  is a consensus of replicated, shared, and synchronized digital data geographically spread across multiple sites, or institutions.   There is no central clearing authority.   

With immutable records, no participant can change or alter a transaction after it has been recorded in the shared ledger.  If an error is found, a new transaction is recorded to correct the error. Both transactions then remain visible on the blockchain ledger.

Smart contracts are computer programs that are hosted and executed on a blockchain network. Each smart contract consists of code specifying predetermined conditions that, when met, trigger outcomes. 

Common terms used to describe the blockchain are:

A Peer to Peer Network (P2P) is a group of devices (nodes) that collectively share and store files.  Each node acts as an individual peer.  There is no central administration or server.  P2P networks are the backbone of most cryptocurrencies.  There are two main types, structured and unstructured. 

In a Structured Peer to Peer Network, the nodes are organized.  Each node can search the network for desired data.

In an Unstructured Peer to Peer Network, random nodes connect to each other.  Unstructured P2P Networks are less efficient than Structured P2P Networks.

A Decentralized Ledger is a consensus of shared and replicated data synchronized geographically across multiple sites, countries, or institutions.   There is no central administrator, and transactions and transactions can have a public “witness.”   

Decentralized ledgers are less prone to fraud attacks than centralized ledgers.  A centralized ledger has a single point of failure whereas a decentralized ledger has multiple nodes (devices) to prevent it.

Networks (1)

A Digitally Distributed Database appears to use a single server but is a set of two or more servers that can be accessed and simultaneously modified via a network.  There are two types:  Homogeneous and Heterogeneous databases AND two ways that the data is stored on the databases (replication and fragmentation). 

In a Homogeneous database, all sites store the database identically. Additionally, the operating systems and database management systems are all the same.

In a Heterogeneous database, different sites can use different software and schema.  One site may be unaware of other sites.  Different computers could be using different operating systems and applications. 

When data is stored redundantly at two or more sites it is called “Replicated data.”  In this instance, there is a full database at all sites.   Think of how you may have several copies of your favorite photos from your phone.  One set on the phone and another on the cloud.  If you took it a step further, you may have another copy in your safe deposit box at the bank.

When data is stored in smaller parts across different sites it is called “Fragmented data.”  In this instance, the data must be fragmented in such a way that they can be reconstructed to the original version.   There are two types of fragmentation, Horizontal and Vertical fragmentation.

Horizontal Fragmentation also called splitting by rows, assigns subsets of instances to different tables. 

Horizontal Fragmentation can increase efficiency by identifying in the table the instances that are rarely used and in essence “archive them.”  An example would be an employee that is no longer with the company and no longer needs to have payroll processed.  However, at the end of the year, tax information must be compiled and reported.

Vertical Fragmentation also called splitting by columns, assigns subsets of attributes to different tables.  Each column is known as a set or site, and every site must have at least one column in common.  This is often called the primary key attribute column. 

Vertical fragmentation can increase the efficiency of clusters of “frequently” used data.  For instance, employee data may include emergency contact information and other data points that are not used in processing payroll.  Segmenting them into a separate table reduces the table size and increases database efficiency. 

So how does all of this work together?

Blockchain, a type of distributed ledger technology enables businesses to engage in real-time data sharing.  This means that the ledger is always up to date.  

Adding “multiple nodes” that participate in the chain creates replication of data.  This increases transparency and decreases the likelihood of malicious hacking attacks being successful as there is not a single point of failure that can be exploited. 

After that throw in some rules that govern the chain.  

This is what it may look like…

Your fair trade coffee supply chain can verify the country of origin, the farm of origin, the initial shipping port, how long the beans were at sea, what port they came into, how long they sat at the port, the temperature of the shipping container, who picked up the container from the shipping yard, when and how long the container was in transit on the ground to the distribution center, and who checked the shipment in at the distribution center.

If the beans were shipped from the farmer at 1:00 PM and arrived too early or too late, the order is flagged.  How do we know?  The farmer scans a barcode and the data goes into the system when they are shipped from the farm.  Rule #1 and #2  Farmer name and time to destination.

If the temperature of the container is off, the order is flagged.  How do we know?  A wireless thermometer activates a “node” when the temperature gets above or below the acceptable level.  Wirelessly a signal is sent to the database.  Rule #3 Temperature in transit.

If Sam at the distribution center checked in the shipment and it did not match up with the time cards, a warning happens.  Rule #4 Employee verification. 

Take the same process and apply it to corporate management information systems, hotel chains, and franchise control and ordering systems.  

So how does blockchain work?  You use multiple nodes that work together, following a common set of rules to achieve the desired result.