Bitcoin works by having miners validate transactions that are technically short scripts written in a very simple scripting language. If the script runs and doesn't return an error, it's a valid transaction and gets included in the blockchain. That's how you're able to have m-of-n transactions, timelocked transactions, microtransaction channels,