Legal and Smart Contract Pair

Disclaimer: This is a summary of patterns we have observed during our research and should not be considered any form of technical or investment advice. Also, the given “known examples” do not imply they are the best implementations of the said pattern or any superior to any other implementation of the pattern not listed.


A bidirectional binding is established between a legal agreement and a corresponding smart contract.


The legal industry is becoming digitised, e.g., digital signatures are now recognised as a valid form of signing legal agreements. The Ricardian contract was developed in the mid-1990s as a digital document for cryptographically-identified legal contracts to also be machine-interpretable. Thus, there is a need to either fully or partially execute and enforce digital legal agreements on the blockchain.


An independent, execution platform trusted by all the involved participants is needed to execute digital legal agreements. How can blockchain execute and enforce digitised legal agreements?


  • Authoritative source – A valid mapping is required between a legal contract and its corresponding smart contract so that the smart contract can correspond with the authoritative legal contract.
  • Secure storage – Blockchain provides a trustworthy data storage to keep the legal agreement.
  • Secure execution – Blockchain provides a trustworthy computational platform that can execute digital agreements to enforce certain conditions as defined in a legal contract.


First, create a smart contract to enforce all or part of the conditions defined in the legal agreement. The smart contract should also have a variable to link and verify the corresponding legal contract. By default this variable should be set to null. Second, deploy the smart contract on the blockchain. Third, include the smart contract address in the legal agreement. Forth, calculate the hash value of the legal contract. Finally, update the smart contact’s variable that links to the legal contract with the hash of the contract.

Legal and smart contract pair pattern

By binding a physical legal agreement with a smart contract, the bridge between the off-chain physical agreement and the on-chain smart contract is established. The bidirectional binding shows the intended mapping between the legal agreement and smart contract. The smart contract digitises some of the conditions defined in the agreement. These conditions can be checked and enforced automatically by the smart contract. However, not all legal terms can be digitised. The smart contract can also facilitate automated regulatory compliance checking, but the extent of this might be limited depending on the data represented on the blockchain and on constraints of smart contract programming language.


  • Automation – Some of the conditions defined in the legal contract such as a conditional payment can be automatically executed or enforced by the blockchain.
  • Audit trail – Blockchain permanently records all historical transactions related to the legal contract and the contract itself. This immutable data enables auditing of the contract and its execution.


  • Expressiveness – Smart contracts are written in programming languages. These programming languages might not be able to express all contractual terms or regulatory compliance conditions.
  • Enforceability – If a public blockchain is used, there is no central administering authority to decide on disputes nor to enforce court judgments on-chain.
  • Interpretation – There might be many possible ways to interpret contract conditions and encode them in smart contracts. Ambiguity in natural language makes it a challenge to accurately implement legal terms in a way that will be agreed upon by all the involved participants.

Related patterns

  • Hash on-chain pattern is used to store a hash on the blockchain

Known uses

  • The Smart Contract Template proposed by Barclays uses legal document templates to facilitate smart contracts running on R3 Corda blockchain platform.
  • Specific proposals for the representation of machine-interpretable legal terms have been explored in KWM’s project on digital and analogue (DnA) contracts and in the Accord Project.
  • OpenLaw is a platform that allows lawyers to make legally binding and self-executable agreements on the Ethereum blockchain. The legal agreement templates are stored on a decentralised data storage IPFS. Users can create customised contracts for specific uses.