Legal Contracts are the foundation of the exchange of value between humans. As most things become digitized, so are contracts. Blockchain is transforming the exchange of assets to a model based on a business network using a distributed ledger. This model requires that we establish governing rules for digital asset exchanges; hence the idea of smart contracts was born. The Accord Project is an open source software initiative that has established specifications, tooling and code for smart legal contracts.
The Clause platform manages digital legal contracts that adhere to the Accord Project open-source specifications for smart legal contracts
This code pattern illustrates how a legal agreement (such as a shipping contract) can be automated with the use of trusted data from the IBM Blockchain Platform. In this scenario, the Hyperledger Composer business network (executing on Hyperledger Fabric v1) invokes the Clause platform. Hyperledger Fabric stores the state of assets on the blockchain, while the Cicero engine (from the Accord Project) executes contract logic off-chain on the Clause platform.
The developer creates a blockchain-based business network on the IBM Blockchain Platform that invoke Clause to execute Smart Legal Contracts. When the reader has completed this code pattern, they will understand how to:
- Deploy a network to IBM Blockchain Starter Plan
- Configure and use the Clause platform to build and execute a contract
- Run an Angular application that utilizes the Clause smart contract
- Application receives a shipment request
- A transaction is submitted to IBM Blockchain Platform
- A call is issued to Clause to trigger execution of a smart legal contract
- The smart legal contract is executed and assuming verifications pass; then a payment is subsequently calculated
- Assets on the blockchain are updated: blocks are written to the network and the world state is updated
- Hyperledger Composer v0.20.x Hyperledger Composer is an extensive, open development toolset and framework to make developing blockchain applications easier
- Hyperledger Fabric v1.2.1 Hyperledger Fabric is a platform for distributed ledger solutions, underpinned by a modular architecture delivering high degrees of confidentiality, resiliency, flexibility and scalability.
- IBM Blockchain Starter Plan The IBM Blockchain Platform Starter Plan allows to build and try out blockchain network in an environment designed for development and testing
- Clause Clause edits and executes smart legal contracts, connecting them to existing event sources and systems
- If you do not have an IBM Cloud account yet, you will need to create one here.
- Provision IBM Blockchain Starter Plan
- Deploy to IBM Cloud
- Setup Smart Legal Contract
- Running the Client Application
A. Click the link below to automate the provision of a service on IBM Cloud and to deploy the contract and app contained in this repository.
B. Authorize IBM Cloud to access your GitHub account. This sample will be forked into your account so you can modify it.
C. In the Delivery Pipeline
tab under Tool Integrations
. Enter your IBM Cloud API Key. If you don't have a key you can create one. Enter the service name of your Blockchain instance from your IBM Cloud dashboard, it will be something like Blockchain-xy
.
D. Click Create
to trigger the deployment, then click 'Delivery Pipeline' to monitor to progress. Wait for both the 'Build' and 'Deploy' stages to pass, this should take about 10 minutes.
Note that if deploy fails you should check the logs. If you have an existing Cloudant Lite plan instance the deploy will fail, as each IBM Cloud account is limited to a single Cloudant Lite plan database instance. You must upgrade your existing Cloudant instance to a paid plan or remove it.
While you are waiting you can get started with setting up your Smart Legal Contract on Clause. In that link, begin with Step 3.
You can read more about the Client Application here.
Click the Client App link under 'LAST EXECUTION RESULT' to view your demonstration app, it should look like the screenshot at the top of this page. Note that Hyperledger Composer is used to store the state of shipments, importers, growers, shippers on the blockchain, while the contract logic is invoked out-of-process using the Cicero Server. Follow the instructions
-
Blockchain Code Patterns: Enjoyed this Code Pattern? Check out our other Blockchain Code Patterns
-
Blockchain 101: Learn why IBM believes that blockchain can transform businesses, industries โ and even the world. Blockchain 101
-
How to integrate Clause with Blockchain: Learn about the 4 ways you can integrate Smart Legal Contracts from Clause with Blockchain. Integrate Clause with Blockchain
ยฉ Copyright 2018, Clause Inc.