Crypto 101 – What is a smart contract? Complete beginner’s guide

One of the ways the blockchain is revolutionizing the world is eliminating the need for intermediaries. While blockchains are far from perfect they are much faster, secure, and cheaper than current systems.

The traditional pen and paper contract will always carry some risks. Should the other party not fulfill the agreement you will likely end up in the courthouse seeking justice which we all know doesn’t come cheap.

The blockchain and smart contracts are amazing tools to make financial transactions faster and safer, but they can be applied in other areas as well.

What is a smart contract?

Nick Szabo

The concept of “smart contracts” is not new. It was invented by law and computer science scholar Nick Szabo in 1994. His goal was to remove the middlemen and he envisioned smart contracts to work like a vending machine.

In 1998, he proposed a decentralized digital currency called Bit Gold and while the project was never implemented many are considering it to be the direct precursor of Satoshi Nakamoto’s Bitcoin Protocol.

Smart contracts, also known as blockchain contracts or self-executing contracts are scripts coded into the blockchain that automatically execute when a set of predetermined conditions is met.

what is a smart contract

When trying to understand what is a smart contract, the similarity to a vending machine can be of help. A vending machine offers one of the simplest transactions. You insert money into the machine, select the product and the machine will automatically release it.

Smart contracts work in a similar manner, automatically enforcing themselves when certain conditions are met. With smart contracts, there is no more need to have third-parties involved such as lawyers or notaries.

Since smart contracts are enforced into blockchains they are also decentralized so there is no single entity controlling them. You can think of the code as the enforcer. There’s even the option to add a multi-signature which requires each involved party to sign before transferring the funds, or assets.

Once the contract is signed by both parties computers on the blockchain system will monitor it. In most cases, the smart contract is public and the code includes certain triggers. For example, when a company delivers the final product or service, the client should pay in cryptocurrency. When the first condition is triggered, the funds are automatically released.

Of course, smart contracts can be more complex so they can also include penalties in case one of the involved parties doesn’t fulfill the predetermined conditions. The most important thing to remember is that smart contracts will also automatically execute which is why there is no more need for a middleman.

What technologies power smart contracts?

Most smart contracts are built on the Ethereum network. Vitalik Buterin is the Russian-Canadian programmer that proposed Ethereum in 2013. Two years later, the blockchain-based network was released.

Each smart contract is executed using a Turing-complete Ethereum Virtual Machine. In other words, the program is capable of simulating a computer. It can make if/then-based decisions which is exactly what is needed to function and execute the multi-variable commands that make smart contracts.

Technically, you could create smart contracts on any blockchain but it is more difficult on networks such as Bitcoin that weren’t designed for such a thing. They use simpler mechanisms to perform transactions. Ethereum was specifically created to perform transactions requiring multiple steps.

What do smart contracts offer?

Smart contracts provide multiple benefits but here are the most important ones:

Autonomy – There is no more need for intermediaries, making the contracts cheaper and more efficient while also preventing third-party fraud. Since they are decentralized there is also no need to worry about any central authority controlling them.

Trust – Trusting the blockchain is certainly much easier than trusting a person. And that’s all you need to do when using a smart contract. Luckily, the blockchain is one of the most secure technologies in the world.

Security – This is closely related to trust. The blockchain is decentralized so it’s not possible to hack it like you would a website or a piece of software. To gain some kind of control one would need to take over 51% of the network which is practically impossible.

Speed – Because they cut the need for intermediaries, there will be no more waiting times for lawyers and notaries. The blockchain is monitoring the contract so the results are almost instant. It is a fully automated process and much faster than traditional systems.

It’s not difficult to imagine smart contracts have many potential applications including outside the financial sphere. They can be used in real estate, insurance, healthcare management and any other situation that involves trading goods for services.

Potential problems

Human error is always an issue, even if smart contracts are less prone to it compared to traditional contracts. In theory, a mistake in code or security-related human error (such as someone getting unauthorized access to your private keys) could lead to theft or hacking. In some cases, the code complexity itself can make a smart contract vulnerable to attacks.

There have already been some smart contract breaches such as the one that happened in July when the KICKICO ICO lost $8 million. However, the largest hack involved the Decentralized Autonomous Organization (DAO) in June 2016, when the hackers robbed the DAO of $50 million. This caused a hard fork of Ethereum Classic (ETC) and that’s how Ethereum (ETH) was born, in an attempt to secure the platform.

This might seem discouraging but even if they are not perfect, smart contracts and the blockchain still provide a much safer alternative to current traditional systems.

Privacy is another issue since most smart contracts are public which means they are not suitable to store sensitive data. However, there are already some notable projects such as Enigma and Wanchain working to solve this issue as they are focused on privacy and “secret contracts”.

Secret contracts are smart contracts that allow secure storage of sensitive data and are validated using blockchain technology. Wanchain relies on one-time address generations and ring signatures for their smart contract transactions which ensure identities remain anonymous.

It’s true, smart contracts are still a work in progress but as you can see, solutions do appear.

The future of smart contracts

As it seems coding solutions are easier to find than the ones governments need to come up with to regulate smart contracts and the blockchain industry.

Even so, there’s been a noticeable change of pace lately. In March 2018, the US State of Tennesee passed a bill that recognizes smart contracts as legally binding. At the start of this year, the Canadian government has launched a public blockchain trial for smart government contracts. The perks are increasingly obvious so the adoption rate will likely only grow from now.