What is a smart contract? Smart contracts by definition are are digital contracts that allow us to generate binding and provable terms through blockchain technology. They can be used for exchanging money, shares, property or other valuable goods, or even just used as an agreement to do something. It allows for two parties in two locations to agree to a binding contract without the need for a middleman, such as a lawyer or notary. These agreements may also be anonymous if desired.
Smart contracts are self-executed; the terms of agreement are written into the lines of code. That code (and the agreements) exist within the given blockchain network. This is what’s known as blockchain programming. Ethereum currently has the most prolific smart contract ecosystem. To implement a smart contract using the Ethereum blockchain, you pay for this service with Gas (a token which is currently a small percentage of the value of Ethereum). You can find out more about using this blockchain in our article, Ethereum for Smart Contracts. Other blockchains also support smart contracts - check out our blog post on Bitcoin's smart contracts.
Cryptocurrency transactions are smart contracts: whereby one party agrees to send cryptocurrency to another person. So if you’re asking which came first - the cryptocurrency or the smart contract? - the answer is the smart contract. It’s how Bitcoin transactions are binding.