Think of a vending machine. You put money in, you pick a button, the snack drops. Nobody's standing behind the machine negotiating with you or deciding if you deserve the chips today. The machine just runs its rules. That's basically what a smart contract is, except instead of snacks it moves money, tokens, or permissions, and instead of a machine sitting in a hallway it runs on a blockchain where thousands of computers agree on what happened.
Computer scientist Nick Szabo coined "smart contract" back in 1994, way before Bitcoin existed, and he used the vending machine comparison himself. Bitcoin's own scripting language can handle simple stuff, send this amount to that address, but it was built to stay narrow on purpose. Vitalik Buterin wanted more than that. He proposed Ethereum in 2013 and it launched in 2015, specifically to run arbitrary code on a blockchain rather than just move coins around.
A developer writes the logic, usually in a language like Solidity if it's on Ethereum. Say the rule is "release payment to the seller once the buyer confirms delivery." That gets compiled into bytecode and deployed onto the chain, where it just sits there watching for its trigger. Once the condition fires, the code runs exactly as written and the result gets locked into a block. No customer service line steps in to fix it afterward, whatever the code says is what happens.
"Self-executing" doesn't mean self-correcting. If there's a bug in the code, the contract still runs the bug faithfully, forever, or until someone deploys a fix in a new version. Interacting with DeFi protocols usually means granting "token approvals," basically permission for a contract to spend your tokens on your behalf, and thats one of the most common ways people actually lose funds, approving something they didn't fully read. Always double check what you're signing before you confirm it. For the underlying signature mechanics that make any of this provable at all, see public key versus private key.
The private key for every Bitcoin wallet on Earth is on this website, even Satoshi's. But even if you try for a million years, you'll never find a funded one.
Try the key collider nowSmart contracts are the actual engine behind DeFi, most NFT platforms, and a growing chunk of AI agent payments too, since an agent can pay a smart contract directly with no human signing off in the moment. See what DeFi actually is for the bigger picture of what gets built on top of contracts like these, and why AI agents are choosing blockchain for settlement for where this is headed next.