Some chains run contracts: code stored in an account executes against shared account state when a transaction calls it. Others attach a script or predicate to each unspent output: a spend supplies a solution or witness that the script checks, and a predicate can return conditions that constrain which outputs are consumed or created. Both support programmable transactions, but programmers must understand each model's creation, consumption and cross-transaction constraints rather than assuming the other model.
Key idea. The application goal may be similar while the state transitions and validation rules differ.
Example
A signed trade that settles both assets in one transaction constrains the exchange on-chain. Whether an off-chain service was satisfactory still requires evidence beyond the on-chain exchange.
Keep in mind
- An atomic asset exchange does not prove delivery of an external promise.
- Language or execution-model differences do not make all applications automatically secure.
- This service explains models and reads public information; it never executes spends.
- Layer 1 and layer 2 describe different execution and security scopes. A rollup executes transactions outside its L1 and anchors its data or proofs to that L1; its throughput or fees must not be reported as L1 measurements. State the network, layer and security assumptions when comparing.
Sources
- Chia CLVM versus EVM (external site)
- Ethereum accounts (external site)
- Ethereum scaling: offchain scaling and rollups (external site)
- Bitcoin Developer Guide: Transactions (external site)