In the context of blockchain and cryptocurrency, the definition of a smart contract is:
- Stored and replicated on a distributed storage platform (such as a blockchain)
- Executed/run on a computer network (usually the same network running the blockchain)
- And may cause the ledger to update (pay with cryptocurrency, etc.)
- Pre-written logic (computer code)
A smart contract is a small program that "If that happens, execute that result", smart contracts are run and verified by a large number of computers to ensure credibility.
If the blockchain provides us with distributed trusted storage, then smart contracts provide us with distributed trusted computing