IBM Blockchain Platform
IntroductionLedgers model assets and liabilities, including balances, payments to suppliers, taxes owed, and goods delivered. Multiple parties can access and update a single version of a ledger while maintaining shared control. Blockchains establish trust across a business network. Transactions can only be added to the ledger, not removed. Transactions are protected with cryptography. Changes to the ledger require approval by participants, and are final and immutable. Each copy of the ledger matches all other copies.
The Linux Foundation's Hyperledger Project provides Hyperledger Fabric, a platform for deploying blockchain networks, and Hyperledger Composer, an open source development toolset for developing blockchain applications.
A ledger on Fabric consists of the world state, which contains the status of all assets tracked on the ledger, and the blockchain, which contains a history of all state changes. Ledgers are replicated across a channel and stored on peers. Channels contain sets of network members who communicate and transact privately. Every channel has a separate ledger. Only the peers on a channel can see the assets and transactions for its ledger.
Applications use smart contracts that invoke chaincode to send transactions into the Fabric network, primarily interacting with the database component of the ledger. The Ordering Service bundles transactions into blocks, which are then added to the blockchain.
The certificate authority (CA) uses public key infrastructure (PKI) to identify peers, the ordering service, and participants. Peers sign transactions and contracts. Participants use client SDKs to interact with the network.
IBM Blockchain PlatformIBM Blockchain Platform (IBP) runs on the IBM Cloud, and is built upon Fabric. IBP provides interfaces for creating channels, deploying chaincode, inviting new members, customizing governance policies, and managing the identity credentials of network participants.
For development use the IBP Starter Plan, which provides a fully configured Fabric network with two-member organizations, each organization containing one peer, a CA, and an ordering service.
For production, use the IBP Enterprise Plan, which offers high availability, live updates, runtime isolation, and end-to-end tamper protection.
Create business network definition
We can create a new business network definition using either the git clone example or the Composer Yeoman generator, which creates a skeleton business network. After the business network definition has been generated, open it with a code editor to continue development. VisualStudio has a plug-in that provides syntax highlighting.
Model file definitionHyperledger Composer uses classes for Assets, Participants, and Transactions.
Assets are tangible or intangible goods, services, or property, and are stored in registries. Assets can represent almost anything in a business network, for example, a house for sale, the sale listing, the land registry certificate for that house, and the insurance documents for that house may all be assets in one or more business networks.
Assets must have a unique identifier, but other than that, they can contain whatever properties you define. Assets may be related to other assets or participants.
Participants use Transactions to modify the state of Assets.
For example, a fund clearing network has a single participant type named BankingParticipant. A series of transactions enable BankingParticipants to create TransferRequest assets, net all relevant TransferRequests into a BatchTransferRequest, and then fulfill the settlement of the BatchTransferRequest. The transactions proposed to facilitate this process are SubmitTransferRequest, CreateBatch, MarkPreProcessComplete, CompleteSettlement, and MarkPostProcessComplete. Because BankingParticipants need to be notified of any relevant BatchTransferRequests that have been created, an event BatchCreatedEvent is determined to be necessary.
Transactions are the mechanism by which participants interact with assets. This could be as simple as a participant placing a bid on a asset in an auction, or an auctioneer marking an auction closed, automatically transferring ownership of the asset to the highest bidder.