Writing a smart contract? Look at the (legal and computer) codes.

Image for post
Image for post
Copyright: https://www.coindesk.com/information/ethereum-smart-contracts-work/

What are smart contracts?

Despite their name, smart contracts are not actually legally binding contracts. They are actually computer programs, which, when certain pre-specified conditions are met, trigger an event. Though not strictly necessary, they are often implemented with Blockchain technology

The basic idea of smart contracts is that many kinds of contractual clauses (such as liens, bonding, delineation of property rights, etc.) can be embedded in the hardware and software we deal with, in such a way as to make breach of contract expensive (if desired, sometimes prohibitively so) for the breacher.

— Nick Szabo, creator of the smart contract concept in 1997

That said, smart contracts may be made legally binding. That is to say, whilst thus far, we have only recognised contracts to have binding force where they are written in a human language, we may extend this recognition to where contracts are written in code.

This is exactly the objective the Accord Project is trying to achieve. Backed by a veritable list of who’s who across the fields of technology and law firms (the last time I saw so many reputable law firms on one page was on a brochure for a law fair), they seek to build the “smart legal contracts stack”. This goal has garnered further support from IBM, with the giant partnering with smart contract giant Clause. The result thus far, has been a ‘sample code catalogue’ demonstrating this for perishable goods logistic network.

Why are smart contracts so difficult to write?

In many ways, smart contracts are easier to write to execute than conventional contracts. Once written, the code self-executes, so no more hassle. The code cannot be tampered with, which reduces the possibility of costs from manipulation or lying. Lastly, it provides that magic sauce that is the fundamental problem of all commerce: trust. Once solemnized, the contract is executed autonomically and the data is available to everyone.

Image for post
Image for post
Copyright: https://blockgeeks.com/guides/smart-contracts/

The above benefits, however, also demonstrates the limits of, and thus the difficulties in coding, smart contracts. There are some things that human lawyers can do are out of bounds for smart contracts. A term like “within a reasonable period of time” would not be able to be embodied in a smart contract. To do so, a lawyer would need to advise what this period of time might be, i.e. 3–27 days, and for this number to be written into the code. Indeed, computer programmes still require legal input: in their design, their implementation, (both of which, we will go into later).

I think it is naive to not see that smart contracts will increasingly be accepted and eventually legalised, because human being have historically been always accepting of new technology that creates convenience, money and security. Hong Kong already recognises laws written in 3 different systems of writing, really, what is one more? When its use becomes common place, it’s really not unlikely to suggest we might start to see things like Scratch (a platform that teaches young kids to write code by letting them drag together different elements — strangely I didn’t learn to code from this) for contracts, which will allow lawyers to create smart contracts.

Smart Contracts, Tokenisation, and ICOs

More concretely, an example of the need for intelligent legal and computational design of smart contracts can be seen by the startup, FinFabrik, I’ve been working in has been investigation of the possibility of using smart contracts in tokenisation.

Real Asset Tokenisation

Let’s back this up a little. What exactly is real asset tokenisation and why is this important?

Image for post
Image for post
Source: www.pexels.com

Imagine this. Let’s say you you have an apartment, it’s valued at maybe HKD$1,270,000. You’re pregnant and you need maybe HKD$300,000 to pay for a debenture for a kindergarten. What can you do? Wash dishes maybe. Busk at Time Square. Do odd jobs. But, traditionally, the apartment, this asset you own and with great value, is no help in you getting the HKD$300k you require. In the economy, this asset is actually currently not reaching it’s full use. It’s kind of a similar situation to all those private cars sitting around before Uber turned this unused resource into something productive.

Now imagine you don’t have an apartment or a baby on the way. Instead you have a big company, let’s call it BigCorp. It’s got a market cap of say HKD$127,000,000,000. You’ve got to raise HKD$300,000,000 for a new set of labs. What do you do? You go to the Stock Exchange, and go, look Stock Exchange, I need some dollar, and to get that, I’m willing to sell some shares in my company for money.

Enter Real Asset Tokenisation, the triumphant hero. What the Blockchain allows is, for you to do what BigCorp does, but for smaller assets. It does so cheaply and without friction. Essentially, you sell shares in your apartment for money. The Blockchain provides for a cheap registry to log the transfers of ownership quickly, which then allows for a system similar to the Stock Exchange, in which people can trade shares of your apartment. It’s immutable as well, so there’s a public ledger of who owns what. In order to amend it, one would need to re-mine all the past blocks and keep up with the newly generated blocks as well. Unless quantum computing or extreme wizardry becomes widespread soon, that is unlikely to occur.

Real asset tokenisation is so very important then in reducing economic waste and social disparity. It makes an awful lot of sense. Really think about the fact that every day we are losing money. As inflation is a thing, the money we have sitting in our bank account, unless invested, essentially decreases in value. So you may have $1000 in your bank account, and not withdraw it, but as things get more expensive, the purchasing power of that $1000 lowers. So really, if you don’t invest, you’re losing out. We also know, that most of us do not have enough money to even be able to invest. We don’t have enough money to even step up to the plate. This leaves up in an endless, vicious cycle, of pain and poverty. The rich have money to invest and make more $$$. The rest do not. Problematic, and one of the great attractions of FinTech for me is to lower the barriers of entry to banking and finance tools, reducing increasing disparity arising from fortunes compounding and increasing exponentially.

A smart contract is so useful here in the following ways. It can be used to handle the ICO (initial coin offering, the Real Asset Tokenisation of IPOs). In an ICO, someone typically offers buyers new units of a cryptocurrency in exchange for fiat/established cryptocurrencies, to raise money. It can be used to handle the transfer of shares, say for example, a deceased mother whose assets are transferred to her son on his turning 18. I’ve pieced together some demo code for this, below:

Interestingly, because we actually want this to work in the real world, and not just as a concept, the smart contract, will ideally be legally binding as well. This means that the implementation and design of the code is actually influenced by codes of law. Already, in the example above, we can see how law influences the code. The variable of birthday is influenced by the legal requirement that wills for children will be held on trust until they reach maturity. Thus, they can influence the value of variables.

Another example may be that because a Blockchain is immutable, while minds and contracts are not, code will need to be written in to “revoke” the Blockchain. Say new legislation comes into play to influence how ICOs should be conducted. The Blockchain and the smart contract which was based on previous legislation cannot now be changed. The only way forward is to renounce the past version, create a new version, and transfer the legally binding records to the new one. Thus, depending on what the law says, e.g. if the law says people concurring votes from people representing more than 50% of the asset’s total valuation, code to accommodate for this will need to be written in.

Furthermore, they may influence which variables and conditions are included in the code. Perhaps the law will say, some things will need to be recorded, like date of transaction, who signed off etc. We might Oraclize smart contracts to work with external APIs, such that for example, if your fitness tracker picks up excessive alcohol in the system, the smart contract will not be executed and you will not transfer any tokens.

As it stands, we still generally know very little about what traditional law requires or wants us to do, in terms of the execution of FinTech applications. We know even less about how this can be coded, meaning that startups live in my favourite state of mind: let’s assume it’s OK until someone tells you otherwise. The aim of the game, however, hopefully, is to design code around smart contracts intelligently. It is for startups and governments to be aware of the sort of inter-disciplinary thinking, negotiating and confusion that is necessary in our new economy, and plan accordingly. Write smart contracts that will accommodate for the possibility of new regulations. Write laws that accommodate for how current smart contracts are coded, given the technical difficulties of engineers, and their general counsel in trying to advise them how to write them, in the face of little consensus or guidance.

Get Best Software Deals Directly In Your Inbox

Image for post
Image for post

Coinmonks

Coinmonks is a non-profit Crypto educational publication.

Sign up for Coinmonks

By Coinmonks

A newsletter that brings you week's best crypto and blockchain stories and trending news directly in your inbox, by CoinCodeCap.com Take a look.

By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy practices.

Check your inbox
Medium sent you an email at to complete your subscription.

Denise Wong Wai Yan

Written by

Coinmonks

Coinmonks

Coinmonks is a non-profit Crypto educational publication. Follow us on Twitter @coinmonks Our other project — https://coincodecap.com

Denise Wong Wai Yan

Written by

Coinmonks

Coinmonks

Coinmonks is a non-profit Crypto educational publication. Follow us on Twitter @coinmonks Our other project — https://coincodecap.com

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store