Knowledge HubIntermediate

What is a smart contract?

A smart contract is a small program stored on a blockchain that runs exactly as written whenever someone sends it a transaction. Nobody can quietly change it or stop it once it is live, and anyone can check what it will do.

Think of a vending machine. You put in the right amount, press a button and the machine hands over a drink, with no shopkeeper involved. A smart contract works the same way for digital assets: if the conditions are met, it moves the tokens, records the result and moves on.

Ethereum made smart contracts popular, and most stablecoins, tokenized assets and decentralized finance (DeFi) apps are built from them. A token itself is usually a smart contract that keeps a list of who holds how much.

The strength is also the risk. Because the code runs exactly as written, a mistake in it runs too, and there is often no one who can reverse a payment. Many of the largest crypto losses came from bugs in smart contracts rather than from blockchains being broken. Before using an app, look for an independent security audit and how long it has run without problems.