Skip to main content

Blockchain Frameworks for Enterprise Application Development

Introduction
In the last few years there have been a number of articles and blogs around blockchain concepts, benefits of Distributed Ledger Technology (DLT), and real-world blockchain application use cases in industry verticals such as supply chain, finance, healthcare, etc. According to many industry pundits, 2018 will be the year of blockchain applications going mainstream. The goal of this post is to discuss the current popular open source blockchain application frameworks, their key features and which framework is suited for a business use case.

Blockchain Application Framework
The top two open source blockchain projects are Hyperledger and Ethereum. Hyperledger is a suite of many blockchain frameworks consisting of Hyperledger Sawtooth, Hyperledger Iroha, Hyperledger Fabric, Hyperledger Burrow, and Hyperledger Indy.

This post will cover the three popular frameworks:
  •        Hyperledger Sawtooth
  •        Hyperledger Fabric
  •        Ethereum
Hyperledger Sawtooth
Hyperledger Sawtooth makes it easy to develop and deploy an application by providing a clear separation between the programming layer and the core system. It provides Smart Contract abstraction that allows to write contract logic in multiple languages, including Go, Python, C++, Java, Rust and JavaScript. It also provides REST API thus allowing standard HTTP/JSON communication.

Key Architectural Elements of Sawtooth
  • Transaction validators - validates transaction blocks and ensures that transactions result in state changes that are consistent across all participant nodes in the network
  • Transaction processor - is the server-side business logic
  • Transaction families - are smart contracts consisting of both transaction processors (the server-side logic) and the clients (for use from Web or Mobile applications)
  • Transaction batches - are collection of transactions that are either all committed to state or all rejected if one or more transactions fail
  • Validator network layer - is responsible for communicating between validators in a Sawtooth network, including performing initial connectivity, peer discovery, and message handling
Key Features of Sawtooth
  • Permissions - Clusters of nodes can be easily deployed with separate permissions. The blockchain stores the settings that specify the permissions such as roles and identities, so that all participants in the network can access this information.
  • Parallel Transaction Execution - Majority of the blockchain transactions are executed in serial order but there may be few scenarios where transactions can be executed in parallel without causing double-spending even multiple modifications to the same state. Sawtooth provides an advanced parallel scheduler that splits transactions into parallel flows thus offering a substantial increase in performance.
  • Event System - Sawtooth supports creating and broadcasting events. The clients can subscribe to events that occur in the blockchain.
  • Ethereum Contract Compatibility with Seth - Seth (a Sawtooth integration project) extends the interoperability of the Sawtooth platform to Ethereum. The Ethereum Virtual Machine (EVM) smart contracts can be deployed to Sawtooth using the Seth transaction family.
  • Sample Transaction Families - The Sawtooth platform provide several core transaction families as models. Users can build custom transaction families for unique requirements of their ledgers.
Sawtooth Consensus Algorithm
Sawtooth comes with a default consensus algorithm Proof of Elapsed Time (PoET) or applications can bring their own consensus algorithms. PoET is a truly random lottery system that stochastically elects individual nodes to execute transactions.

Type of Sawtooth Blockchain Networks
A Sawtooth network be able to limit the nodes that can connect to it. The permissions rules determine the roles a node connection can play on the network. Based on the permissioned rules and identity roles, three types of networks can be defined in the Sawtooth deployment.
  • Public Network - In this network, all connections will be allowed, and all nodes can sign batches and transactions.
  • Consortium Network - In this type of network, only specific validators will be allowed to join the network and participate in consensus. The other nodes can connect to a validator and accept batches and transactions signed
  • Private Network - In this type of network, only specific validator (like consortium network) can join the validator network and participate in consensus. In addition, only certain nodes can connect to validators, submit transactions, or receive transactions.
Hyperledger Fabric
Hyperledger Fabric offers an enterprise-ready Distributed Ledger Technology (DLT) with network security, scalability, confidentiality and performance, in a modular architecture.

Key Features of Hyperledger Fabric
  • Identity Management - It provides a membership identity service that manages user IDs and authenticates all participants on the network. Additional layers of permission can be provided through Access Control Lists (ACLs).
  • Privacy and Confidentiality - For business use cases which require private, confidential transactions to coexist on the same network, Fabric offers private channels for restricted messaging paths.
  • Concurrency and Parallelism - Fabric separates transaction execution from transaction ordering and commitment. It executes transactions prior to ordering thus enabling each node to process multiple transactions simultaneously.
  • Modular Design - The modular design of Hyperledger Fabric allows to plug and play algorithms for identity, consensus and encryption.
Key Elements of Hyperledger Fabric
  • Channels - allows partition of data by allowing transaction visibility to nodes which are part of the channel. Each channel maintains an independent chain of transaction blocks.
  • Chaincode - also called Smart Contracts in other frameworks encapsulate both the asset definitions and the business logic or transactions. The chaincode is written in Go and JavaScript (node.js) programming language
  • Ledger - contains the current world state of the network and a chain of transaction invocations. A shared, permissioned ledger is an append-only system of records and serves as a single source of truth
  • Ordering service - is a collection of nodes that orders transactions into a block
  • World state - contains the current data about all the assets in the network. The data is stored in a database for efficient access. Current supported databases are LevelDB and CouchDB
  • Membership Service Provider (MSP) - manages the identity and permissioned access for clients and peers. The MSP make use of Certificate Authority, which is a pluggable interface and default interface is Fabric-CA API.
Hyperledger Fabric Consensus
The consensus in Fabric consist of three distinct steps:
  • Transaction endorsement - During this step, each endorsing peer simulates the proposed transaction, without updating the ledger. The endorsement policy is specified for a specific chaincode and different private channels can have different policies. During the simulation, the peers generate Read Write (RW) sets and return the signed RW sets back to the client which submitted the transactions
  • Ordering - In this step, the client submits the endorsed transactions and RW sets to the ordering service. The ordering service orders the information into a block and delivers the block to all committing peers. The ordering service is a pluggable architecture supporting implementations such as Solo, Kafka, and Simplified Byzantine Fault Tolerance (SBFT). The default is Kafka.
  • Validation and commitment - The committing peer validates the transaction by checking to make sure that the RW sets still match the current world state. After validation, the transaction is written to the ledger and the world state is updated with the RW set. Finally, client is notified about the success or failure.
Hyperledger Fabric SDKs
Currently Node.js and Java SDKs are provided. There are plans to offer SDKs in wide variety of programming languages.

Ethereum
A key feature of Ethereum is Ethereum Virtual Machine (EVM). Each node of the network runs the EVM and executes the same program. Ethereum incorporates many features and technologies that are like Bitcoin, while also implementing many modifications and innovations of its own. The Homestead release is the second major version of the Ethereum platform and is the first production release of Ethereum.

Elements of Ethereum
  • Ethereum Clients - Ethereum has multiple client implementations in various languages across a range of different operating systems. The language implementations include go-ethereum (Go), cpp-ethereum (C++), Parity (Rust), pyethapp (Python), ethereumjs-js (JavaScript), ethereumJ (Java), etc.
  • Connecting to Ethereum Clients - Ethereum clients expose several methods over JSON-RPC for interacting with them from within an application. However, several high-level libraries have been written to hide the low-level JSON-RPC communication. Some of the popular libraries are web3.js (JavaScript), web3j (Java), Nethereum (C# .NET), etc.
  • Ethereum Accounts - Accounts play a central role in Ethereum. There are two types of accounts: External Owned Accounts (EOAs) and Contract Accounts. EOA is simply referred as ‘accounts’ and contact accounts as ‘contracts’. Popular languages to write contracts are Solidity (like JavaScript) and Serpent (like Python).
  • Ether - Ether is the name of the currency used within Ethereum, it is used to pay for computation with the EVM. Ethereum has a metric system of denominations used as units of ether. The smallest denomination aka base unit of ether is called Wei.
  • Gas - Gas is a constant cost of network resources/utilization. A Gas is not issued but represented in terms of ether. If the price of ether goes up, the Gas Price in terms of ether should go down thus keeping the cost of Gas the same.
Ethereum Network
  • Public blockchain - It is a blockchain network that anyone in the world can read, anyone in the world can send transactions to and expect to see them included if they are valid, and anyone in the world can participate in the consensus process.
  • Consortium blockchains - A blockchain network where the consensus process is controlled by a pre-selected set of nodes. The right to read the blockchain may be public, or restricted to the participants, and there are also hybrid routes.
  • Private blockchains - A network where write permissions are kept centralized to one organization. Read permissions may be public or restricted to an arbitrary extent.
Ethereum Consensus or Mining
Ethereum uses an incentive-driven model of security where the consensus is based on choosing the block with the total difficulty. Currently it uses Proof of Work (PoW) of a given difficulty and in next release of Ethereum there are plans to replace PoW with Proof of Stake (PoS).

Which Framework is Good for Enterprise Application Development
It depends on what business problem an organization is trying to solve, skills of the development team, scalability & performance of the solution, blockchain network type, need for cryptocurrency, off-chain integrations, etc. Based on my experience, I have put together the following summary:

Feature
Hyperledger Sawtooth
Hyperledger Fabric
Ethereum
Platform
Semi-modular platform
Modular platform
It is a generic platform, like a programing language
Enterprise ready
Provides partial capabilities through permissioned rules and identity roles
Offers identity management, privacy, confidentiality, etc. out of the box
Being a generic platform, provides limited enterprise features out of the box
Cryptocurrency
None
None
Ether
Network
Public (doesn’t support any incentive feature), Consortium, and Private
Consortium and Private
Public, Consortium, and Private
Consensus
Default PoET and pluggable
Default Kafka supports SoLo, PBFT and other pluggable algorithms
Default PoW and PoS will be offered in next version
Scalability/Performance
High
Medium to High
Low to Medium
Off-chain execution
Through permissions
Oracles
Oracles
Smart Contracts
Any supported languages
Chaincode (Go and Node.js)
Solidity, Serpent and LLL
SDK
Many options – Go, Python, JavaScript, Java, etc.
Java, Node.js, etc.
JavaScript, Java, C# .Net, Ruby, etc.
Blockchain enterprise applications
Use cases which needs high scalability such as IoT, Fog computing, etc.
Good for manufacturing, agriculture, healthcare, capital markets, etc.
Use cases which needs cryptocurrency or tokens in any vertical industry





Comments

Popular posts from this blog

Building a Genome Next Generation Sequencing (NGS) Data Pipeline in Azure

1)               Introduction Next Generation Sequencing (NGS) also known as Deep Sequencing or Massive Parallel Sequencing or Second and Third Generation Sequencing is a technique that offers unprecedented detail in the genomic, transcriptomic, and epigenomic patterns associated with cellular processes.  A medium size lab (10-15 scientists) could easily generate multiple terabytes of data during a NGS end-to-end process. Hence building a scalable, cost effective, and secured data pipelines is a lifeblood for life sciences industry and in particular Genomics domain. 2)                    Key Terms Genomics: It is study of genomes (complete set of genetic material within an organism). Genomics involves the mapping, sequencing and analysis of genomes. It includes structure, function, comparison, and evolution ...

Ethereum Blockchain Platform - How to create a Local Private Network, Design, Develop and Deploy a Smart Contract

Purpose The goal of this post is to take a simple business use case and develop a blockchain application that is cryptographically secured, decentralized and tamper-proof. Also understand the key components of the Ethereum blockchain application stack, create a local private network, learn to write smart contract in solidity using Remix IDE, and leverage Ethereum Wallet to deploy and execute the smart contract for transferring the digital tokens. Business Use Case A fictitious epidemic code named "Chaindemic" is spreading like wildfire and the Center of Disease Control and Prevention (CDC) has found a particular strain of vaccine that is more effective compared to other variants of the strain available in the market. The procedure to administer the vaccine is very specialized and requires a control environment and training. CDC has chosen three providers who are trained and equipped to administer the vaccine. To encourage higher public participation in the vaccination ...