After School Special: What are Smart Contracts and why you should trust them
After School Special is an article series wherein we dive into specific Web 3.0 concepts to provide deeper understanding to our readers. This week, we’re looking into smart contracts and what makes them so smart.
Imagine your run-of-the-mill vending machine: it lets you pick a product, it takes payment according to the displayed price, then dispenses the product of your choice. The transaction is quick and simple. You have no need for a middleman because the machine’s system does your local grocer’s job with no fuss. Its rules are set and immutable: you pick, pay, and collect.
When decentralized finance was still in its gestation stage in the late 90’s, legal scholar, computer scientist, and cryptographer Nick Szabo referred to vending machines as primitive ancestors of what we now call smart contracts.
A smart contract in crypto is a means of transaction enabled by computer code. Expounding on Szabo’s vending machine analogy, if you put in certain bills that the machine says it doesn’t accept or coins that are not enough for the price of the food you wish to purchase, that vending machine returns your money and does not dispense your chosen product. A smart contract shares the same premise. Often referred to as “if this, then that”, it executes the promised end result of a transaction only if and when its set conditions are in place.
What, then, makes smart contracts trustworthy?
Indiscriminate and unbiased self-enforcement
Smart contracts are designed to be immune from human error and issues. If a smart contract promises to give you 10 Ethereum in exchange for 40 Basic Attention tokens, you will not get it for less. If a smart contract requires you to reach at least 200,000 followers by the end of the year to be awarded 50 Ethereum and you reach more, then you’ll still get the award. Correspondingly, a smart contract will only take the agreed-upon amount of payment from you through gas fees if its predetermined criteria are met.
Unlike in the physical world where we are prone to scams and failures of even our favorite sellers, code is indiscriminate and unbiased. The code is law. It will not work for anyone who cannot uphold their end of the transaction. This makes it very reliable, as it protects you and every other user from engaging in transactions that are unsatisfactory or, at worst, fraudulent in nature.
Immutability and transparency
A smart contract, once written on the blockchain, is permanent. It cannot be modified. While this could mean stability for a well-functioning smart contract, this could also mean smart contracts that suffer from bugs and inefficiency will forever be bugged and inefficient. In such cases, users create new ones and tell others not to use the old existing bugged and inefficient ones.
Thankfully, these immutable bugged smart contracts may easily be determined as such because smart contracts are also distributed. The code of any smart contract, as well as the manner by which a user participates in it, may be accessed by anyone across the globe. This transparency makes it inarguable, trustworthy.
No need for a middleman
Because code renders it perpetually self-enforcing, smart contracts rid the need for a middleman. But aside from ensuring protection from human error and failures, it also means we get to engage in cheaper transactions.
When we purchase an item or a service from a company, we do not only pay for the item but also for all the labor that made it possible. In the physical world, buying an item through a delivery service costs much more, for example, than buying directly from a vending machine, as you don’t only pay for the item itself but for the courier, the vehicle’s fuel, and the computer system that enables you to book their service. In the same sense, a smart contract’s lack of a middleman makes for cheaper transactions.
The technology of smart contracts is powerful and the purposes for which they are written are boundless. From token switching and exchange, flash loans, reward systems, to insurance and buying real estate property, smart contracts provide fool-proof, transparent, accessible, and automated platforms on the blockchain without the need of a middleman and helps every user navigate the de-fi landscape with ease, and certainty that their crypto transactions are cheaper, safe, and satisfactory.