What Is a Smart Contract?

James HeadshotAuthor: James Page
Last Updated: August 2020

Disclaimer: We may receive a commission for purchases made through the links on our site. However, this does not impact our reviews and comparisons. Learn more about our Affiliate Disclosure.

A smart contract is an online contract stored on a digital ledger that allows you to exchange anything of value without the mediation of a third party. It’s cost-effective, irreversible, public, and most important of all, it’s secure.

Smart contracts are one of the most practical uses of popular blockchain technology. Some people even say it’s just a matter of time before they replace lawyers!

This is because, before the emergence of smart contracts, the traditional way of signing a contract required an intermediary such as a lawyer or a notary. This meant spending some extra money to pay for their services. Not to mention the lost time and occasional headaches, too.

Even though the paper-based contract is still the most common, now, there’s an alternative. To create a smart contract all you need to do is convert your contract into a computer code and run it on the trusted blockchain network. No central authority, no security issues or fraudulent activities.

Eager to find out more? Keep reading our detailed guide to learn all about these self-executable contracts.

The History of Smart Contracts

The Cypherpunks

The idea for smart contracts originated in the 1990s, from a group of crypto enthusiasts known as the Cypherpunks, who used to discuss crypto issues and share their ideas using their crypto mailing list. It was on that mailing list that Wei Dai, a computer engineer, published a post under the title “anonymous credit”.

He begins his text with an interesting question: “I used to think that the problem of anonymous credit is hopelessly intractable. I mean, who would loan money to an anonymous entity that may disappear at any time without a trace?” Dai then goes on to describe his newest idea – an anonymous loan scheme with redeemable bonds backed by a special lump-sum tax.

One of the values that crypto enthusiasts cherished the most was privacy and for that reason, they had always wanted to devise a transaction system that would allow for such private/anonymous transactions. Not only that but they also needed a system that would be fully protected and reliable.

Wei Dai’s idea was far from complete but it was a step forward in the right direction.

Nick Szabo and the Smart Contract

The basic idea of smart contracts is that many kinds of contractual clauses (such as liens, bonding, delineation of property rights, etc.) can be embedded in the hardware and software we deal with, in such a way as to make breach of contract expensive (if desired, sometimes prohibitively so) for the breacher. A canonical real-life example, which we might consider to be the primitive ancestor of smart contracts, is the humble vending machine. Within a limited amount of potential loss (the amount in the till should be less than the cost of breaching the mechanism), the machine takes in coins, and via a simple mechanism, which makes a beginner’s level problem in design with finite automata, dispense change and product fairly. Smart contracts go beyond the vending machine in proposing to embed contracts in all sorts of property that is valuable and controlled by digital means. – Nick Szabo, Smart Contracts: Building Blocks for Digital Markets

The anonymous credit idea was taken into consideration, revised, and further developed by some other Cypherpunks, most notably Nick Szabo who actually coined the term “smart contract” and wrote a paper on them in 1996. In the paper, he outlined the whole concept of smart contracts in great detail and tackled their greatest flaw – the lack of security.

According to Szabo, a smart contract is “a set of promises, specified in digital form, including protocols within which the parties perform on these promises.” To make them more reliable, he proposed securing them with cryptographic mechanisms.

Although his vision was revolutionary, its execution was impossible at the time since the underlying technology would not exist for an additional 12 years.

The Digital Ledger

Everything changed in 2008 when Satoshi Nakamoto published the Bitcoin white paper and launched the blockchain technology together with the first digital coin in January the following year.

Blockchain is a digital ledger for storing any kind of data on a peer-to-peer network operated by computers. Although it’s primarily used for making online cryptocurrency transactions, blockchain technology has found its way into numerous industries throughout the years. Smart contracts are just one of its many applications.

The blockchain network is run by miners who use their computational power to solve a complex hash algorithm in order to verify incoming transactions. Next, the majority of the miners have to accept the solution before the miner adds the transaction into the new block of data.

The transaction can’t be edited or removed once a miner stores it in a block chained to another one on the blockchain ledger. If someone tries to tamper with the network, he/she will have to generate more computational power than the whole network which is practically impossible.

Software engineers quickly realized they can use this new technology for the purpose of smart contracts, and before long, a couple of blockchain platforms emerged. The first incomplete implementation of a blockchain-based smart contract was Bitcoin Script which used a not-Turing-complete language for simple contracts. These included pay-to-public-key-hash (P2PKH) and pay-to-script-hash (P2SH).

Nowadays, Ethereum is the preferred platform for smart contracts. It was launched in 2015 and supports a Turing-complete language that allows users to make advanced customization and enjoy greater flexibility.

There’re also some newer blockchain platforms like Neo and Hyperledger Fabric for example, where the smart contracts are written in different high-level programming languages.

smart contracts 1

Evolution of smart contracts. Source: Blockchain-based Smart Contracts – Applications and Challenges, University of New South Wales, 2019

Smart Contracts Explained

But how do smart contracts work? What are the principles and the mechanism behind these protocols? Let’s try to explain this using a simple everyday example.

Imagine that Alice wants to buy Bob’s summer house. They decide to make an agreement with the help of a smart contract on the Ethereum platform. The contract is a computer code that, to put it plainly, contains the message that when Alice pays 1,000 ETH to Bob, she will have ownership of his summer house.

That is the condition-based principle or predetermined rule that has to be met before the contract is executed. If Alice doesn’t pay Bob, or if she pays less than 1,000 ETH, she won’t get the ownership. If Bob doesn’t provide the key once he gets the money, the smart contract will issue a refund to Alice.

Both parties (there can also be more than two) witness the transaction process on the platform in real-time, without being able to change their minds and alter the code. No need for tiresome paperwork, or hiring a real estate agent to do the negotiating for you, as you can easily code your contract to contain these conditions.

Moreover, you don’t need to spend money on escrow services whose job is to bridge the trust gap between the parties and make sure everyone gets their part of the deal. There will be no more hunting down the person and reminding him/her to pay what they owe. The smart contract is programmed to do that for you.

smart contracts 2

Number of smart contracts on popular blockchains. Source: Blockchain-based Smart Contracts – Applications and Challenges, University of New South Wales, 2019

Smart Contract Properties

Now that we know about their history, we’ll sum up the key properties that make smart contracts the need of the day.

  • Autonomy.

Smart contracts put you in charge of everything, instead of depending on the services of brokers, lawyers, and other intermediaries. The blockchain-based platform is the sole executor that eliminates the danger of third-party manipulation, bias, and human error.

  • Transparency.

When you create the contract you include the terms and conditions to which the involved parties should adhere. They can be reviewed and monitored at any time during the transaction process. This leaves no room for miscommunication and disputes at a later stage.

  • Trust and Safety.

Smart contracts are protected with high-level cryptographic encryption and can’t be manipulated, edited, altered, deleted, or lost. This and the fact that smart contracts are self-executing makes them trustworthy and safe for all sorts of business deals and legal agreements. If one of the parties doesn’t complete its obligations, the others are protected by the set conditions.

  • Speed.

The traditional way of signing a contract involves tones of paperwork and documents you need to deal with manually. By programming your contract inside the software the tasks get done automatically cutting back the hours exponentially.

  • Backup.

What if your trusted financial institution ends up losing your account or money? On the blockchain, you don’t have to worry about that. Your contract, the money you’ve sent or the money you’ll receive are recorded on each copy of the digital ledger guarded by miners around the world.

  • Savings.

Not only do smart contracts come with all the above-mentioned advantages, but they’re also cheaper than regular contracts. The decentralized blockchain ledger and applied cryptography make central authorities redundant and take away the commission expenses.

smart contract applications

The code of a smart contract on Ethereum. Source: Ethereum Transactions and Smart Contracts among Secure Identities, University Mediterranea of Reggio Calabria, Italy

Applications of Smart Contracts

Let’s talk about some of the main uses of smart contracts.

Health Care and Medical Records

Blockchain technology and smart contracts allow healthcare professionals a more secure way to store and access their patients’ personal medical records. Smart contracts can be protected with multi-signature approval where only those having the private key would gain access to the records.

Moreover, researchers can benefit from the documented health data, as long as patients agree to publicize their personal information. On the other hand, their identity doesn’t have to be disclosed thanks to the anonymity of the blockchain.

The blockchain can be also used for keeping surgery receipts and sending them directly to the insurance providers as proof-of-delivery, supervising drugs and managing medical supplies, storing test results, etc.

Insurance

Both customers and insurance companies will benefit from the implementation of smart contracts that will resolve the problem with processing claims as well as filtering the frequent fraudulent claims. This will result in lower administrative costs and save the companies valuable time that could be otherwise spent more efficiently.

A smart contract can trigger an automatic payment when a claim has met the terms accepted by both the insurance company and the customer in question. People will receive the money at the time when they actually need them the most.

Supply Chain

The supply chain refers to the distribution of goods and covers the whole cycle – from production to delivery. It involves many entities that manage the process and that’s why it needs careful regulation. Smart contracts can be used to track the process and record ownership rights from the initial to the final stage.

Each of the participants in the supply chain will be able to check the location of the goods and the time it will take before they reach the customer. This way we can easily track any lost goods, see who’s responsible, and eliminate miscommunication between the parties by going back to the smart contract to check the terms to which they had agreed.

Property Ownership

Smart contracts are really useful for recording property ownership in a transparent manner. Any property that is going to be recorded on the ledger will list the whole history of owners, its location, and titles. This will prevent frauds related to liens and easements, ensure less corruption, and reduce the costs significantly.

According to an article in The Wall Street Journal, “a blockchain-based multiple listing service (MLS) could enable data to be distributed across a peer-to-peer network, allowing brokers more control over their data and increased trust” with details on property location and address, comparable rental rates, capital values, ownership history, tenant details, age of the property and title clarity. All that for less money!

About The Author

James Page

James Headshot

James is the main editor. With a passion for finance and anything blockchain, cryptocurrency is right up his alley. He's responsible for most of the content on the site, trying his best to keep everything up to date and as informative as possible.

Disclaimer: Digital currencies and cryptocurrencies are volatile and can involve a lot of risk. Their prices and performance is very unpredictable and past performance is no guarantee of future performance. Consult a financial advisor or obtain your own advice independent of this site before relying and acting on the information provided.

Our most recommended Cryptocurrency Exchange

Binance LogoVisit The Site