What are smart contracts?
- Ethereum
- Article
- mins
If you have been following cryptocurrencies and blockchain technologies closely, the term "smart contracts" is one you must have come across more times than one. Smart contracts are one of the most useful tools associated with blockchain. They can enable the transfer of everything from bitcoin and fiat currency to goods transported around the world.
Let's take a closer look.
When were smart contracts invented?
In 1994, a cryptographer named Nick Szabo thought about the idea of being able to record contracts in the form of computer code. These contracts would be automatically activated when you meet certain conditions in the contract. This idea could potentially remove the need for trusted third-party companies such as banks or lawyers. You get a network controlled by computers.
So, why didn't anyone use the smart contracts since then? Well, the answer is simple - blockchain technology didn't exist then!
What is a smart contract?
Simply put, smart contracts allow the performance of credible transactions without third parties. We will be highlighting three points that will help you recall easily what smart contracts are. After this guide, you'll never have to google "what is a smart contract" ever again!
A smart contract is an agreement between two people in the form of computer codes.
The transactions that happen in a smart contract are processed by a blockchain. This means they can be automated, eliminating the need for a third party.
The transactions are only carried out when the conditions in the agreement are met. There is no third party, so there are no issues with trust.
How Does a Smart Contract Work?
To help you understand how smart contracts work, let us start by looking at how they can be used:
So, let us imagine a situation where you want to buy 1BTC from Patricia.
This agreement is formed on the blockchain using a smart contract. This smart contract contains an agreement between you and Patricia. For the sake of this illustration, we will assume 1BTC= $500, and we will also assume your name is Ashley.
In simple words, the agreement will read something like this: “WHEN Ashley pays Patricia $500, THEN Ashley will receive ownership of 1 BTC”.
Without a smart contract in this scenario, You would have to pay lots of transfer fees, transfer charge VAT, SMS charge for the debit alert, etc.
Key features
It is worth noting that there are several blockchains out there, and each blockchain implements smart contracts differently. The most popular is the Ethereum blockchain, which is the one to be considered for this guide.
An Ethereum smart contract often presents the following characteristics:
Distributed. Smart contracts are replicated and distributed in all nodes of the Ethereum network. This is one of the major differences from other solutions that are based on centralized servers.
Deterministic: Smart contracts only perform the actions they were designed to, given the requirements are met. Also, the outcome will always be the same, no matter who executes them.
Autonomous: Smart contracts can automate all sorts of tasks, working like a self-executing program. In most cases, though, if a smart contract isn't triggered, it will stay "dormant" and won't perform any action.
Immutable. After being deployed, these contracts cannot be changed. They can only be "deleted" if a particular function was previously implemented. Thus, we may say that smart contracts can provide a tamper-proof code.
Customizable. Before deployment, smart contracts can be coded in many different ways. So, they can be used to create many types of decentralized applications (DApps). This is related to the fact that Ethereum is a Turing complete blockchain.
Trustless. Two or more parties can interact via smart contracts without knowing or trusting each other. In addition, blockchain technology ensures that data is accurate.
Transparent. Since smart contracts are based on a public blockchain, their source code is not only immutable but also visible to anyone.
Was this article helpful?
Give us your feedback