What is a smart contract, and what is it for?

A program that runs on a blockchain, whose rules everyone can see and nobody can change halfway through.

2 min read Last reviewed 2026/11/29

A simple definition

A smart contract is a program stored and run on a blockchain. Think of a vending machine: you put money in, press a button and the machine hands out the item according to a rule built into it. No seller is needed and nobody can change the rule halfway through.

It is called a "contract" because it turns the rules of an agreement into code, and "smart" because it runs by itself. It has nothing to do with artificial intelligence, and legally it is not automatically a binding contract.

What makes it different from an ordinary program?

  • The code is public: anyone can read and check the code running on the chain.
  • It cannot be changed: once deployed, the code stays the same. If it is meant to be upgradable, that has to be designed into the code from the start, visibly to everyone.
  • The result is the same for everyone: every node runs the same code with the same input and must reach the same result; that is why it can be trusted.
  • It can hold money itself: a contract can have a balance and pay out only under its own rules.

Common uses

UseWhat the contract does
TokensKeeps balances and handles transfers
Document timestampingStores a file's fingerprint with the time it was recorded, to prove later that the document existed then
CertificatesAn issuer records a certificate and anyone can verify it
Voting and DAOsRecords proposals and votes and carries out the result automatically
EscrowHolds money until a condition is met, then releases it

Know the limits too

  • Bugs are expensive: because the code cannot change after deployment, one mistake can put users' money at risk. Important contracts should get a security audit before deployment.
  • A contract knows nothing of the outside world: it cannot know an exchange rate or the result of an event by itself; a data source (an oracle) has to bring it on chain.
  • Every run costs a fee: each operation has a small cost called gas, explained in the next guide.

On SUR

Anyone can deploy a smart contract on SUR without permission. The network itself is run by smart contracts too: the validator registry, reward distribution, the Validators Assembly's votes and the Foundation's governance are all contracts that exist from the first block at fixed addresses, and none of them has an admin. They are listed on the smart contracts page.

Some shared infrastructure is designed or planned for SUR so that dapps do not have to build everything from scratch, including a shared network identity, document timestamping, a naming service and certificates. The status of each is on the SUR infrastructure and tools page.

Last reviewed: 2026/11/29

All guides