A smart contract is code deployed on a blockchain that executes exactly as written when it receives a transaction that meets its conditions. It can hold and transfer digital assets, store data and call other contracts, with every state change recorded on the ledger.
Why it matters
Contracts let rules be enforced by the network instead of a trusted operator. They underpin decentralised exchanges, token issuance, escrow-like arrangements and automated payouts. Because the code is public and hard to change after deployment, bugs can be costly, and several large losses have come from flaws in contract logic. Developers therefore rely on audits, testing and sometimes upgrade patterns. A smart contract is not automatically a legal contract; its legal status depends on the jurisdiction and circumstances. It also cannot read real-world data directly, so it needs a data feed called an oracle.
Example
function release() {
require(msg.sender == buyer);
require(deliveryConfirmed == true);
seller.transfer(balance);
}
This simplified pseudocode, in the style of Solidity, pays the seller only when the buyer calls it after delivery is confirmed.
Common mistakes
- Assuming "code is law" removes the need for security review.
- Forgetting that a deployed contract cannot easily be patched.
- Relying on a single oracle that can be manipulated.
Rules vary by country; this entry is a definition only, not legal advice.
Related
Get notified when this term updates
Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.
This page is general information written by our editorial team and updated when documentation changes. Servers and providers differ, so test changes safely first. See our editorial policy and disclaimer.