Hardly a day passes by without someone mentioning Bitcoin, especially when the currency’s market value has reached thousands of dollars. This grabs our attention immediately. At ObjectFrontier, we are interested in Bitcoin not just for its market value, but because of the technology that makes it tick, makes it secure, and makes it successful: blockchain.
Thanks to the likes of Vitalik Buterin, blockchain – the same engine behind the success of Bitcoin – is now available for enterprises to use and build applications on it.
This is the first post in a two-part series on blockchain. Here, I’d like to show a brief technical view of what blockchain is and how your company can use it. In Part 2 of this series, you’ll get to learn about some of the prototypes we are building and see the opportunities blockchain enables when it’s in action.
Please note that this post might get fairly technical, so you will need some prior understanding of databases, distributed storage, peer-to-peer (P2P) networks and computer programming.
Applications of Blockchain
As explained in Bretton Woods’ 2015 white paper here , blockchain has far-reaching applications in financial services, healthcare, retail, media, personal investment and governance. To name a few, some applications are already built for the following:
- Clearing and settlement
- Property ownership
- Digital identity
- Insurance mortgage lending
- Release of health records
- Title and lien holding
- Crowd sourcing
It is an undeniable fact that Bitcoin revolutionized the field of cryptocurrencies. As mentioned above, the key to Bitcoin’s success compared to many of its predecessors is its underlying technology: the blockchain. Blockchain is a distributed transaction ledger replicated in all participating nodes in the blockchain network, with no central authority controlling it.
Technically, a blockchain is a decentralized database with random independent nodes participating in the network. All the nodes in this network will have the same version of blockchain, and hence the ledger is distributed and one single version of blockchain is replicated across all the nodes. As the name indicates, a “blockchain” is a chain of blocks. The blocks contain transactions committed to the blockchain.
The state of the blockchain changes based on the transactions added to the blocks that make up the chain. Any node in the network can add a block to a blockchain. However, since a blockchain is disintermediated, with no central authority controlling what transactions make up a block or which block is added to the chain, we need a consensus between the competing nodes trying to add the block. A consensus algorithm called Proof of Work (PoW) achieves this unanimity. PoW is the consensus algorithm currently employed by the likes of Bitcoin and Ethereum. Check out this Ethereum white paper for more details.
Beyond cryptocurrencies, blockchain technology—with its decentralized, disintermediary nature—has immense potential to open up new avenues and markets for enterprises willing to build revolutionary applications on blockchain, giving them an edge over others. Private, permissioned blockchain is especially attractive to many enterprises in financial services and healthcare. It is encouraging to see increased acceptance of blockchain with states like Vermont passing legislations honoring transactions on blockchain.
Programmability of Blockchain
To understand the programmability of blockchain, we have to take a good look at how Bitcoin works. When Alice transfers a few bitcoins to Bob, this is considered a transaction in Bitcoin’s blockchain.
As shown below, a Bitcoin transaction has two sections: Input and Output.
Previous tx: f5d8ee39a430901c91a5917b9f2dc19d6d1a0e9cea205b009ca73dd04470b9a6
scriptPubKey: OP_DUP OP_HASH160 404371705fa9bd789a2fcd52d2c580b65d35549d
Without getting into the fine-grained details, the scriptSig and sciptPubKey are actually scripts that define the business logic for this transaction. When executed, this script evaluates the input against defined conditions and ends up changing the state of blockchain if all conditions are met. This ability to define logic in a transaction is what makes blockchain programmable.
Scripting in Bitcoin cannot be expanded much beyond cryptocurrencies, because it is not developed with such applications in mind. Technically, the scripting language in Bitcoin is not Turing complete. This limitation in Bitcoin is overcome by the leading blockchain platforms like Ethereum and Hyperledger, making blockchain a viable option to develop and deploy applications for enterprises.
These platforms also focus on privacy, scalability and access control, making them ready for building and deploying enterprise applications.
There are many blockchain platforms available in the market today that enable the use of a “smart contract,” which is a code that facilitates the secure execution of contracts between two parties on blockchain. Applications that use smart contracts are called “Decentralized Applications (DAPPS).”
Here are the two leading blockchain platforms:
Both of these platforms enjoy good community contribution, industry adoption and enterprise backing.
Ethereum, which is backed by Ethereum Foundation, is an open software platform based on blockchain technology that can be used to build and deploy smart contracts for decentralized applications. Smart contracts are programs that are deployed to blockchain and run on the Ethereum Virtual Machine (EVM) in an Ethereum network.
Smart contracts are immutable once deployed, and because of blockchain’s decentralized nature, they will always be available for invocations. Invocations of smart contracts are transactions that make up the blocks in blockchain. These transactions can contain data for functions called on smart contracts. Smart contracts have their own storage that can be used to register state changes and can return output of the function invocations. One contract can call other contracts and create more contracts in run time. Ethereum smart contracts are developed using a contract-oriented language called Solidity.
DAPPS are traditional web applications that invoke and use smart contracts behind the scenes. Ethereum is primarily a public blockchain that can be run as a private blockchain.
Hyperledger Fabric backed by Linux Foundation is a platform for running a private blockchain (a.k.a. permission blockchains). Permissioned blockchains are similar in all aspects to the public blockchain except for the following:
- They are private. These blockchains are accessible only by approved parties.
- They have pluggable consensus. Participating organizations can decide on the consensus protocol.
- They allow for specific permissions. There is fine-grained control over who can read and initiate transactions in these blockchains.
The characteristics of a private blockchain sometimes make Hyperledger Fabric an attractive option for the enterprises. You can use the factors above to determine what suits your own use case best.
In general, Hyperledger Fabric works with the same principles as Ethereum with some differences in terminologies. For example, smart contracts are referred to as chaincode and the choice of language for development of contract is Go.
Both the platforms are equally powerful and capable of building revolutionary applications.
To see what blockchain looks like in action through several use cases, check out Part 2 of this series here.
About the Author
Ganeshram Ramamurthy is ObjectFrontier’s technical director and heads technology for presales. For many years, Ganesh has been designing and developing enterprise applications across various domains. He has a keen interest in emerging technologies and is now spearheading blockchain initiatives at OFS.