Smart Contracts
What is a Smart Contract?
A smart contract is a self-executing contract defined by a computer program, in which the terms and execution of the agreement are built into immutable code and recorded on a blockchain.
Traditionally, a contract is an agreement between two or more parties to exchange promises and/or services, and there are often multiple parts of this agreement. For instance, a promise, such as a monetary payment, can be exchanged for another promise or for a service, or a service can be exchanged for a service.
Additionally, there can be many terms of contracts that dictate the exchange, such as the timing of the exchange. Is it immediate? Does it have an expiration date? What are the circumstances in which the contract becomes void. These details are the reason why some of the most common contracts, such as ones outlining the terms of loans and employment, are so long.
In smart contracts, the word “smart” merely implies that this contract is carried out by computer programming code, rather than on a piece of paper or in some other form.
The term “smart contract” – now ubiquitous in the 2020s – was coined in the 1990s by Nick Szabo, a lawyer and computer scientist who was one of the early proponents of cryptocurrencies.
In a paper published in 1996, Szabo defined a smart contract as “a set of promises, specified in digital form, including the protocols within which the parties perform on the other promises.”
The promises of smart contracts are written in the form of “if-then” semantics, which is common in computer programming. The best real-world example of if-then functionality is the vending machine, which Nick Szabo first used to illustrate the operations of smart contracts.
Vending machines offer a great example for helping to understand how smart contracts work. If you put $1 into the machine, then it dispenses a snack for you. The entire transaction is pre-determined by the machine’s programming without external influences (human or institutional). Smart contracts are designed to autonomously execute functions in the same way – every time – without a human needing to be invovled.
Smart contracts vs. traditional contracts
Think about the last time you signed a traditional contract. What was necessary besides the piece of paper and the two parties signing the agreement?
Lawyers are often essential, first to write the contract’s language and then to ensure it is executed accordingly. If a contract is breached, you often need a judge, a courtroom, and other costly resources. In large financial exchanges such as buying a house, it is common to use an escrow, which is a third party who holds funds until both parties meet the agreed-upon conditions.
All these intermediaries and resources required to make binding agreements come at a cost, not to mention the trust you must put into these institutions to carry out their parts faithfully. Further, every resource used in these settings also uses time, meaning that contracts can take days or weeks to process.
Fundamentally, smart contracts don’t depend on many of the same assumptions and requirements thanks to several features:
- Immutability – When a smart contract is written and executed, it cannot be changed, and thus is permanent. Since computers running the blockchain, known as nodes, store an identical copy of the contract, any change to the contract is impossible without consensus on the network.
- Trustlessness – Each smart contract is also self-sufficient, meaning it doesn’t rely on other factors like lawyers and financial institutions to execute its functions. Removing external influence means that the same result can be expected every time, without the required external trust. As a result, even the most complicated transactions can be performed in seconds or minutes when they would otherwise take much longer
Of note, since smart contracts remove the middlemen, you don’t have to pay, trust, or wait for third parties to execute them, making them a more attractive alternative to traditional contracts for some.
What are smart contracts on the blockchain?
Smart contracts are the heart and soul of blockchain technology.
Bitcoin smart contracts are intended to operate on the Bitcoin blockchain, setting specific rules for transactions and recording them in the public ledger.
Ethereum smart contracts are specifically built to support other smart contracts (otherwise known as programs or decentralized applications) that operate on top of its own blockchain. These applications are written in programming languages specifically designed to support contract writing, called Solidity and Vyper.
Let’s take an Ethereum smart contract example using Golem (GNT), a platform that creates a marketplace for computing power. Golem’s smart contract allows anyone to request computing resources from the community for a fee. Once the network confirms the funds from the requester and the completion of the tasks from the provider, the conditions are met and the contract executes: the requester receives computing power from those offering their resources, and GNT is transferred automatically from them to the accounts that offered their services. If all of the predetermined conditions aren’t met, then the contract doesn’t execute.
Limitations of smart contracts:
- Subjectivity – The functionality of smart contracts is limited by what is written into its code. If there is any degree of subjectivity or need for flexibility in a contract, it becomes difficult to build into its design.
- High effort to change – If there are bugs or loopholes in the code, changing the contract requires significant work from the community and consensus agreement from the network’s nodes.
- Incorporating real-world data – Smart contracts often require the use of real-world data, such as knowing the value of the U.S. dollar, a stock price, or the location of a product being shipped across the world, to execute. While third parties often provide this information, oracle technology (like Chainlink or Band Protocol) works to bring this information into the blockchain using off-chain data.
Get started today
If you are ready to take the next step, click the button below to sign up for a Kraken account and start buying smart contract protocols today!
The future of smart contracts
Developers have just started to explore the depth of capabilities offered by the smart contracts that power blockchain technology.
The uses for this technology are growing exponentially, and many can see the opportunities in new spaces where traditional contracts currently dictate transactions.
Examples of the potential uses include: mortgages, digital identity management, supply chain logistics, stock market trading and securities, organ allocation/transplant lists, renting/leasing of property, and more.