Smart contracts, what the heck?


Smart contracts, what the heck?

Some context

Smart contracts are another of those terms that we are starting to get tired of hearing. In magazines, on television, at dinner with your brother-in-law, in the supermarket queue… In short, another of the many fashionable concepts repeated ad nauseam. However, apart from repeating them like a mantra, what are Smart Contracts and, more importantly, what the hell are they for?

First of all, I would like to point out that, like everything else that emerged in the wake of the “crypto” world, it did so with the aim of benefiting the end consumer. Back in the 1990s, with the emergence of consumer computing, ideas were already being put forward to automate contractual relations between different actors without the need for the figure of the intermediary (a figure who usually keeps a profit margin by making transactions more expensive by carrying out tasks that on many occasions nobody has asked for).

In any case, practically everyone has heard of Satoshi Nakamoto at some point in reference to the person or persons who created Bitcoin, so it is fair to recognise that the precursor of Smart Contracts is Nick Szabo, back in 1998.

Smart Contract, what it is?

A Smart Contract is like a typical paper contract and probably with better terms than an employment contract. Joking aside, these contracts will allow any resource to be exchanged securely, transparently and by eliminating the need for an intermediary (if there are no intermediaries, are commissions still necessary? Oh…).

The simplest example was also defined by Szabo. Smart contracts are like a vending machine. When we receive an input of money + selection (something healthy, of course) we get … A snack!. What happens in an ordinary shop? You go in, look at what you like and order it. Then a shop assistant will serve your selection to you and finally you will pay for the service and the snack. The shop assistant might go into a store far from your sight and just sit for 5 or 10 minutes absorbed in his thoughts and on his return, charge you a supplement for how difficult it was to find your snack in the store, this is not very transparent, isn’t it?.

Of course, the human touch when it comes to having a coffee is to be welcomed and we do not want to eliminate it (yet), but the human touch in which a fruit is 200% more expensive from the time it is picked until it reaches your table is an undesirable process. The invisible hand is, of course, undesirable.

Smart contracts are a step forward in transparency. Today, these contracts refer to small (or not so small) pieces of code that are able to launch themselves under certain circumstances (input conditions). Moreover, they are fully auditable, in the sense that anyone is able to inspect what a given contract does and how it does it.

Okay, okay, but what if someone decides to change a Smart Contract and modify it in such a way that, for example, the sum of 2 + 2 becomes 5? Don’t panic! Today, Smart Contracts are backed by Blockchain technology. This means that in addition to their code being visible to anyone, they have the immutability and decentralisation inherent to this technology.

So they cannot be changed? Not exactly. What you put into the chain, stays in the chain. So what happens is that we create new contracts as we want to update the way they work. This again requires consensus among the participants of the Blockchain network and therefore, if someone with bad intentions decides to make changes of dubious legitimacy, the whole network would have to agree to accept it for that change to happen.

In a nutshell: A Smart Contract is a computer program that is stored and launched in the context of a Blockchain network (Bitcoin, Ethereum …).

Smart contract main features

These contracts have certain characteristics that are interesting to comment on:

  • Distributed: As they are stored in the Blockchain network, we already know that all nodes have a replicated copy of the contract. All participants will always have the same version and unilateral modifications are avoided.
  • Deterministic: The contract is only launched when the input conditions are met. The final result will always be the same for the same input no matter who launches it.
  • Autonomous: They can automate virtually any task.
  • Immutable: Once installed on the network, they are unchangeable.
  • Customisable: We can create contracts to model our needs (even if our needs are to sell color-cats -NFT- we can do it…).
  • Trustless: We do not need third parties to operate them.
  • Transparent: Their code is visible and auditable by anyone (assuming that the Blockchain network is a public one. We’ve got private Blockchain networks where this situation differs a bit).

Some usage examples

Contracts can be used in a very wide variety of scenarios. Moving away from the example of cryptocurrencies, we will point to governance, healthcare or supply chain processes.

  • Voting systems (government). In this scenario they provide a secure environment that makes the voting system less susceptible to manipulation. Votes using smart contracts would also be protected with blockchain technology, making everything extremely difficult to tamper with.
  • Health. This is a particularly critical scenario, given the sensitivity of the data. Contracts would allow the storage of encrypted patient medical data, granting access to specific users for privacy reasons (i.e., patient and the doctor).
  • Supply chain. Smart contracts can be used for inventory management and the automation of payments and tasks. Essentially, we can replace paper-based product traceability with digital traceability supported by the Blockchain network. Improving the accessibility of and maintaining excellent security conditions.

We won’t go into too much detail, but a quick search in your favourite search engine can offer many interesting applications.

If they are so good…

The concept is very good, but Smart Contracts are code. Programmers are human (or so it seems). Humans make mistakes. Therefore, if programmers produce code in form of Smart Contracts, then they can have mistakes, so they can be flawed (YAY, LOGIC!). A failure in some kind of presumed critical contract could lead to consequences like massive hacks or other kinds of losses. So yes, smart contract technology is very good but unless we stop being humans it is best to take it slow and not put all the eggs in the same basket. In addition, the immutability of contracts also means that the ability to react to such problems is quite limited, leaving a fairly wide window of failure in the event of catastrophic failure.

It is true that, if we can polish the quality mechanisms to limit catastrophic errors and make the whole infrastructure of consistent quality, the inclusion of this technology can bring many benefits almost immediately. Therefore, it should not be overlooked.

comments powered by Disqus