# Smart Contract

> A program kept on a blockchain. It runs its own rules, the same for all.

**Field:** Software Development  
**Category:** Blockchain & Web3  
**Also known as:** Blockchain Smart Contract, Contract Account

## Think of it like

It is like a snack machine. Put in coins, press a button, and the snack drops out.

## Definition

A smart contract is a program that lives on a blockchain at its own address. It holds code and data, and it runs when someone sends it a transaction. Its rules run just as written, and no one can stop them halfway. Once it is out, its code most often cannot be changed or deleted. It cannot see the outside world, so it gets things like prices from a helper called an oracle.

## Example

A smart contract holds the prize money for a chess game. When the game ends, it pays the winner with no referee.

## Why it matters

Strangers can make a deal and trust the code instead of each other. Tokens, NFTs and dApps are all built from contracts.

## Common mistake

Putting it live before a careful check. A bug in a live contract is public, and most can't be fixed.

## Three principles

- **Code is the rule.** It does exactly what it says.
- **Runs on request.** A transaction starts each run.
- **Hard to change.** Published code usually stays.

## Related terms

- [Ethereum](https://learn.benibix.com/term/development/ethereum)
- [Solidity](https://learn.benibix.com/term/development/solidity)
- [Decentralized App (dApp)](https://learn.benibix.com/term/development/dapp)
- [Gas Fee](https://learn.benibix.com/term/development/gas-fee)
- [ERC-20 Token Standard](https://learn.benibix.com/term/development/erc-20)
- [Blockchain](https://learn.benibix.com/term/development/blockchain)

## Told apart from

- [Smart Contract vs dApp](https://learn.benibix.com/compare/smart-contract-vs-dapp): People use smart contract and dApp as if they were the same thing, and they are not. A smart contract is one program on a blockchain. It holds the rules and the money. A dApp is the whole app a person uses: a web page, a wallet and one or more contracts behind them. The contracts cannot change, but the web page can be faked.

![A flow from left to right. A person presses a button on a web page, the front end of a dApp. Their wallet signs a transaction and pays a gas fee. The transaction reaches a smart contract, lit up, that sits on the blockchain with its own address, its code and its data. The contract runs and the new result is stored in the next block.](https://learn.benibix.com/diagrams/dev4-smart-contract.svg)

---

Source: https://learn.benibix.com/term/development/smart-contract
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
