Clause integrates with blockchain in a variety of ways, for different scenarios.

Scenario 1: Off-Chain Inbound

Smart Legal Contracts can be invoked from blockchains (passing data from the blockchain chaincode into the Smart Legal Contract). This pattern is used when your primary data store is a distributed ledger and you don't want to hardcode contractual legal logic into your chaincode, instead running your Smart Legal Contracts off-chain. The return value from your Smart Legal Contract can be used to update data you are storing on the blockchain.

https://cdn.elev.io/file/uploads/5l3hcH-4pYsF8pyck4PI8ECrWSTfkI6x02zPDvk7sqU/_JM4ahzUu65ig8DjPrU2wZ0B_UDm9PxbzmLesyjur-Y/blockchain-scenario-1-xNQ.png
Tutorials and Samples

This scenario is illustrated by the IBM Blockchain Platform (Perishable Goods) Tutorial or the Open Source Hyperledger Composer Blockchain Tutorial, but is also possible in any DLT platform that can make HTTP POST calls to external systems.

Trust and Distribution

In this scenario Clause acts as a trusted intermediary for the execution of legal logic for all blockchain participants, but each participant has their own copy of a distributed ledger.

Scenario 2: Off-Chain Outbound

Smart Legal Contracts can submit transactions to blockchains. This scenario allows you to use Clause as a centralised (trusted) Smart Legal Contract execution platform, and Smart Legal Contracts to record significant contract lifecycle events onto a public or permissioned distributed ledger.

https://cdn.elev.io/file/uploads/5l3hcH-4pYsF8pyck4PI8ECrWSTfkI6x02zPDvk7sqU/SFJEAEOPVPiE2RphKgU-mPyCMB7CdHdAdhUhe00B2wQ/Blockchain_ Off-chain Outbound-My0.png


Tutorials and Samples

You can implemented this scenario using the Clause outbound web connector to call external services, for example the Composer REST Server, or using the Ether Transfer Connector, or the Ethereum Smart Contract Transaction Connector. If you are targeting a permissioned Enterprise Ethereum instance the Kaleido integration tutorial will be helpful.

Trust and Distribution

In this scenario Clause acts as a trusted intermediary for the execution of legal logic for all blockchain participants, pushing significant contract events into the distributed ledger's of each participant using a blockchain gateway, or API.

Scenario 3: On-Chain Cicero Engine

Smart Legal Contract execution can be embedded in a distributed blockchain node. This scenario is used when the contracting parties each (or all) want to execute the logic of a Smart Legal Contract and there is no single trusted intermediary (such as Clause) for all parties. Logic runs on-chain, with all peers executing the logic, and transactions only being committed to the blockchain if there is consensus on the outputs of Smart Legal Contract execution. The drawbacks of this scenario are that all peers must coordinate the deployment of their software stacks and Smart Legal Contract logic to guard against consensus failures. The logic often has to to run in a bilateral or multilateral channel to ensure that the terms of the contract are only accessible to the parties to the contract.

https://cdn.elev.io/file/uploads/5l3hcH-4pYsF8pyck4PI8ECrWSTfkI6x02zPDvk7sqU/zA_N26aAX25Zmc57AGYCWp2stLnpW1-kni90ARanfqQ/Blockchain_ On-chain Cicero-PZs.png
Tutorials and Samples

This scenario is possible for blockchains that support embedded Node.js execution, or that can call the Cicero engine, for example Hyperledger Fabric v1.3.

Please see the sample Cicero client and HLF v1.3 chaincode here.

Trust and Distribution

In this scenario the blockchain participants do not have to trust an intermediary for the storage of contract data or the execution of Smart Legal Contract logic. This pattern does come with drawbacks however in terms of complexity of operation, performance and privacy.

Scenario 4: On-Chain Ergo Compilation

Smart Legal Contract logic can be compiled for execution on the blockchain. This is conceptually similar to scenario (3), however does not depend on deploying the Cicero engine to the blockchain peers, instead the Ergo logic for the Smart Legal Contract is compiled to the blockchain's execution platform/environment.

https://cdn.elev.io/file/uploads/5l3hcH-4pYsF8pyck4PI8ECrWSTfkI6x02zPDvk7sqU/LKms_6CN54DTucQYd3CnstYWTYm-W4Ql-hyz9vpmWq0/Blockchain_ On-chain Ergo-lH4.png
Tutorials and Samples

This scenario is currently under development, based on the compile backend for the Ergo domain specific language for template logic. Contributions welcome!

Trust and Distribution

In this scenario the blockchain participants do not have to trust an intermediary for the storage of contract data or the execution of Smart Legal Contract logic. This pattern does come with drawbacks however in terms of complexity of operation, performance and privacy.