Smart Contracts. How stupid can they be?

Estimated reading time: 6 min
Level: Introduction+

The name Smart Contract may be misleading. Their strong point is in fact how stupid they are. They are stupid enough not to ask questions, do the same task over and over and… cannot be bribed.

Let me give you an example where you have already used a smart contract, not exactly a blockchain activity but in fact the same principle.

The numerous times you inserted a coin in a vending machine you called out and executed a smart contract. If the conditions of the smart contract where met you got your soda, chocolate or train ticket. You inserted enough money for the good. The good was available, change also available if needed, etc.

But what if there was a glitch in the contract? Let’s say it wouldn’t check in advance if it had change before giving the item, thus unable to fulfil its part? This is one of the dangers of the smart contracts… they in fact only execute, even if the execution is not working towards the goal.

A common joke among IT people goes along this lines: The wife asks the husband (IT geek), to pass by the shop and bring 1 liter of milk, if there’s bread buy 4, she adds… The husband shows up with 4 litters of milk…. a simple logical execution of the sentence… not very smart but accurate.

As humans we would argue on the actual meaning of the request above. We would all understand the meaning but in logical terms the machine would have taken the same decision as the “IT husband”.

This example is not a huge problem to solve in real life, we just change the sentence into more univocal or just wait for the executer to clarify any doubt… smart contracts don’t have doubts.

The blockchain is the opposite of Las Vegas… What happens in Blockchain also stays in the blockchain… but forever and visible to the whole world. So, “mistakes” like the above cannot be corrected, if not substituted by a new version will have bugs visible to exploiters. Having the code available to be read gives you the chance to be assured that it works as expected but also to the more experienced eye to see if there’s any bug to be exploited.

Ok, they are stupid. So, why are they “important”?

On our daily life we love them and don’t even notice. The vending machine above is only an example that included a transaction of monetary value for a good. But in fact from elevators, pin cards, or whatever interaction we take with machines, we may be triggering a decision tree that includes certain conditions to be met, one of them can be a form of authentication. ATM machines are a good example.

Smart Contracts, as we know them for the purpose, are also pieces of software that are stored in the blockchain and can be read and executed by anyone.

Below an example of a Smart Contract that would return “Hello World” when executed.
Just as curiosity it’s done in a language called Solidity, the most commonly used high level language on EVM (Ethereum Virtual Machine)

The purpose is not to dive into details and the “Hello World” example above is the starting point of every developer that starts a new language. Only the deployment would be decentralized on the blockchain. Available to anyone, a DAPP (Distributed Application) without 3rd parties involved.

To illustrate a good example of the Smart Contract usage let’s imagine a piece of real estate being sold. Usually there are some terms agreed, price, dates, etc., and a trusted party that makes sure the transfer of money is done with the transfer of the property.

Let’s use a simple process to simplify the analysis.

The buyer and the seller met with the Escrow Agent. They agree a final price, a date for the maturity of the contract and a down payment from the buyer as “good will”. It’s also decided that within 30 days the seller needs to settle the remining to get the transfer of property. Falling to do so will remove any liabilities on the seller that will also keep the down payment.

The Escrow is responsible to make sure all conditions are met, money transferred and property registered (In this case fees, taxes, etc also apply).
It’s like the Escrow receives the Real Estate as a deposit and will decide if it goes back to the seller or the buyer depending on the outcome. The property may never be transferred to the buyier but in those 30 days the seller is blocked from access e.g. cannot initiate another sale.

NFTs can be used to represent a property in the blockchain, a representation of the good. Not that crazy idea since it only replaces the property registration we have today in paper or digital form. Paper and current digital documents are cumbersome in validation and easy to copy. Replacing them with NFTs would be of immense value for security and transparency. Read a but on thins NFT POAP article.
This NFTs would have to be governed by State Institution, probably not on dedicated mainchains but on some federated infrastructure for the purpose.

A Smart Contract (or more) would be available for general execution. The buyer and the seller met, agree on the terms. The seller deposits the NFT on the smart contracts with instructions on down payment and deadline to lock the NFT, final price and final date to fulfil the deed.

The contract is then executed accordingly i.e. if the down payment and final one are done in time the process is automatic and the tax and legal part included in the execution.

Ok, stupid but very useful… so what’s the problem?

Auto-execution is a great feature given than any deviations (i.e. errors) doesn’t create big consequences. We are all amazed at self driving but also afraid of the stupid decisions machines can do.

Using our real estate sale example above, let’s say a “force majeure” appeared leaving the buying short of a few days to liquidate the final part. In real life these cases are dealt easily but almost impossible to deal on blockchain contract.

Smart contracts can be very complex, receive inputs from a huge amount of sources but they have a big limitation. They need to have been programmed with a decision tree that accounts for all conditions… “force majeure” is not one….

The governance party shall have (in this case) the authority to intervein or the smart contract have the possibility for a “graceful exit” in this cases.

They are here to stay…

Even if the Blockchain technology wasn’t developed we have smart contracts everywhere. Smart Contracts as described only makes their use more transparent, fast and democratic. But on the other hand they can expand usage to real life items we cannot apply them other wise.

The subject doesn’t die here but the essence of the article should have been met. A smart contract is nothing but a piece of instructions stored in the blockchain.

One their usage and use cases a lot of lines will be written, hopefully some by me.

The boring part below…

<cover: AI design>
<text: H>
<Images: Stolen with pride, no collaborations proposed>

Thanks for reading, H

 
Subscribe to Block-chaining my thoughts
Receive the latest updates directly to your inbox.
Mint this entry as an NFT to add it to your collection.
Verification
This entry has been permanently stored onchain and signed by its creator.