Hands-On Blockchain with Hyperledger
上QQ阅读APP看书,第一时间看更新

The building blocks of blockchain solutions

As noted in Chapter 1, Blockchain – Enterprise and Industry Perspective, blockchain promises to fundamentally solve the issues of time and trust in industries such as financial services, supply chain, logistics, and healthcare. It seeks to streamline business processes and thereby address inefficiencies. It's a technology for a new generation of transactional applications built on trust, accountability, and transparency. There are several characteristics shared by every industrial blockchains, including the following:

  • A shared single source of truth
  • Secure and tamper-proof
  • Private unlinkable identity
  • Scalable architecture
  • Confidential
  • Auditable

The diagram that follows summarizes these characteristics into four tenets:

Blockchain solutions are comprised of four building blocks—a shared ledger, privacy, trust, and smart contracts. Allow me to elaborate a bit on each of these building blocks:

  • Shared ledger: With bitcoin blockchain, the intent was to democratize visibility; however, enterprise blockchain requires a different approach due to the regulation of consumer data. Append-only distributed transaction records can be achieved by SQL or no-SQL distributed databases.
  • Privacy through cryptography: Privacy through cryptography is essential for ensuring that transactions are authenticated and verified. It is imperative to include cryptography in blockchain design for the sake of hardening security and making it more difficult to breach the distributed system. Considerations about cryptography change when you're working with a less democratic or permissioned ledger network.
  • Trust systems or consensus: Trust means using the power of the network to verify a transaction. Trust is essential in any blockchain system or application, and I prefer the term trust system over consensus system since trust is the foundational element that dictates a stakeholder's investment in any blockchain infrastructure. The trust system is modified whenever new entrants come into the blockchain space and apply blockchain technology to a new use case or specialization. The trust model is truly the heart of blockchain—it's what delivers the tenets of trust, trade, and ownership. Trust is what enables blockchain to displace the transaction system, but this can only happen when trade and ownership are addressed by distributed/shared ledgers. There's still much work needed to define an optimized trust system for various use cases. Database solutions are in the works to address scale and mobile use cases, but more work is require around P2P and sharing economy models, as well as B2B models.
  • Smart contracts: In the context of blockchain, a smart contract is a business agreement embedded into the transaction database and executed with transactions. Rules are needed in business to define the flow of value and state of a transaction, so that's the function of the contract here. The contract is smart because it's a computerized protocol to execute the terms of the contract. Various contractual clauses (such as collateral, bonding, delineation of property rights, and so forth) can be codified so as to enforce compliance with the terms of the contract and ensure a successful transaction—this is the basic idea behind smart contracts. Smart contracts are designed to reassure one party that the other will fulfill their promise. Part of the objective of such contracts is to reduce the costs of verification and enforcement. Smart contracts must be observable (meaning that participants can see or prove each other's actions pertaining to the contract), verifiable (meaning that participants can prove to other nodes that a contract has been performed or breached), and private (meaning that knowledge of the contents/performance of the contract should involve only the necessary participants required to execute it). Bitcoin made provisions for smart contracts; however, it lacked some capabilities such as Turing-completeness, lack of state, and so on. Ethereum improved upon bitcoin's limitations by building a blockchain with a built-in Turing-complete programming language, so that anyone can write smart contracts and decentralized applications by creating their own arbitrary rules for ownership, transaction formats, and state transition functions. These advances made it possible for complex contracts to be codified in a blockchain, such as instant transfer of credit to a traveler's bank account when a flight is delayed beyond a certain duration or payment of employee compensation if performance goals are achieved.
    How does this work practically? Well, smart contracts are deployed as code on the blockchain nodes, which we might more appropriately call smart contract code. This code is a way of using blockchain technology to complement, or replace, existing legal contracts. This smart contract code is deployed on the blockchain node in a programming language such as Solidity or Go lang. Deploying the code on the blockchain provides three important properties:
    • Permanence and censorship resistance inherited from the blockchain,
    • The ability of the program itself to control blockchain assets, such as by transferring ownership or quantities of an asset among participants
    • Execution of the program by the blockchain, ensuring that it will always execute as written and no-one can interfere

In the enterprise world, smart contracts would probably involve blockchain's smart contract code, accompanied by a more traditional legal contract. For example, a smart contract code may execute on a land registry blockchain network to transfer ownership of a house from one party to another, so that land registry records are updated in real time and all participants such as the city, realtors, lawyers, and banks can all update their own records upon completion of the sale. However, the home buyer will insist on a legal contract with indemnity clauses to cover any undiscovered liens.