Smart Contracts: Smart, But At What Cost?
As blockchain technology evolves, smart contracts grow more commonplace. But what are they, exactly? And are they as smart as we think?
What are Smart Contracts?
Smart contracts are computer protocols that facilitate, verify, or enforce the negotiation or performance of a contract. Smart contracts were first proposed by Nick Szabo in 1994 as a way to digitally execute and automate contract terms. Szabo, a computer scientist, law scholar, and cryptographer, realized that the decentralized ledger of cryptocurrency could be used for smart contracts.
Smart contracts provide a way to securely and transparently execute transactions without the need for a third party. Because smart contracts are stored on a blockchain, they aim for immutability and security. This makes them incredibly useful for sensitive agreements or transactions where trust is an issue.
But smart contracts are only as immutable as the blockchains they're stored on. If a blockchain is hacked or altered, smart contracts stored on that blockchain may be compromised as well. More on this later—let's break them down first.
Smart, But Extremely Simple
Think of smart contracts like vending machines. You put in X amount of currency, and the vending machine spits out Y product. Using smart contracts, you could set up a vending machine that sells digital products, like e-books or audio files. The smart contract would handle the transaction and once it's been verified, would release the digital product to the buyer. No need for a third party. No need to worry about the product not being delivered.
But we can take this very fundamental vending machine concept much further.
When X Happens, Y Follows
Smart contracts can be used to automate all sorts of real-world processes and transactions. For example, smart contracts could be used to automatically:
- Sell a product when certain conditions are met, like when the temperature drops below freezing.
- Release funds to a contractor when a project is completed.
- Verify the identity of a person before allowing them to enter a building.
- Manage a will or estate after someone passes away.
- Create a bet between two parties and release funds to the winner.
Contracts of all shapes and sizes require some level of trust between the parties involved. When X happens in the real world, we need to trust that Y will follow. Current contract executions require an intermediary, or middleman, to enforce the terms of the contract. This creates a level of centralization and control. It also introduces the possibility of human error or fraud.
When Smart Contracts are Not So Smart
While smart contracts have the potential to revolutionize how we interact and do business with each other, they're not perfect. In fact, crypto history is littered with smart contract failures.
One of the most infamous smart contract disasters is the DAO hack in 2016. The DAO was a decentralized autonomous organization built on the Ethereum blockchain. Its smart contract code was meant to fund projects that aligned with its vision of a decentralized future. But an unknown attacker exploited a vulnerability in its code, draining $60 million worth of ether (worth over $5 billion today) from the DAO. The DAO hack caused such a stir in the Ethereum community that they hard-forked the blockchain to return stolen ether to investors. This is why we have Ethereum (dominant chain) and Ethereum Classic (exploited chain) today.
This event highlights a key issue with smart contracts. They're only as good as their code. If there's a mistake or hole in the code, smart contracts can be exploited. And because smart contracts are stored on a blockchain, they're very difficult—if not impossible—to change once they've been deployed.
You're Only as Secure as Your Blockchain
The maturing crypto market has shown us that not all blockchains are created equal. Projects, chains, and platforms have come and gone over the years, promising faster transactions, scalability improvements, and cheaper fees. But all projects fall at different points on the DCS Triangle, and benefits to one area usually come at the cost of another.
Solana, which promises fast transactions, only does so at the cost of consistency and reliability. Suffering from several hours and outages on multiple occasions, the platform is far from battle-tested.
More recently, Terra LUNA, a DeFi yield-bearing stablecoin, lost its peg to the dollar due to a massive run on the liquidity pool. In days, its stablecoin, UST, went from being worth $1 to pennies. Accordingly, Terraform Labs, the team behind Terra, decided to shut down the project. The power to unilaterally shut down a smart contract platform proves that decentralization is more than just a buzzword—it's an absolute necessity.
So, while smart contracts have the potential to streamline and automate all sorts of processes and transactions, they come with their own set of risks and challenges. Decentralization, Consistency, and Scalability are a balancing act.
Just because a smart contract can be executed on a blockchain, doesn't mean it should be.
Smart contracts employ an ethos where "code is king." When platforms employ code on a blockchain that has cracks in its foundation, the smart contract can be used as a weapon to exploit those cracks. We've seen this happen time and again in the short history of smart contracts, and it will take time, effort, and experience to build smart contracts that are secure enough for mainstream adoption.
— Smart contracts employ a very basic operation: "When A happens, B follows."
— Smart contracts can be used to streamline and automate all sorts of processes and transactions from financial contracts to legal documents.
— Smart contracts have the potential to revolutionize how we interact with each other by eliminating the need for intermediaries.
— But smart contracts are only as good as their code. If there's a mistake or hole in the code, smart contracts can be exploited.
The Power of Blockchains: How This Technology Can Benefit the World
A blockchain is a decentralized digital ledger, which can be programmed to record transactions between two parties efficiently and in a verifiable and permanent way.
An Ode to Nodes: What Are They and Why They're Important
The Bitcoin network depends on nodes. Find out how they work, why they matter, and how to run a node yourself.
Lightning - Eliminating the Tradeoffs of the Blockchain Trilemma
Learn how Lightning will eliminate the tradeoffs between decentralisation, security and scalability that prevent scaling and widespread adoption.