A program that runs on the Blockchain (specifically Ethereum) that can hold cryptocurrency, and release automatically only once certain conditions are met.
Think of as “if X happens, then release funds into Y”.
You can think of it as a public vending machine. Anyone who wants can see it, read instructions, put money in (send a transaction) and press a button (call a function).
Types:
On-Chain Verification:
All of the information needed to verify can exist on the chain.
E.g.: “If Alice sends 5 ETH, give her an NFT”
Off-Chain Conditions with Oracles:
Retrieves verification from the outside world using an Oracle
Some Oracles periodically push information to the chain, others can be “polled” for a fee
While Oracles can act as a gateway to the outside world, they suddenly become a centralised node within a decentralised network. This makes them suddenly insecure.