Chapter 1

Introduction to Smart Contracts

Smart contracts are programs that live on a blockchain and execute when someone calls them. They let strangers rely on shared rules without trusting a company to process each action by hand.

Unlike a normal backend, the contract logic is public and deterministic. Every node replays the same input and should reach the same output, which is why users can verify the rules instead of just trusting the app's operator.

Contracts are powerful because they can hold assets and enforce conditions at the same time. They are also unforgiving: if the code is wrong, the bug becomes part of a live financial system that anyone can interact with.