What Is Smart Contract
A brief overview of smart contracts in simple words
Last updated
Was this helpful?
A brief overview of smart contracts in simple words
Last updated
Was this helpful?
Smart contracts are specific types of programs that store information and funds (in the form of tokens) inside a blockchain.
A blockchain is a distributed database of records that keeps track of all its operations (transactions).
More on the blockchain in "".
Ethereum explains smart contracts as accounts that live on the blockchain, and cannot be deleted by default.
Because of their ability to respond to certain actions exactly as programmed, they are often compared to vending machines.
A vending machine is programmed to discharge a snack after a user selects it and pays for it. Snack selection and payment are the conditions that must be satisfied to get the results. Thus, the machine will not discharge anything until both conditions are met.
Like vending machines, smart contracts can often replace intermediaries and cut unnecessary costs.
Specific conditions in smart contracts are predefined and written into code. Such conditions may include the kind of operation as well as the time when it is performed.
For example, the amount and the date when the payment is due.
Since smart contracts are blockchain programs, they inherit blockchain qualities such as:
transaction transparency,
the anonymity of users,
no central authority,
secure encryption of data
Thus, compared to traditional paper-based contracts, smart contracts are faster, more secure, and fairer alternatives.
The contract terms are written into code and then deployed (published to the blockchain. Once published, each node of the network will have a copy of this code. This makes it impossible to change the rules defined by the contract without the nodes' approval.
A node is an independent computer that performs blockchain operations to get a reward. Besides storing data and smart contracts, nodes also process (approve) all blockchain transactions.
A gas fee is a blockchain fee that is paid to nodes approving a user transaction (miners/validators). Gas fees vary depending on the type of network and the level of difficulty of a blockchain transaction.
Contract actions may include transferring (sending into) and releasing money from the contract. This way, smart contracts act as decentralized escrow. The funds (money) are only released when specific conditions are met.
The tool that allows seeing the contract data is called a blockchain explorer. It is a specific search engine that finds and displays a specific piece of information from the blockchain records.
Because of this, smart contracts are often referred to as programmable agreements. These agreements can be used in peer-to-peer deals between a buyer and seller, for example. You can learn more about how smart contracts are used .
As such, all blockchain operations with contracts have timestamps and unique transaction IDs. The operations, also known as , are specific requests to nodes (contract calls) to execute a function defined in the contract code. As a blockchain operation, contract action has a gas fee.
Please refer to "" for more information.
As with regular blockchain accounts, a smart contract has its own address in the database, a.k.a a . This address is given to a specific contract when it is deployed (published) to the blockchain. It is often used to get information on all the transactions within a particular contract, its status, and/or value and gas fees.
Learn more under "r".
More on the blockchain
More on smart contract use cases
More on a blockchain explorer
More on tokens