Smart contracts play an integral role in the blockchain ecosystem, enabling the creation of decentralised applications (DApps) and programmable payments. In this guide, we will explain how smart contracts work, highlight their unique applications, list the most popular chains they operate on, and whether they can be considered legally binding agreements under contract law.
What is a smart contract?
A smart contract is a program running on a blockchain that automatically executes an outcome when certain predetermined conditions are met. Smart contracts are commonly used to automate the implementation of an agreement so that all the parties are aware of the action without any third-party involvement.
In technical terms, smart contracts can be described as computer code running on a blockchain that automatically executes a portion or the entirety of an agreement. The code can either be an agreement between the participants or complement a traditional contract and execute certain provisions. For instance, transferring funds from one party (A) to another party (B).
Smart contracts share the same features a blockchain offers, such as immutability and transparency, with the code being replicated across multiple nodes in the chain. This means with each new block being added to the chain, the smart contract is also in effect and being executed. Therefore, if transacting parties have indicated certain parameters have been fulfilled, the code will execute the action based on those parameters. On the flip side, if no transaction has been initiated, the code will remain inactive. Smart contracts are like a digital handshake
How do smart contracts work?
Smart contracts operate by following input parameters that are written into a code on a blockchain. To put it simply, if condition ‘X’ happens then execute action ‘Y’. At the moment, the tasks being performed by smart contracts are fairly basic, such as releasing funds from an escrow or reserve once certain conditions are met by the transacting parties.
Currently, smart contracts are being used to automatically execute two types of transactions:
- Ensuring funds are released when certain events are triggered.
- Acting as an enforcement tool by imposing financial penalties if certain objective conditions are not fulfilled.
In the former case, the smart contract has replaced the need of a human acting as a trusted escrow. In the latter case, there is no judicial enforcer required to impose penalties. In both scenarios, the smart contract serves to reduce the administrative costs associated with execution and enforcement.
Proponents for blockchain-powered automation argue that in the future, more transaction steps will be written into code to enable smart contracts to determine legal criteria. Smart contracts can accommodate as many process stipulations as are needed to satisfy all parties that the task will be completed satisfactorily. For this to happen, the participants must determine how transactions and data are represented in the blockchain network.
Moreover, they must agree on ‘if, then, when’ logic that will govern the transactions, handle all the exceptions and define a dispute resolution mechanism. On most blockchains, before traders can execute a compiled smart contract, traders need to pay a transaction fee for the contract to be added on-chain and executed upon. For instance, the Ethereum network requires “gas” fees when smart contracts are executed. The more complex transaction steps therein, the higher the gas fees needed to execute the smart contract. Gas fees act as a useful moderator to prevent complex or many smart contracts from overwhelming the network.
The history of smart contracts
The term “smart contract” was first used by renowned computer scientist, Nick Szabo, in the early ’90s while he was an undergrad at the University of Washington. Szabo described smart contracts as a “set of promises, specified in digital form, including protocols within which the parties perform on these promises.” Szabo uses the word ‘smart’ when comparing smart contracts to physical contracts.
In other words, smart contracts may be smarter than traditional contracts since they can automatically execute predetermined outcomes, yet they should not be viewed as intelligent tools that can break down a contract’s more subjective elements.
Szabo likes to use the analogy of a vending machine to explain smart contracts. Once traders have inserted money into the machine, it automatically executes the terms of the agreement and releases the snack. It wasn’t until the emergence of blockchain, however, that smart contracts became a reality as the technology to execute them finally came into existence.
What are examples of smart contracts being used in the world?
Smart contracts can be applied across several industries to automate and streamline how business is conducted around the globe.
Smart contracts and NFTs
- Blockchain technology in gaming is mostly driven by non-fungible tokens (NFTs), which are unique digital assets that represent in-game items.
- NFTs rely on smart contracts to assign ownership and manage the transferability of the NFTs. Typically, when traders create an NFT, the execute code is stored in smart contracts that are conformable to ERC-721 standards.
- This information is stored in the blockchain protocol, where the NFT is managed.
Smart contracts for building DAOs
- Decentralised autonomous organisations (DAOs) are organisations represented by rules written into the blockchain, structured in a decentralised manner.
- DAOs function as corporations where ownership and compensation can be written into smart contracts.
- DAOs rely on smart contracts to create a corporate framework and automate the structure for incentive payment.
Smart contracts in real estate
- Smart contracts are advancing tokenisation through fractional ownership of assets and thus reducing the investment costs by incorporating blockchain technology into real estate transactions.
- Smart contracts can eliminate the hidden costs associated with buying property, such as closing fees, broker fees and title transfers.
- For tokenised properties, most of the record-keeping can occur through smart contracts, which can save both transacting parties time and money.
- Smart contracts can also streamline rental, credit and mortgage agreements.
- Generally, the use of smart contracts in the real estate sector lessens the need for costly legal and advisory services.
What is the most popular blockchain for using smart contracts?
With the emergence of altcoins, the need and want for smart contracts has grown incredibly. Starting with Ethereum, smart contracts are now present on some of the most popular and widely used cryptocurrencies.
- Ethereum (ETH). Ethereum was the first blockchain network to introduce smart contracts. As a result, smart contracts power up a significant portion of the network. As a matter of fact, the lion’s share of decentralised applications run on the Ethereum network. However, this success has not come without its own share of headaches, including high gas fees and scalability issues that have made Ethereum slow and costly. On the bright side, Ethereum 2.0, the newer upgraded version is set to solve some of these issues though that will not be completed until some time in 2022.
- Solana (SOL). Solana is among the fastest blockchain networks, with speeds of 50,000 transactions per second (TPS). This is a far cry from Ethereum, which can process an average 30 TPS, though that may dramatically speed up once Ethereum 2.0 goes live. The Solana network deploys a ‘proof of history’ to process transactions faster. The chain has around 400 projects operating on its system, including the rapidly growing stablecoin USDC, which runs on Ethereum, Solana, and a handful of other chains.
- Polkadot (DOT). Polkadot is known for its interoperability utilising a feature called parachains. These operate parallel to the main blockchain and enable it to process transactions quicker. The smart contracts run on the parachains instead of the Polkadot blockchain.
- Hyperledger Fabric. Hyperledger is an open-source, international platform that allows for the development and creation of enterprise-grade blockchain networks to support business transactions and to promote collaborative blockchain technologies across different verticals. The smart contracts document the business processes wanted to automate between the permissioned members in the network.
- Cardano (ADA). Cardano is another promising blockchain network attracting the attention of developers. The network recently rolled out the Alonzo hard fork that allowed the listing of over 200 smart contracts. However, they are currently in time lock and cannot be used by developers until their release date. The Cardano network will be compatible with the Ethereum Virtual Machine (EVM) through side chains and is positioning itself to attract DeFi developers who are looking to save money on transaction costs.
Are smart contracts legally binding?
According to a paper on Smart Contracts and its Limitations by the Harvard Law School Forum on Corporate Governance, for us to determine if contracts are legally binding, we must first understand the difference between an agreement and a contract. Most English speaking jurisdictions recognise that while two parties can enter into a number of agreements, a contract is a legally binding agreement that can be enforced through a court of law. But for contracts to be legally enforced, the courts have to establish whether the common law threshold of offer, acceptance and consideration have been met. Fortunately, these basic requirements can be achieved via ancillary smart contracts.
For example, an insurer may develop a flight insurance policy that automatically provides the insured with a payout should his flight be delayed by a few hours.
Key terms, such as outlining how the delay is determined can be written in a traditional text-based contract with the payment of the premium upon verifiable delay being handled via an ancillary smart contract. That said, a smart contract is not a legal per se contract. Instead, if all the requirements for a legal contract are satisfied (acceptance, consideration, legal intent and certainty), then a smart contract can be a legally binding contract much in the same way that binding contracts can be created electronically through online applications.
What are the benefits of smart contracts?
- Speed, accuracy and efficiency. Since smart contracts are automated and digital, less time and effort is spent in processing paperwork and reconciling errors, and this improves turnaround time and efficiency. Once the conditions are met, the contract is executed almost instantly.
- Trust. The lack of intermediaries and sharing of records in a distributed manner is essential to fostering trust and transparency as no records can be altered or manipulated.
- Security. Records in the blockchain are encrypted, which makes them difficult to hack. Also, because all the subsequent blocks are interconnected, there is no single point of failure for malicious actors to exploit.
- Savings. By eliminating third parties in transactions and processes, smart contracts serve to reduce costs associated with delays and fees.
What are the issues associated with smart contracts?
Smart contracts have a lot of potential in today's highly interconnected world but certain clashes between how the smart contracts operate and parties transact may raise a number of issues. Let’s take a look at the main issues.
- Non-technical parties handling smart contracts. A key issue that may hamper the widespread adoption of smart contracts is that parties need to rely on trusted technical experts or be tech-savvy themselves to accurately capture the parties agreement in code.A non-tech-savvy audience will be unable to understand even the most rudimentary smart contract and is, therefore, increasingly reliant on an expert to explain the contract’s wording. This opens the door to fraud or manipulation.
- Smart contract over-reliance on off-chain data. Smart contracts don’t have the ability to ‘pull’ data from off-chain resources (external sources outside the blockchain). Instead, the information needs to be ‘pushed’ to the smart contract. This raises the issue of how reliable is the transmitting mechanism, how accurate is the data and delays in nodes receiving data, thus leading to inconsistencies in the data, and subsequently, conditions set in the code will not be met. Luckily, ‘Oracles’ seem to be one way to remedy this issue in the interim. These are trusted third parties that retrieve off-chain information and push it to the blockchain at predetermined intervals. However, there are still some inherent flaws in these systems that need to be addressed.
- The inflexible nature of smart contracts. While smart contracts are lauded for their ability to automatically execute transactions without the need for a human presence, this creates a problem. The fact that users cannot easily amend or terminate a smart contract - unless all parties wrote such capabilities into the code from the onset - makes it unsuitable for the ever-changing commercial environments.