Home Architecture The Architecture of Blockchain..(4/5)

The Architecture of Blockchain..(4/5)

by vamsi_cz5cgo

The easiest, as well as the most comprehensive way, to define the Blockchain (BC) would be to to call it a “a highly secure, resilient, algorithmic & accurate globally distributed ledger (or global database or the biggest filesystem or the largest spreadsheet) that provides a foundational infrastructure pattern to build multiple types of applications that help companies (across every vertical), individuals and society discover new business models, transact, trade & exchange information & assets. “

Why is the Blockchain such a terrific innovation? 

The creation of the Blockchain by the eponymous Satoshi Nakamoto is nothing short of a work of disruptive genius. While Satoshi’s goal was to create a currency (bitcoin) that did not need a central authority to create, validate & maintain, the architecture as laid out provides the chassis for running truly distributed applications that eliminates the need for 3rd party verification – thus establishing a true peer to peer economy.

Let us consider Banking as we have known and understood it for almost 400 years.

Banking is a system of intermediaries across the spectrum – ranging from payment networks (e.g Mastercard, Visa etc) to Clearinghouses in Capital Markets to Banks etc . And the reason these intermediaries exist is to establish trust between two parties who do not know each other. Thus currency or any other financial instrument created without the need for a central authority needs to be protected from fraud & abuse. In Banking, large institutions stand behind and protect payment systems.

The Blockchain serves that purpose in the realm of the Bitcoin and stands behind every bitcoin ever created by maintaining the proof of ownership.The innovation is it’s openness yet it’s security which ensures that the currency is tamper proof.

Prior to Blockchain, two important shortcomings had hindered the development of a truly secure digital currency.

These are  – 

  1. Currency Counterfeiting  – The problem of double spending that allowed the copy and reuse (effectively counterfeiting) of digital currency again and again (much like an mp3 file) after issue. What is different with bitcoin is that once a bitcoin has been purchased or transferred anywhere in the world – ownership is established and recorded authoritatively via the Blockchain . The Blockchain operates at such a massive scale which makes it virtually impossible (and cost prohibitive) to hack or otherwise break into bitcoin. Thus there is no need for a central 3rd party to a issue, authenticate and validate ownership of the currency.
  2. Who is the definitive legal owner of a given unit of Currency ? – For a peer to peer currency to truly work, each member of the millions of global nodes must be in agreement about the ownership of every unit of the currency & the total number of coins any member owns at any given time. This problem of global consensus (also called the Byzantine Generals problem) in a distributed network is solved by the Blockchain. The Blockchain leverages peer to peer communication to achieve consensus on transaction blocks every 10 minutes (avg) while processing newer blocks constantly as business transactions occur using Bitcoin (or any of the other AltCoins).  Specialized nodes called Miners perform the issue of new units of currency while simultaneously performing large & complex calculations. Doing these ensures that the Miner node(s) can mine a block of transactions during the same time. The benefit to the Miners is that they can keep the transaction fees associated with that block as a reward. It is almost impossible for this system to be broken into as it is in the interest of all the miners to form a distributed consensus based on valid block information. This capability is termed as the proof of work

Blockchain Architecture Considerations:

When one examines the architecture of Blockchain, a few important design aspects that need to be discussed are –

  1. The Blockchain platform itself
  2. The role of Nodes in constituting the overall blockchain & the Node discovery process
  3. Transactions that make up the blocks running in the Nodes
  4. Security implementation that generates the Blocks
  5. The process of adding newer blocks to the Chain

BC_WireTransfer

               Illustration 1 –  Wire Transfer of Bitcoin using the Blockchain shared ledger

Lets examine each of these in the context of the current public blockchain in terms of an end to end transaction shown below. It is my expectation that other kinds of blockchain variants will leverage the current technology as a foundational design pattern while layering in their own industry or consortium specific requirements.

Blockchain Platform:

The Blockchain itself is an application that runs on a network of distributed servers. The core application is a transaction database modeled as a secure ledger,  that is shared by all nodes (servers) that run the full stack install. It is thus a 100% decentralized transaction system that acts as a highly transparent ledger. Any node running the Blockchain software can run the entire Blockchain locally. While the Blockchain client uses Google’s LevelDB database to store metadata internally – the Blockchain data can be stored in a flat file or in a relational DB depending on user preferences.

The below architecture diagram broadly captures the 3 main layers of the Blockchain along with their roles.

BCArch

                        Illustration 2 – Blockchain Architectural Layers (Click to enlarge)

Once installed on a server, the full Blockchain client syncs up with other nodes in the network. From then onwards the particular server maintains all and any transaction records conducted using bitcoins (or any other application running on the Blockchain). The integrity and chronological order of the transactions (& the addresses owning the currency) are enforced by strong cryptographic rules. As stated above, the Blockchain software operates at such a massive scale which makes it virtually impossible (and cost prohibitive) to hack or otherwise break into bitcoin or any other application running on it. Thus there is no need for a central 3rd party to a issue, authenticate and validate ownership of the currency.

The nodes in the overall network use the peer-to-peer IP network to process and verify transactions. When several nodes all have the same blocks in their individual databases, they are considered to be in consensus.

Nodes in the Blockchain:

Blockchain is a peer to peer (P2P) network working on the IP protocol on the internet. A P2P network is essentially a flat topology with no centralized node, hierarchy, or special server node. All nodes equally provide & can consume services while collaborting via a consensus service.

As discussed above, the nodes in the blockchain play the role of a Central Bank or a  trusted third party.  Every node maintains a fully replicated copy of a database that contains the payment history of every bitcoin ever created along with ownership information. As transactions happen using the currency, a consensus mechanism essentially dictates how nodes agree on blockchain updates.

The graphic below shows the current number of nodes active in the bitcoin network and their locations on the globe.

BC_Nodes_         Illustration 3 – Blockchain Nodes – Jan 25,2016 [4]

Though the blockchain enforces an equal structure among all the nodes that are part of the network, nodes can play different roles based on their flavor or business intention.

Thus,  there are 4 basic node types as depicted in the below illustration.It is to be noted that all of the node types discover and maintain connections with peers & also validate blocks.

Full nodes maintain a complete copy of the blockchain database and can verify any transaction without the need for an external lookup. On the other end of the spectrum, nodes that only store a subset of the blockchain database verify transactions using a method called Simplified Payment Verification (SPV).

Nodes of type Miners perform the core process by which transactions are confirmed & processed and eventually included in the blockchain. To be confirmed as valid, transactions are first packed in a data structure & format called a Block that has to satisfy strong cryptographic rules that are verified by the blockchain network. Cryptography also prevents already committed blocks from being further modified as doing so would invalidate all following blocks –  which protects system integrity. Mining also creates an implicit meritocracy in that systems which can process transactions faster and more efficiently get credited for them. For applications like bitcoin, rollbacks currently are almost impossible in the vanilla blockchain architecture – which is a current limitation.

The miner node concept is unique to blockchain as it confers it a high level of security because short of controlling more than half the miner nodes affectionately termed the “51% attack ” (which is a computationally impossible feat to perform at scale), the network cannot be compromised or taken over.

Network Protocol Stack: Once nodes are booted up, they perform a peer discovery to contact any other valid node using a given port over TCP. The Blockchain stack is depicted below and is layered on the OSI stack. The Blockchain Message Exchange specifies the handshake logic between nodes as well as the serialization format for messages exchanged over the wire.

The Blockchain Overlay Network provides higher level semantics that allow multiple types of blockchains (public, vertical specific & private blockchains) to co-exist as well as provides management abstraction for the same. Developers will essentially use this layer to extend vanilla blockchain to support other kinds of applications which can leverage the existing bitcoin blockchain to validate their transactions. E.g. Other kinds of virtual currency, sidechains etc.

BC_Network
Illustration 4- Blockchain Network Architecture  (Click to enlarge)

Transactions and Blocks: 

Applications, the first among them being Bitcoin use blockchain to timestamp transactions. The blockchain implementation consists of two kinds of records: transactions and blocks.

Salient features of transactions –

  1. Transactions can be created on the behalf of any client using a Mobile Wallet or any other client application
  2. Transactions contain the actual business data to be stored in the blockchain
  3. Blocks record the sequence of transactions in the blockchain. Transactions are journaled into the blockchain based on specific sequences
  4. Miner nodes create blocks as discussed in the above section

BC_Transaction

                 Illustration 5- Transactions are converted into Blocks  (Click to enlarge)

The above illustration depicts how currency transactions are converted into blocks. As can be seen,once a transaction (typically a kiosk purchase or wire transfer or credit card payment etc) is submitted into the system, a transaction (say Transaction A) is generated that is pushed into the blockchain node network. A miner node(s) intercepts this to do some sanity checking, once done and it is determined that this is a legit transaction, it is fed into a cryptographic hash function as depicted to generate a unique string of digits. It is then also be combined with other transactions as shown. The generated hash is then stored with other metadata into the header of a data structure called a block. The header is key as it becomes the basis for running the hash function again to create a child block.

The hash function is used as the math puzzle that the miners race to solve by looking over virtually trillions of possibilities. The miner that solves it first submits it for a check by other nodes and once confirmed, the block is stored into the blockchain for posterity. The miner node is then credited a very small percentage of the transaction as fees.

While that ends our view into the main architectural underpinnings of Blockchain, the next & final post in this series will take a broad look at the innovation that will likely be unleashed by the  Blockchain across the industry. We will also discuss what steps CXO’s & IT managers need to take to avoid being disrupted by startups in this area. 

References: 

[1] https://blockchain.info/api
[2] https://bitcoin.org/en/developer-reference
[3]”Mastering Bitcoin” – Andreas Antonopoulus – O’Reilly Press
[4]https://bitnodes.21.co
[5] https://en.wikipedia.org/wiki/Bitcoin_network
[6] https://en.wikipedia.org/wiki/Block_chain_(database)

Discover more at Industry Talks Tech: your one-stop shop for upskilling in different industry segments!

You may also like

2 comments

Mugimu July 13, 2018 - 9:04 am

Thank you for sharing such valuable information with us. It’s of great importance to Cryptocurrency and Blockchain newbies. With such articles, they will never stop learning. I strongly recommend those willing to start a new chapter in mining at webchain.network to read it. Webchain is one of the new Blcokchain Projects that was released a few weeks ago.

Reply
Abduljabbar Alsharif October 12, 2018 - 2:56 am

Thank you for sharing such valuable information with us. It’s of great importance to Cryptocurrency and Blockchain newbies. With such articles, they will never stop learning. I strongly recommend those willing to start a new chapter in mining at webchain.network to read it. Webchain is one of the new Blcokchain Projects that was released a few weeks ago

Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.