Building Enterprise Blockchain Applications In Hyperledger
Hello blockchain enthusiasts! I am a developer at Madrona Venture Labs (MVL) in Seattle. MVL is a startup studio housed inside of Madrona Venture Group in Seattle. Our charter is to think up ideas for new companies that are aligned with Madrona Venture Group’s investing thesis. At Madrona Labs, we’re interested in a number of technology tracks like AI/ML, voice and most recently, blockchain. Checkout this post that describes our journey into blockchain. In that post we talk about a blockchain workshop we are co-hosting with TiE Seattle and decisions we made to support the Ethereum and Hyperledger platforms for event participants building their Dapps.
While some of my colleagues focused on the Ethereum platform, my post will focus on the Hyperledger Fabric implementation of blockchain. Having recently released a stable and much improved v1.0 version, Hyperledger is now one of the top blockchain platforms for developing decentralized enterprise applications.
Technology enthusiasts with some knowledge of blockchain will find this post particularly relevant. If you are looking for an understanding of blockchain in general, please head over to the Go Vertical Blockchain Startup Workshop site. MVL and TiE Seattle have put together important educational materials and tutorials to get you started on blockchain quickly. If you are interested in the Ethereum blockchain, you will definitely find this post interesting as well.
Over the past few months I have been investigating a multitude of blockchain ideas and technologies. After a bit of a learning curve, I now see the potential this technology has to solve a number of different problems in a variety of different industries. And since the recent launch of v1.0, I have become a fan of the open source Hyperledger Fabric blockchain project. This project is built from the ground up for enterprise level applications. Hyperledger Composer is another companion project that simplifies the development of decentralized business applications. These open source collaborative blockchain framework projects are supported by The Linux Foundation, led by platinum members IBM, Microsoft, AT&T, Intel and many more.
So, why Hyperledger Fabric and Composer? Why is it a good fit for enterprise blockchain applications?
Hyperledger Fabric is a permissioned blockchain framework. It provides an enterprise-grade foundation for transactional application.
Hyperledger Fabric supports similar concepts of other blockchain platforms. It’s a shared ledger that utilizes cryptography and supports smart contracts. All similar key concepts helps ensure the security and integrity of recorded transactions.
Although similar to other blockchain platform implementations, there are key differences which make Hyperledger ideal for enterprise applications.
Privacy: Hyperledger Fabric is a permissioned peer-to-peer blockchain network. Unlike Bitcoin and Ethereum which are public blockchains, enterprise applications require privacy and confidential transactions . Access to the network should require invitations to join. Peers are more likely to be trusted, whereas in public blockchains users cannot be trusted.
On top of the permissioned network, Hyperledger Fabric also supports the notion of Channels. Think of this as a “subnet” of peers within the network. Channels provide an extra level of transactional confidentiality. Peers joined to a specific channel have limited visibility to just that channel. This is important in a business network. Given the competitive nature of business, visibility should be restricted to partner peers and not the full network.
Consensus mechanism: Scalability is another must have requirement for any enterprise application. Unlike Bitcoin and Ethereum platforms that employ miners to reach consensus on the validity of a transaction, Fabric has no notion of mining. Nor does it have a native cryptocurrency. This allows Hyperledger Fabric to be far more scalable. Arguably, scalability is why Ethereum is not ready for prime time. If you are interested in learning more about Hyperledger Fabric’s transactional flow mechanics, you can read more here.
Hyperledger Composer is a framework designed to speed up the development of distributed applications on Hyperledger Fabric. Composer provides several high-level components and API’s that facilitate easy communication to the underlying Hyperledger Fabric blockchain runtime. From a developer standpoint, Composer essentially abstracts out the Fabric blockchain implementation. It provides a business centric REST API that interacts and invokes transactions within the Fabric network.
Without the use of the Composer, a developer would spend a considerable amount of time natively wiring up the Fabric smart contract logic (called chaincode in Hyperledger) in Golang for the purpose of simply interacting with the underlying blockchain network. If you’ve cloned the Fabric sample application, and subsequently tried to create a simple Fabric blockchain application natively from scratch, you would know what I’m talking about! Installing and instantiating the chaincode is not a straightforward process. I ran into major complications when I started learning and using native chaincode to write smart contracts. It is complicated mess to install, invoke and query the blockchain network. Take my word for it: Investigate Hyperledger Composer — Once I did I never went back!
One more thing about Composer: Developers define and model a business network solution using the integrated modeling language. The modeling language is super simple to learn and use. You start by creating a Business Network Definition (BND). BND has all the necessary components (files, rules and logics) that makes up a business network. For specific details on what BND is comprised of please go here.
After modeling a business network, the BND can be bundled into an archive (.bna) file. This can then be packaged and deployed into the underlying Fabric network. Packaging and deploying are simple command lines and can be issued on a terminal window.
Ready to get your hands dirty? We’ve created 2 tutorials that will walk you through setting up a Hyperledger Fabric and Composer development environment as well as a full-fledged sample Dapp.
Set up a Hyperledger Fabric and Composer development environment.
Checkout this post. Setting up your development environment. It is a detailed step by step process. The post provides two different approaches. The recommended approach uses the Composer framework to simplify client-side application development.
Create a decentralized application running on Hyperledger Fabric and Composer.
Ejiro and Madrona Labs Team