{"id":2689,"date":"2020-01-11T18:08:29","date_gmt":"2020-01-11T12:38:29","guid":{"rendered":"http:\/\/navveenbalani.dev\/?p=2689"},"modified":"2020-01-11T19:44:50","modified_gmt":"2020-01-11T14:14:50","slug":"blockchain-reference-architecture","status":"publish","type":"post","link":"https:\/\/navveenbalani.dev\/index.php\/articles\/blockchain-reference-architecture\/","title":{"rendered":"Blockchain Reference architecture"},"content":{"rendered":"\n<p>Blockchain design of today has moved beyond <a href=\"https:\/\/www.google.co.in\/search?dcr=0&amp;q=cryptocurrency&amp;spell=1&amp;sa=X&amp;ved=0ahUKEwjZxLyO-5fXAhUSTY8KHRSkDDIQvwUIJCgA\">cryptocurrency<\/a>. It has evolved into a platform that supports industry-wide use cases suitable for public and enterprise needs. The reference architecture shown below will serve as a foundation for building or implementing blockchain applications for industry-wide use cases. It depicts a layered architecture that provides components and services necessary to implement blockchain applications for enterprise needs. It can be used to develop a blockchain of single or multiple networks (involving multiple business units or organizations) based on the business goals and objectives. One can follow the reference architecture to design both permissioned (private) as well as permissionless (public) blockchain applications.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" width=\"1024\" height=\"682\" src=\"https:\/\/navveenbalani.dev\/wp-content\/uploads\/2019\/12\/Arch-1024x682.jpg\" alt=\"\" class=\"wp-image-2752\" srcset=\"https:\/\/navveenbalani.dev\/wp-content\/uploads\/2019\/12\/Arch-1024x682.jpg 1024w, https:\/\/navveenbalani.dev\/wp-content\/uploads\/2019\/12\/Arch-300x200.jpg 300w, https:\/\/navveenbalani.dev\/wp-content\/uploads\/2019\/12\/Arch-768x511.jpg 768w, https:\/\/navveenbalani.dev\/wp-content\/uploads\/2019\/12\/Arch.jpg 1766w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2><\/h2>\n\n\n\n<p>The above reference architecture can be used to build any blockchain\napplications. The architecture is divided into logical layers of importance.\nThese layers are Application, Smart Contract, Integration, Distributed Ledger\nand Security. Let\u2019s look at each of these layers and its components:<\/p>\n\n\n\n<h3><a>Application<\/a> <\/h3>\n\n\n\n<p>The application layer is where your end user or\nclient application sits. The client application typically kick starts your\nbusiness workflow by initiating a transaction. The transactions are executed by\nthe nodes using smart contract. The client application could be implemented in any\nsoftware language and can run on a wide variety of operating systems. The\napplication could use a command line interface (CLI) tool as provided by any\nblockchain framework implementation or it could use language specific SDK\n(Software Development Kit) to communicate with nodes on the network. As the\nblockchain evolves beyond its traditional image of digital crypto currency\nbased network, we are seeing different types of clients and tools supporting\nthe blockchain framework. The client application can also listen to various\ntypes of events occurring on the blockchain network and perform the necessary\nactions on those events. The event may be as simple as providing status update\nto the application from the network. One can also have a separate dedicated application\nto monitor the blockchain network.<\/p>\n\n\n\n<h3><a>Smart\nContract<\/a><\/h3>\n\n\n\n<p>Smart contract is a software code that represents\ntransactions in the blockchain network. It is a collection of business rules or\nconditions that are invoked by the nodes in the blockchain network. Smart\ncontract can have its own execution runtime or a virtual machine environment.\nIt can be made to run in a secured context, like a virtualized container. Smart\ncontract can be implemented in any software languages, the popular being, but\nnot limited to, Java, Python, Go, JavaScript and Scala. Smart contract can be\nalso written as services and placed in registries so that client can look up\nfor the same in a location independent way. The registries can be secured, and\naccess can be controlled so that only authorized clients can act upon that\ncontract. Smart contract itself can be made secured using cryptographic hash algorithms\nso that it\u2019s content (software code and related metadata) are made\nconfidential. Smart contract can also be programmed to communicate or broadcast\ntransaction state transitions in the form of events. It could be lifecycle\nevents of the contract itself. The application client can listen to these\nevents and handle them accordingly.<\/p>\n\n\n\n<h3><a>Integration<\/a> <\/h3>\n\n\n\n<p>In today\u2019s world of disruptive technologies where\napplication integration and communication has become so imperative, no one\nplatform can stand in isolation. Blockchain is no different. Blockchain network\nshould be able to access any data outside of the network. The data could be\npart of any external application or system that can provide significant value\nto the blockchain workflow. Similarly, external system must also be able to\ncommunicate with the blockchain network. One approach could be to setup an\nexternal event hub, as a medium to exchange data with external systems through\nevent processing. An external application can listen on to a specific event on\nthe hub and accordingly perform some task. On the other hand, a smart contract\ncan listen to events coming from external systems and accordingly execute the\nbusiness function. The following section explains some other interesting use\ncases in the integration scenario:<\/p>\n\n\n\n<h4><a>Artificial\nIntelligence (AI) Integration<\/a><\/h4>\n\n\n\n<p>Blockchain as we know is essentially a\ndistributed ledger with a decentralized and automated approach towards\ntransaction settlement process based on consensus. So, where does AI fits into\nblockchain? AI can be influenced by data. Blockchain is a database with loads\nof transactions that can be made available to branches of AI like machine learning\nthat can apply complex algorithms on data to optimize a particular business\nfunction. The branch of AI can also be used to improve the overall business\nprocess or workflow. AI algorithms can detect significant anomalies and perform\npredictive modeling or analysis to find indicators that can reduce the transaction\ncost and increase the revenue of business for all parties across the blockchain\nnetwork. AI solutions can also be employed for consensus between systems that\nneed to work autonomously.&nbsp; The\ncombinatorial power of AI and blockchain could be a real game-changer in the\nfuture.<\/p>\n\n\n\n<h4><a>Cloud\nIntegration<\/a><\/h4>\n\n\n\n<p>Blockchain architecture can be extended to\nimplement a component hosted on the cloud that can provide application\nintegration services like routing, data transformation, protocol translation,\nextended certificate authority etc. This component can act as a middleware,\noffering its capabilities as a \u2018blockchain as a service&#8217; function in the cloud.\nThe blockchain implementation can provide adapters to connect to the middleware\ncomponent from within the blockchain network and outside of the network.&nbsp; The blockchain middleware component can be\nhosted in a secured \u2018sandboxed\u2019 environment or inside a secured virtualized container.\nAn external application can interact with the blockchain middleware using\nadapters and upon obtaining valid certificates to access the blockchain\nnetwork.<\/p>\n\n\n\n<h4><a>IoT\nintegration<\/a><\/h4>\n\n\n\n<p>A new wave of integration will involve arbitrary\ndevices to communicate with the blockchain network. Different types of IoT\ndevices or sensors can inject data into the blockchain network that can then be\nvalidated by the blockchain nodes. A standardized middleware can be implemented\nthat can take the data from the device and perform the necessary conversion and\ntransformation of data as required by the blockchain network. The peers or the\nnodes in the blockchain network can then go about validating this data using a\nspecific consensus algorithm using smart contracts.<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>Note &#8211; For more details on blockchain &amp; IoT\nintegration, refer to this overview article &#8211; <a href=\"http:\/\/naveenbalani.com\/index.php\/articles\/blockchain-and-enterprise-iot\/\">http:\/\/navveenbalani.com\/index.php\/articles\/blockchain-and-enterprise-iot\/<\/a><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h3><a>Distributed\nLedger<\/a> <\/h3>\n\n\n\n<p>This distributed ledger is the core persistent\nlayer in the blockchain architecture. It provides a decentralized and\ndistributed database containing the transaction entries. These entries are\nrecorded in the order of its occurrence and composed into hashed blocks. The\ndatabase or the ledger, therefore, represents a chain of hashed blocks of\ntransactions with each block referring to the previous block in the chain. The\nledger is shared across the blockchain network, which means every node has a\ncopy of the ledger, and each node verifies the transactions independently. When\nevery node agrees and confirms the authenticity of the transaction, the ledger\nis said to be in consensus.&nbsp; The\nblockchain network uses different consensus algorithms to arrive at the\nconsensus. The consensus algorithm is a set of rules and conditions that\ngoverns the transaction. The blockchain network implemented for the public has\na permissionless ledger, while in a private network or a consortium, a ledger\ncan be made permissioned. A permissioned ledger introduces some form of access\ncontrol in the way transactions are accessed and managed.<\/p>\n\n\n\n<h4><a>Ledger\nConduits<\/a><\/h4>\n\n\n\n<p>For a permissioned-based blockchain network, one can implement a\npattern called ledger conduits. Conduits can be thought of as private channels\nin the blockchain network where two or more nodes perform transactions even\nmore privately. The nodes must be members and authorized to use these conduits.\nConduits are small networks inside a large network. Such a pattern further\nenforces security when implementing blockchain in an enterprise.<\/p>\n\n\n\n<h4><a>Consensus\nAlgorithms<\/a><\/h4>\n\n\n\n<p>The blockchain network typically is governed by anonymous entities or\nnodes that are not trusted. The consensus is all about providing the trust\nfactor in the network. Each node can update the blockchain network with data in\nthe form of transaction that eventually needs to be verified before it can be\nofficially recorded as part of block in the ledger. There are different\nconsensus algorithms that convey how the block (of transactions) is created and\nvalidated, thereby enforcing trust in the network.<\/p>\n\n\n\n<h5><a>Practical Byzantine Fault\nTolerance (PBFT)<\/a><\/h5>\n\n\n\n<p>This is the consensus based on majority. Each node updates and\nvalidates the blockchain network based on certain given set of rules or\nconditions. If majority of the nodes in the network reflects the same result\nupon update, then the network is said to be in consensus. There could be few\nrogue nodes that could violate the network rules, but their outcome is not\naccepted as it goes against the accepted algorithm. The algorithm should\nfulfill the necessary conditions, and all the nodes must agree and execute the\nsame conditions to derive at the desired output.<\/p>\n\n\n\n<h5><a>Proof-of-work (PoW)<\/a><\/h5>\n\n\n\n<p>One of the first and traditional algorithms devised is the\nProof-of-Work. Bitcoin-based blockchain network and Ethereum use this algorithm.\nUnlike PBFT, PoW does not need consensus based on majority. It is an algorithm\nthat takes enormous computing effort. Only nodes with greater computing power\ncan take up the PoW. The first node that completes the task with the desired\noutput gets a chance to create the block and is compensated for its efforts.\nPoW typically involves some kind of cryptographic hashing to achieve the\ndesired target or outcome. We will talk of PoW in detail in Chapter 2.<\/p>\n\n\n\n<h5><a>Proof-of-Stake (PoS)<\/a><\/h5>\n\n\n\n<p>With PoW, one needs enormous computing power that results in high-energy\nconsumption. This may not be desirable. PoS overcome this by providing an\nalternative approach called the stake of the user. The user possessing or\nowning highest digital currencies (or some asset) gets a chance to create the\nblock in the blockchain network. So instead of investing in high power\ncomputing nodes, one can rather buy out cryptocurrency (or own assets) and\nincrease their stake to validate and create a block of transactions.<\/p>\n\n\n\n<p><strong>Security<\/strong><\/p>\n\n\n\n<p>We talked about security earlier in the components of blockchain\nsection. Security is one of the important components in the blockchain\narchitecture. Based on the implementation of blockchain &#8211; whether\npermissionless or permissioned, required security and consensus strategies are\napplied. In public blockchain, every node can participate in the network, while\nin the permissioned network you have some form of access control that only\nallows required nodes to participate in a transaction. <\/p>\n\n\n\n<p>Every entity in the blockchain network must be bound to an identity.\nIn a permissionless network, entities are typically restricted to users\nparticipating in the transaction, while in case of a permissioned network, the\nentities comprise of organization, nodes, users and anything that has a role to\nplay in the blockchain network. <\/p>\n\n\n\n<p>For a permissioned blockchain, Public Key Infrastructure (PKI)\nplatform can be used where a trusted Certificate Authority (CA) can issue\ncrypto credentials. The crypto credentials could take the form of certificates\nand keys. Private keys can be used for signing and public key for verification.\nIt results in a trusted network where all the participants know who they are\nand their roots of trust. Now as the parties involved in the blockchain network\nmight leverage their own crypto credentials, possibly setting up their own CA,\nit is essential that the blockchain implementation provides a plug-and-play\nservice or a level of abstraction to effectively manage, verify and validate\nentities using different security mechanism across the network.&nbsp;&nbsp; <\/p>\n\n\n\n<p>In short, the blockchain security should be equipped with five effective measures viz. authentication, access control, integrity, confidentiality, and non-repudiation. <\/p>\n\n\n\n<p>In the next series, we will go over how to build applications using Hyperledger fabric and Ethereum &#8211; <\/p>\n\n\n\n<p>Building Blockchain Applications Using HyperLedger &#8211; <br> <a href=\"https:\/\/navveenbalani.dev\/index.php\/articles\/introduction-to-hyperledger-fabric\/\">https:\/\/navveenbalani.dev\/index.php\/articles\/introduction-to-hyperledger-fabric\/<\/a><\/p>\n\n\n\n<p>Building Blockchain Applications Using Ethereum &#8211; <br> <a href=\"https:\/\/navveenbalani.dev\/index.php\/uncategorized\/building-blockchain-applications-using-ethereum\/\">https:\/\/navveenbalani.dev\/index.php\/uncategorized\/building-blockchain-applications-using-ethereum\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Blockchain design of today has moved beyond cryptocurrency. It has evolved into a platform that supports industry-wide use cases suitable for public and enterprise needs. The reference architecture shown below will serve as a foundation for building or implementing blockchain applications for industry-wide use cases. It depicts a layered architecture that provides components and services [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2693,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[3,174],"tags":[286],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v16.0.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Blockchain Reference architecture - Current and Future Technology Trends by Navveen Balani<\/title>\n<meta name=\"description\" content=\"Blockchain Reference architecture - Articles\" \/>\n<link rel=\"canonical\" href=\"https:\/\/navveenbalani.dev\/index.php\/articles\/blockchain-reference-architecture\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Blockchain Reference architecture - Current and Future Technology Trends by Navveen Balani\" \/>\n<meta property=\"og:description\" content=\"Blockchain Reference architecture - Articles\" \/>\n<meta property=\"og:url\" content=\"https:\/\/navveenbalani.dev\/index.php\/articles\/blockchain-reference-architecture\/\" \/>\n<meta property=\"og:site_name\" content=\"Current and Future Technology Trends by Navveen Balani\" \/>\n<meta property=\"article:published_time\" content=\"2020-01-11T12:38:29+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-01-11T14:14:50+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/navveenbalani.dev\/wp-content\/uploads\/2019\/12\/image-45.png\" \/>\n\t<meta property=\"og:image:width\" content=\"342\" \/>\n\t<meta property=\"og:image:height\" content=\"252\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\">\n\t<meta name=\"twitter:data1\" content=\"10 minutes\">\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/navveenbalani.dev\/#website\",\"url\":\"https:\/\/navveenbalani.dev\/\",\"name\":\"Current and Future Technology Trends by Navveen Balani\",\"description\":\"Current and Future Technology Trends by Navveen Balani\",\"publisher\":{\"@id\":\"https:\/\/navveenbalani.dev\/#\/schema\/person\/51f7ab14b20611d95e3c7fd4ea0950bf\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/navveenbalani.dev\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/navveenbalani.dev\/index.php\/articles\/blockchain-reference-architecture\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/navveenbalani.dev\/wp-content\/uploads\/2019\/12\/image-45.png\",\"width\":342,\"height\":252},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/navveenbalani.dev\/index.php\/articles\/blockchain-reference-architecture\/#webpage\",\"url\":\"https:\/\/navveenbalani.dev\/index.php\/articles\/blockchain-reference-architecture\/\",\"name\":\"Blockchain Reference architecture - Current and Future Technology Trends by Navveen Balani\",\"isPartOf\":{\"@id\":\"https:\/\/navveenbalani.dev\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/navveenbalani.dev\/index.php\/articles\/blockchain-reference-architecture\/#primaryimage\"},\"datePublished\":\"2020-01-11T12:38:29+00:00\",\"dateModified\":\"2020-01-11T14:14:50+00:00\",\"description\":\"Blockchain Reference architecture - Articles\",\"breadcrumb\":{\"@id\":\"https:\/\/navveenbalani.dev\/index.php\/articles\/blockchain-reference-architecture\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/navveenbalani.dev\/index.php\/articles\/blockchain-reference-architecture\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/navveenbalani.dev\/index.php\/articles\/blockchain-reference-architecture\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/navveenbalani.dev\/\",\"url\":\"https:\/\/navveenbalani.dev\/\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"position\":2,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/navveenbalani.dev\/index.php\/articles\/blockchain-reference-architecture\/\",\"url\":\"https:\/\/navveenbalani.dev\/index.php\/articles\/blockchain-reference-architecture\/\",\"name\":\"Blockchain Reference architecture\"}}]},{\"@type\":\"Article\",\"@id\":\"https:\/\/navveenbalani.dev\/index.php\/articles\/blockchain-reference-architecture\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/navveenbalani.dev\/index.php\/articles\/blockchain-reference-architecture\/#webpage\"},\"author\":{\"@id\":\"https:\/\/navveenbalani.dev\/#\/schema\/person\/51f7ab14b20611d95e3c7fd4ea0950bf\"},\"headline\":\"Blockchain Reference architecture\",\"datePublished\":\"2020-01-11T12:38:29+00:00\",\"dateModified\":\"2020-01-11T14:14:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/navveenbalani.dev\/index.php\/articles\/blockchain-reference-architecture\/#webpage\"},\"publisher\":{\"@id\":\"https:\/\/navveenbalani.dev\/#\/schema\/person\/51f7ab14b20611d95e3c7fd4ea0950bf\"},\"image\":{\"@id\":\"https:\/\/navveenbalani.dev\/index.php\/articles\/blockchain-reference-architecture\/#primaryimage\"},\"keywords\":\"blockchain-guide\",\"articleSection\":\"Articles,Blockchain\",\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/navveenbalani.dev\/#\/schema\/person\/51f7ab14b20611d95e3c7fd4ea0950bf\",\"name\":\"Navveen\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/navveenbalani.dev\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/navveenbalani.dev\/wp-content\/uploads\/2019\/07\/navveen_balani.jpeg\",\"width\":200,\"height\":200,\"caption\":\"Navveen\"},\"logo\":{\"@id\":\"https:\/\/navveenbalani.dev\/#personlogo\"},\"sameAs\":[\"http:\/\/naveenbalani.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/navveenbalani.dev\/index.php\/wp-json\/wp\/v2\/posts\/2689"}],"collection":[{"href":"https:\/\/navveenbalani.dev\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/navveenbalani.dev\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/navveenbalani.dev\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/navveenbalani.dev\/index.php\/wp-json\/wp\/v2\/comments?post=2689"}],"version-history":[{"count":7,"href":"https:\/\/navveenbalani.dev\/index.php\/wp-json\/wp\/v2\/posts\/2689\/revisions"}],"predecessor-version":[{"id":2913,"href":"https:\/\/navveenbalani.dev\/index.php\/wp-json\/wp\/v2\/posts\/2689\/revisions\/2913"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/navveenbalani.dev\/index.php\/wp-json\/wp\/v2\/media\/2693"}],"wp:attachment":[{"href":"https:\/\/navveenbalani.dev\/index.php\/wp-json\/wp\/v2\/media?parent=2689"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/navveenbalani.dev\/index.php\/wp-json\/wp\/v2\/categories?post=2689"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/navveenbalani.dev\/index.php\/wp-json\/wp\/v2\/tags?post=2689"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}