A smart contract is a contract with aditional blockchain features. It is a computer program or a transaction protocol to automatically execute, control or document legally relevant actions/events according to some contract terms.
- the need of trusted intermediates
- accidental exceptions
- malicious attacks
- fraud losses
- arbitrations and enforcement costs
- cost reduction (no intermediates)
- speed (no intermediates)
A smart contract is like a vending machine, you just insert the coin and select what you want, reducing the need for an intermediate to get your snack.
A smart contract is a "virtual and online" vending machine
Some legal academics say that smart contracts are not legal agreements.
A smart contract is not necessarily legally enforceable as a contract. But a smart legal contract has all the elements of a legally blinding contract in the jurisdiction where applicable.
A smart legal contract can be enforced by a court of law.
A smart contract can be any kind of computer program. It can be viewed as a collection of code and data deployed using cryptographically signed transactions on the blockchain.
For database experts, a smart contract can be viewed as a secure stored procedure.
Smart contracts cannot be modified after a transactions (after being stored in the blockchain).
A smart contract occurs by sending a transaction from a wallet. Transactions include the compiled code for the smart contract and a receiver address
Smart contracts can store arbitrary states and execute arbitrary computations.
Once deployed it cannot be updated.
- Transactions must be included in a blockchain block.
- End-clients interact with a smart contract through transactions.
- Transactions can invoke other smart contracts.
- Transactions might result in changing the state and sending coins from one account to another.
- Rust (yes, Rust!!!)
Other programming languages:
- Bitcoin Script
A blockchain-based smart contract is visible to all blockchain users. This can lead to a situation where bugs (including security holes), are visible to all, but yet, not easily fixable.
- No central resource for documenting known vulnerabilities
- Blockchain network attacks
- Bugs immutability (once deployed, smart contracts can't be modified)
- Compiler bugs
- EVM (Ethereum Virtual Machine) bugs