
Welcome to my first attempt at making crypto deep dives simple enough. I want the world to be a better place with the blockchain solving so many problems and being so widely adopted that I barely have to worry about centralization. So yes, I am doing this for very selfish reasons.
I am sure you have heard about smart contracts as that's all the blockchain engineers talk about. “I wrote a smart contract today” “There was a bug in the smart contract and millions of dollars were stolen from the protocol” and other sad stories that have nothing to do with what smart contracts actually are.
The first thing you should know is that smart contracts are code written by engineers that allow applications to work on blockchains like Ethereum. If you made it this far and your head hasn't gone on lockdown yet you should keep going as you have learned the singular most important thing on your road to understanding smart contracts.
You must be thinking; the words that make up this concept are “smart” and “contract” . The only problem is, they are neither smart nor contracts (in the real sense of the word). They are basically codes that an engineer created to do thing A if certain criteria are met over and over again.
**Let me tell you a simple story to explain this. ** A King has put the castle up for rent through the blockchain, and the rental payment has been made in cryptocurrency. The renter received a receipt which is held in a smart contract with the following terms: The King must give the renter a digital entry key by a specified date. If the key doesn’t come on time, the blockchain releases a refund. If it does, the smart contract validates and releases both the rental fee to the King and the key to the renter.
The smart contract works on the If-Then premise, so the renter can expect a faultless delivery. If the King gives the renter the key, then he is sure to be paid. If the renter sends a certain amount of cryptocurrency, then the renter receives the key from the King.
The code cannot be interfered with by either party without the other knowing since all participants are simultaneously alerted and the code is open source, meaning it is publicly viewable.
**Why do smart contracts work? ** They are immutable: Once deployed, the code of a smart contract cannot change. The only way to modify a smart contract is to deploy a new instance (Let the engineers worry about that)
They are deterministic: The outcome of the execution of a smart contract is the same for everyone who runs it. They either happen in full, exactly as described, or they don’t run at all.
What do vending machines have to do with this? The vending machine is considered to be the primitive ancestor of smart contracts. The machine takes in coins, and via a simple mechanism, dispenses change and products according to the displayed price. A vending machine is a contract with the bearer: anybody with coins can participate in an exchange with the vendor. The lockbox and other security mechanisms protect the stored coins and products from attackers, at this moment allowing vending machines to exist profitably in a wide variety of areas.
**How can smart contracts improve the world as is? ** Smart contracts have applications far beyond improving the reliability & efficiency of rent collection. In fact, any processes that currently involve manual interactions between two parties can be automated and the value can be moved in real time over the blockchain, rather than settling days later as with traditional banking.
Ethereum and smart contracts are helping to build the “smart economy” – one in which slow, manual, error-prone processes that rely on intermediaries are replaced with automated processes that are entirely transparent, verifiable, and thus trustworthy.
The best part is that a “middleman” or any rent-seeking third party can in theory be completely eliminated. Plus (apart from some gas fees to power the network) there is no charge to set up and deploy. Smart contracts are what enable developers to create decentralized applications or ‘dApps’. They are also what allows dApps to be Turing complete, which means that given the required resources, a Dapp can perform any action.
In another article, I'll spend some time sharing already implemented and possible use cases of smart contracts.
Smart contracts are code written by engineers that allow applications to work on blockchains like Ethereum.
They work on the If-then premise. If action A happens then action B can happen.
Once deployed, the code of a smart contract cannot change except when a new instance is deployed.
The outcome of the execution of a smart contract is the same for everyone who runs it.
With smart contracts, the third party can in theory be completely eliminated.
I hope that you enjoyed this simplified deep dive, you can subscribe to my newsletter “Into the Web3verse” for more simplified deep dives.
