Week 33 — Smart Contracts & Why They Are More Dumb Than Smart

Adriel Fong
7 min readMay 4, 2021

A couple of months back, I was sitting down on a stool at my regular hair salon waiting for my turn to get my hair under control and I had an interesting thought crossing my mind …

What happens if after my hairstylist cuts my hair, I’m unhappy with the result of the service and subsequently decide not to pay for it?

As a business owner, what can you do about it? As a consumer how do we guard against such situations? Yes, the policy of legal tender dictates that when a service is provided, you are obligated to pay the vendor with the correct currency.

In my case of receiving the haircut from the hairstylist, I have incurred a debt with the business and thus must repay the debt with Singapore Dollars, no other currency or is accepted.

As I was thinking about this, my mind led me to more questions …

Can I automate this? Is there a way to facilitate this transfer of value where I don’t have to rely on a 3rd party (escrow/ custodian) service like how Paypal and Alibaba have set up their payment processes?

Smart Contracts: The Magic Bullet?

Essentially, a smart contract is a self-enforcing agreement, formalised as a software. In the smart contract, there are rules that are coded into the contract that dictate a certain agreement. Once the parties involved in this smart contract fulfill the criteria set by the rules in the smart contract, the blockchain network then verifies the transaction automatically and produces an output.

Think of it like a vending machine. The cost to buy a bottle of water from the vending machine has to be coded in. Once you have dropped in the right amount of money, the product automatically gets transferred to your possession after hitting the button. If you do not place enough money into the machine, you will not get the product. If you place more than enough money, you’ll get your product and some change to go with it.

These rules that dictate the circumstances of commerce in the context of a vending machine and these rules relate closely to how a smart contract actually works.

Yes, this means that smart contracts work 24/7, no “getting back to you in 3–5 business days” or the 9–5 kind of restriction.

But at the same time, smart contracts cannot navigate the intricacies of certain scenarios that require conflict settlement.

Take a look at the image above, what would you do if this happened to you? Would settlement beeasy? Probably not worth wasting a minimum of 1 hour of your time waiting for the technicians to rectify the error. You’re better off walking away and getting on with your day.

It’s the same with smart contracts.

All in all, smart contracts are neither smart … nor are they contracts in the legal sense. Although it is currently unable to navigate the complexities in the enforcement of the clauses within legal contracts, this is an incredibly useful tool for many legacy, paper-driven industries that are ripe for automation of simple tasks.

So, why are they called smart contracts when it is such an oxymoron?

The History Of Nick Szabo’s Smart Contract Vision

Nick Szabo first came up with the concept of a smart contract back in 1996. His called it smart because he envisioned it to be automatically verified and executed. This forms a transaction log where once the terms of an agreement are met, the desired output is executed.

This solution creates a proactive measure against the breaching of the contract, meaning to say that if you wanted to borrow $100 from me today, you need to pass me your diamond ring as a collateral. A reactive legal solution involves first taking my $100 without putting up a collateral and then pressing legal action against you.

A proactive solution prevents you from even smelling the $100 before you have even locked in your collateral. Yes, you can hire an escrow agent to facilitate the transaction, but that would mean that you need to trust the third party.

Szabo saw smart contracts as an automatic trigger of action, needing to be easily verified and enforceable. Smart contracts are required to be attack resistant, meaning the code had to be set up properly and also auditable.

He did not however, have the luxury of knowing how decentralisation would play such a huge role in his concept of a smart contract.

Smart Contract 2.0

There are many flaws in how current smart contracts are set up. In order for smart contracts to be more pervasive in real-life societies, there are 3 main pillars that have to be erected:

Pillar #1 — Oracles are key

Because smart contracts live on blockchain networks (for example Ethereum and Binance Smart Chain), they are unable to access information from the outside world.

Therefore, oracles are vital in the next stage for smart contracts. Oracles take in information from the outside world and filter out the relevant information for the smart contract.

Referring to the example of me loaning you $100, imagine if there was no way for me to know if you had successfully deposited the collateral, it would destroy the very fabric of our agreement, leading to a huge argument and complete breakdown of the deal.

These oracles feed external information to the smart contract to unlock changes within the ledger. Without oracles, smart contracts cannot reach the real world.

Pillar #2 — Secure Coding

I briefly touched on this in the previous section, but essentially everyone needs to be able to “trust” the code of the contract. If there is a loophole in the contract, exploitation will happen like in the case of Pancakeswap. In October or November 2020, there was a huge error within the CAKE smart contract and that caused a massive sell off, plummeting the token price to less than a dollar.

Such issues with the coding of the smart contract will result in catastrophic failure.

Pillar #3 — Settlement Procedures

In order for smart contracts to be achieve mainstream adoption, settlement procedures crucial to ensure if any disputes arise, there are processes in place to organise and carry out rectifying instructions.

Elysium 2013

This chasm is perfectly represented in the 2013 film Elysium where Matt Damon goes up to a government bureau to collect drugs to treat his cancer induced by accidental radiation poisoning. He tries to reason with the bureaucratic robot but is unable to do so because the robot is only programmed with rudimentary conflict resolution capabilities. The robot basically dumps pills on him and tells him to bugger off or speak to a human being (by then he would probably be dead).

Settlement procedures are essential in both on-chain and off-chain situations. These mechanisms must help to resolve unforeseen circumstances.

In the case of merging legal contracts with smart contracts, this will take a long time and multi-disciplinary studies across computer science, economics and the legal profession are needed in order to take the next step forward.

Buying A Car With Smart Contracts

In a Web3 future, the process of buying a car could look completely different from how things are currently. Smart contracts can be used to streamline the process of interacting with trusted third party intermediaries.

For both you and the used-car dealership that you wish to purchase the car from, the process of interacting with the authorised vehicle registry, car insurer, bank and other parties is a complex and tedious one.

This complexity leads to high fees for both the business and the client. Using DLT (Distributed Ledger Technology), workflows can be enhanced to be more efficient. Smart contracts can also be used to formalise the loan agreements and the sale of the vehicle.

For all of that to happen, smart contracts need to support the required criteria of purchasing the vehicle. It could mean that multiple smart contracts are required or the level of complexity in a single smart contract must be very high.

By all means, I’m not saying that smart contracts are perfect and they will replace everyone’s jobs within the next 5 years. But what I’m saying is that smart contracts are extremely useful and it has the potential to be a mainstay in our society in the decades to come.

In Singapore alone, this revolution has already begun with Opencerts, where employers can verify an applicant’s graduation cert on the Opencerts dashboard which is built on the Ethereum blockchain. It’s an exciting time and the future looks bright for the industry.

Till next week!