The rise of blockchain technology is already changing the world, but it wouldn't be possible without a few crucial innovations that came first. One of these is the invention of a smart contract, a type of automated program that has revolutionized the world of decentralised finance (DeFi).
While they may sound complicated at first, smart contracts are a simple but effective tool used by most blockchain platforms today.
Smart Contract Defined
A smart contract is a program that automatically executes a transaction once a certain set of criteria has been met.
What makes them "smart" is that they are self-executing. Rather than needing to go to a lawyer, smart contracts are able to automatically execute an arrangement without needing a third party or intermediary to facilitate it.
The first smart contracts were invented in 1994 by Nick Szabo, an American computer scientist and cryptographer. However, they remained largely theoretical until the introduction of Ethereum, which fully opened the doors for smart contract development.
How Do Smart Contracts Work?
Smart contracts follow simple conditional statements written into the code on a blockchain. The smart contract automatically executes its pre-programmed response if certain pre-written conditions are met. These actions may include releasing funds, receiving a document or a license, registering a vehicle, or anything else that could be transactional in nature.
Once a smart contract is executed, the blockchain network it's built from is updated to register this transaction. Once this is done, the transaction cannot be changed, and only parties who have been given permission can see the results.
When explaining smart contracts, a popular metaphor is that of a digital vending machine. This is because unlike buying something at a store in the real world, using a vending machine is automatic and doesn't require anyone else.
Why Are Smart Contracts Important?
Smart contracts are important because they can enforce an agreement without requiring the threat of going to court. In a normal contract, if one party refuses to live up to their end of their deal, the other party can sue.
However, a smart contract bypasses the need for this altogether. Instead, smart contracts automatically enforce the contract's rules without the need to involve a third party.
For example, in a traditional contract, one party could receive payment but refuse to transfer over their goods or services. With smart contracts, that's impossible, as the smart contract automatically facilitates the exchange as designed by its code.
Without smart contracts, blockchain technology and decentralised finance would be much more limited in terms of their scope. Decentralised applications (Dapps) wouldn't function without them, either.
Smart Contract Use Cases
There are many different use cases for smart contracts, but currently, they are mainly used in DeFi and Dapps. These decentralised platforms rely on smart contracts to execute trades, especially on decentralised exchanges (DEXs) like Uniswap.
Smart contracts can also be used to transfer ownership of fungible assets. This could include legal rights, documents, and certifications. One example could be someone who wants to buy a house with Bitcoin. Both parties can use a smart contract that automatically transfers the legal deed once a certain number of bitcoins are deposited into an escrow account.
How Is Ethereum Related to Smart Contracts?
Most smart contracts are run on the Ethereum (ETH) blockchain, but many other blockchain networks, like Cardano or IOT, use them, too.
Before Ethereum emerged, smart contracts were very limited in what they could do. Although the world's first cryptocurrency, Bitcoin, has basic smart contract support, it paled in comparison to the developer tools that the Ethereum blockchain offers.
More specifically, Ethereum's programming language uses solidity, which means it supports a wider set of computational instructions than other developer tools. This gives developers more freedom to create whatever type of smart contracts they want. The downside is that many of these newer smart contracts are more at risk of getting hacked because they aren't as well tested.
Smart Contracts And Crypto NFTs
Just as smart contracts are used to transfer ownership of a deed or legal ownership of a digital asset, they can also be used for other purposes. Non-fungible tokens (NFTs), such as a piece of crypto art or a digital collectible, are traded amongst buyers and sellers thanks to smart contracts.
In the case of NFTs, a smart contract would distribute the NFT once a set of conditions are met based on the contract's code. In the case of most NFT marketplaces, that involves the buyer putting up a certain amount of Ether or other crypto as payment.
Can Smart Contracts Be Legally Enforced?
Smart contracts are designed to function without a third party or intermediary, and there's no contract law regarding smart contracts in most jurisdictions.
However, several organisations are trying to figure out how to make smart contracts more enforceable. Usually this involves a hybrid approach, using both a smart contract and a written legal agreement simultaneously. One approach is that a smart contract could include a piece of code that would simultaneously create a legal document defining the terms of the contract.
This makes sense when paying for an ongoing service, which is beyond the scope of a smart contract's ability to execute. The hope is that legally enforceable smart contracts could help incentivise and make mainstream the use of smart contracts throughout the regular, non-crypto world.
Benefits Of Smart Contracts
Smart contracts have some benefits for all parties involved in a transaction, and they include the following.
No Intermediaries And No Fees
Instead of hiring a lawyer to draft up a contract with witnesses, smart contracts allow both parties to save on transaction fees. This also removes the need for financial institutions. The only expense that's required is a small gas fee (usually Ether) to process the smart contract on the blockchain.
Authenticity And Security
Smart contracts are encoded onto the blockchain, so they can't be manipulated by third parties. Even in the 21st century, forgeries and fake legal documents are still an issue. However, smart contracts are also encrypted, so any documents attached to the contract remain safe from infiltration, as long as the smart contract's code is well-designed.
There's also less room for clerical errors. Processing a traditional contract has the possibility of clerical errors, especially when someone is manually filling in numerous forms. This isn't an issue for programs like smart contracts.
Faster To Process
Traditional transactions using normal contracts can take hours, if not days, to fully process. For example, both sides of a big investment or purchase would need to bring proof, whether from a bank or an institution, that they possess that asset required for a transaction ahead of time.
Smart contracts sidestep these lengthy delays and can be processed almost instantaneously. The only limitation would be congestion on a blockchain network, as sometimes is the case with Ethereum. However, more modern blockchain technology and consensus algorithms have the potential to make the networks exponentially faster.
Disadvantages Of Smart Contracts
Smart contracts are generally more advantageous than their traditional counterparts, but there are a few ways in which smart contracts aren't perfect.
Threat Of Hacks
There's the possibility of a smart contract being hacked. In this case, any digital currency or documents encoded within the smart contract could be stolen. This can occur if there are bugs within the smart contract's code. Poorly designed contracts that haven't been thoroughly tested are the most at risk, while those that have stood the test of time are more reliable.
The most recent example is the MonoX Finance hack, where a bug in the company's software that drafted smart contracts resulted in a hacker stealing more than US$31 million in cryptocurrencies.
While smart contracts are useful for transacting in specific goods, like cryptocurrencies, legal documents, or NFTs, they aren't as useful for certain arrangements, like ongoing services. As of this writing (March 2022), there's a weak legal regulation for enforcing smart contracts if the need arises to go to court.
Smart contracts are one the most important innovations in the blockchain world. Without smart contracts, decentralised applications would be impossible and would-be users would need third parties and intermediaries to facilitate transactions.
Smart contracts open the path to a much more decentralised world, which is the core vision behind blockchain technologies. While smart contracts have some limitations, their potential remains massive.
FXCM Research Team
FXCM Research Team consists of a number of FXCM's Market and Product Specialists.
Articles published by FXCM Research Team generally have numerous contributors and aim to provide general Educational and Informative content on Market News and Products.
Retrieved 07 Apr 2022 https://www.coindesk.com/learn/how-do-ethereum-smart-contracts-work/
Retrieved 07 Apr 2022 https://ethereum.org/en/developers/docs/smart-contracts/
Retrieved 07 Apr 2022 https://www.gemini.com/cryptopedia/smart-contract-examples-smart-contract-use-cases
Retrieved 07 Apr 2022 https://www.coindesk.com/learn/cardano-vs-ethereum-can-ada-solve-ethers-problems/
Retrieved 07 Apr 2022 https://corporatefinanceinstitute.com/resources/knowledge/deals/smart-contracts/