Lesson 3: All About Smart Contracts
After completing this lesson, you will be able to:
Know what a smart contract is.
Know where smart contracts are stored.
Understand that smart contracts make blockchain technology useful for a wide variety of applications in addition to cryptocurrency.
Understand the relationship between blockchain-based decentralized applications and smart contracts.
Explain a simple smart contract.
Welcome to the third lesson in Kriptomat Academy’s Blockchain Fundamentals course. In this lesson, we’ll explore smart contracts and how they work.
A smart contract is a little computer program that is stored on the blockchain along with transaction data.
- Smart contracts allow blockchains to perform actions beyond just recording the transfer of tokens from one address to another.
- Smart contracts are computer programs that run on blockchain nodes and access data that is stored on the blockchain.
- They are executed by blockchain engines stored on computers known as nodes. Blockchain nodes are computers that store transaction history and verify new transactions.
Smart contracts can be simple or complex.
- A simple smart contract might monitor your address on the Ethereum blockchain and transfer 10% of all incoming funds to a separate address you use for long-term savings.
- The smart contract would be deployed on Ethereum nodes, and it would monitor your address around the clock.
- When the triggering event occurs – in this case, an incoming transfer of Ethereum – the smart contract will transfer 10% to the specified secondary address.
- All of this would happen automatically – without the need of an intermediary.
Blockchain-based decentralized applications known as “dApps” use smart contracts
- dApps have computer code for interfaces and error-checking and other functions, but they rely on smart contracts for interacting with the blockchain.
- That’s why dApps are deployed only on blockchains that support smart contracts.
- Ethereum is the most widely used platform for dApps because it was the first blockchain to support smart contracts.
Smart contracts are not especially smart and they are not contracts
- The basic function of a smart contract is to execute a blockchain transaction when a condition is met: IF coins are received, THEN transfer 10% to an alternative address.
- Smart contracts don’t have advanced computing features and they certainly don’t incorporate aspects of artificial intelligence.
- Nor are they contracts in the conventional sense of the word. A contract is a legal agreement. A smart contract is a very simple app – not legally binding, and not encoding an agreement between parties.
Around the world, companies are exploring uses for blockchain databases that don’t have anything to do with cryptocurrency.
- Those projects include specifications for blockchains that include the ability to run smart contracts.
- Hyperledger is an example. Created by a consortium led by IBM and the Linux Foundation, Hyperledger is a set of standards and tools for creating private blockchains that replace traditional databases within enterprise environments.
- Walmart, Hitachi, IBM, Amazon, Intel, and other companies have invested in Hyperledger blockchains.
So – what have we learned?
- Smart contracts are executable programs that are stored on the blockchain and access blockchain data.
- Decentralized applications – “dApps” – rely on smart contracts to access blockchain data.
- Smart contracts don’t run on all blockchains. Ethereum was the first blockchain to support smart contracts, and it is still the most widely used smart contracts platform.
That’s the end of this lesson! Test your understanding and earn points toward a Kriptomat Academy certificate of achievement by taking the test!
Kriptomat Academy content is informative in nature and should not be considered a personalised or any other investment recommendations or advice.