By Daniel Phillips and Matt Hussey
6 min read
We’re all familiar with apps and app stores. You browse, download the app you want, and away you go.
Behind the lovely UX and UI interfaces of mobile devices, these apps are performing a specific set of instructions as laid out by their creator. It could be a game, a calendar, or a way to buy goods and services.
Smart contracts perform a very similar function.
A smart contract is a contract—expressed as a piece of code—that’s designed to carry out a set of instructions.
With smart contracts, however, there’s no middleman. There’s no person or company holding your information or verifying it. The blockchain verifies and holds information for you.
Vitalik Buterin, and the Ethereum community, believe that this is the future of the blockchain. If Bitcoin is the gold of the business world, smart contracts are the oil the business world runs on.
Let's imagine a conventional online transaction, without a smart contract. Let's say you want to buy a car online. In order to do so, you need:
Each of these components requires a level of trust between you and the site or service in question. In addition, each part of that process is typically controlled by a different company or individual.
It wouldn’t take much for a sneaky person or organization to meddle with any of the above elements, spoiling or voiding the whole process.
Why? Smart contracts are:
Usually, at the heart of a smart contract, you'll find a mechanism that says (in computer code) “if this happens, then do this.”
These already exist today. Let’s say you want to pay for something using a debit or credit card. The software your bank runs on will use the “if this happens, then do this” function in the following way:
The difference with smart contracts is, instead of a bank (or any third party) being the controller of that decision, the blockchain makes the determination.
Taking the above example and applying it to a smart contract built on a blockchain, you’d see the following:
The exciting thing about smart contracts is it means anyone can enter into an agreement with anyone else, with the blockchain keeping a record of the whole thing.
Like regular contracts, smart contracts are designed to enforce the terms of an agreement—whether this is an exchange of cryptocurrencies, tokenized rights, proof of identity, or practically anything else.
Smart contracts will automatically execute when pre-defined conditions are met. The operation of a smart contract can be briefly described with three main terms:
For most blockchains, the code underlying the smart contracts is immutable. Several blockchains also support updateable smart contracts, however.
Like the blockchain technology used to power most cryptocurrencies, smart contracts were derived from earlier technologies that weren’t quite complete. In the case of smart contracts, they are derived from earlier electronic instruction execution programs that used "if/else" statements and other conditional logic to automatically produce an outcome based on the information presented.
The term “smart contract” itself was coined in the 1990s in an academic paper created by Nick Szabo, a prominent computer scientist and cryptographer that was also responsible for developing one of the earliest precursors to Bitcoin, known as Bit Gold. Szabo initially described smart contracts for a variety of basic purposes like fraud reduction and enforcing contractual arrangements, but later expanded the potential use-cases of the technology to include digital cash, smart property, and more in a 1996 paper.
Ethereum implemented a Turing-complete language on its blockchain, allowing for complex and sophisticated logic in its smart contracts.
Dapps, or decentralized apps, can be best thought of as a bunch of smart contracts tied together.
A smart contract on its own can only be used for one type of transaction. A dapp, however, can bundle multiple smart contracts together to do more sophisticated things.
A dapp can also put a friendly interface on top of the contracts—just like apps do today.
Many leading dapps — decentralized apps — are built on Ethereum. In the next lesson, we learn what dapps are and why we keep hearing about them.
Decrypt-a-cookie
This website or its third-party tools use cookies. Cookie policy By clicking the accept button, you agree to the use of cookies.