Ethereum has flourished since its inception in 2014, having become the most well known and used cryptocurrency other than Bitcoin. With its promise of “Smart Contracts” powered by blockchain technology, it serves a more pragmatic role than Bitcoin in how it could potentially power entire ecosystems due to the limitless possibilities Smart Contracts offer.
But what are Smart Contracts? Smart Contracts are a concept that allows a transaction or contract to be fulfilled automatically without a centralized third party. The term was invented in 1996 by Nick Szabo, a famous and well known cryptographer and computer scientist, and one of the most influential people in the development of cryptocurrencies and blockchain technology.
The Vending Machine analogy
A smart contract behaves like how a vending machine works; by inserting a number of coins (the “input”), the vending machine dispenses a soda as well as a determined amount of change (the “output”), having processed the input and deducted the relevant sum to qualify the user for a soda and change. If the input is lower than the amount needed for a can of soda, the user is given back the full amount.
Smart Contracts and Decentralization
The beauty of smart contracts is that it is decentralized and can be applied to much more than just purchasing items – smart contracts can be engineered to behave in a limitless number of ways, interacting with users the way it is programmed to. An example use case is a decentralized company or organization (known as “Decentralized Autonomous Organizations” or “DAOs” in Ethereum) – many have touted the future of companies powered by Smart Contracts as being more consumer-friendly and even more efficient than traditional companies.
For instance, Uber basically creates contracts between drivers and passengers, but executes these contracts with the intent of earning profit for its shareholders and with a lot of human intervention; a Smart Contract based Uber would be able to match drivers and passengers with hard-coded margins or even none at all.
Smart Contracts on Ethereum
The way smart contracts are implemented on blockchain was first created by Vitalik Buterin, the founder of Ethereum, which was launched in July 2015. The Ethereum network allowed blockchain technology first made popular by Bitcoin to go a step further; instead of just facilitating transactions between users, fully functional Smart Contracts would be able to create programmatic rules that execute transactions using pre-defined terms. Let’s take a look at an interesting example of a Smart Contract, using Ethereum:
A landlord has decided to use smart contracts to automate his rental processes, as he has too many properties under him. Using Ethereum, he creates a smart contract that manages tokens each representing a “digital key” to different properties. Interested tenants simply connect their wallet to the smart contract (also called a Decentralized Application or “Dapp”), deposit their payment as well as tenancy deposit, and in exchange they receive the digital key to the house in the form of Ethereum-based, non-fungible (unique) tokens. They can access each house by showing proof of ownership of these tokens at the door.
When the tenants are done with their lease, they can simply return the tokens back to the smart contract, which then releases the tenancy deposit that they placed with the landlord.
Throughout this exchange, the smart contract’s automatic execution of the code was publicly visible and auditable by the tenants and interested buyers, acting as the electronic, automated equivalent of a legal contract, while requiring minimal to no input from the landlord.
The automation and limitless possibilities that Smart Contracts allow are potential game-changers for many industries, and all of it is powered by the same Blockchain technology enabling Bitcoin to exist.
How do I create a Smart Contract?
Transactions on the Ethereum network are powered by proof-of-work similarly to Bitcoin, with plans to move to proof-of-stake in the future. A transaction fee in the form of “gas”, paid in Ethereum, is required in order for a Smart Contract to work. The more complicated a Smart Contract is, the more gas is required for it to operate.
Hundreds of thousands of tokens, applications, games and other contracts already exist on Ethereum, and all of them are operating using the technology of Smart Contracts!
Advantages of Smart Contracts
- Trustless. Smart contracts don’t require an intermediary or authority to execute the contract for you.
- Publicly Auditable. The code in a Smart Contract is visible on the blockchain, making it possible to audit and check if the Contract will function as intended.
- Everlasting. As Smart Contracts are hosted on a blockchain, all associated transactions have a digital trail that lasts forever, adding strong elements of security and safety.
What are ERC20 Tokens?
The most common type of Ethereum-based cryptocurrency is called an ERC20 Token, which is a common defined standard for a basic token for the operation of a Smart Contract or Dapp. They allow for basic interactions within the Ethereum network such as transfer between addresses, usage in Smart Contracts and can be flexibly built to support a wide range of applications.
There are also non-fungible tokens which are tokens that are distinct from each other; these could be tokens that have a specific set of unique parameters attached to them which makes them “one-of-a-kind”, like snowflakes! The most common implementation standard is ERC-721, which defines the minimum interface a smart contract must implement to allow for the management, ownership or trading of unique tokens.