The most basic type of smart contract is a multi-signature smart contract. A multisig transaction states that a defined number of people (public keys) must sign a transaction with their private keys before it’s considered valid. Bitcoin was the first blockchain to introduce multisig transactions in 2012.
Like the blockchain technology used to power most cryptocurrencies, smart contracts were derived from earlier technologies that weren’t quite complete. In the case of smart contracts, they are derived from earlier electronic instruction execution programs that used if/else statements other conditional logic to automatically produce an outcome based on the information it is presented with.
A smart contract is a type of blockchain record that contains externally written code, and controls blockchain-based digital assets. When triggered by a specified blockchain write event, a smart contract immutably executes its code and may result in another blockchain event.
Smart contracts are neither smart nor contracts, and can only read from, and write to, the blockchain. All off-chain interactions with smart contracts must be handled by agents that map between off-chain assets and on-chain digital assets.
A collection of code and data (sometimes referred to as functions and state) that is deployed using cryptographically signed transactions on the blockchain network. The smart contract is executed by nodes within the blockchain network; all nodes must derive the same results for the execution, and the results of execution are recorded on the blockchain. Source(s): NISTIR 8202
The easiest way to explain what a smart contract does is through an example. If you’ve ever bought a car at a dealership, you know there are several steps and it can be a frustrating process. If can’t pay for the car outright, you’ll have to obtain financing. This will require a credit check and you’ll have to fill out several forms with your personal information to verify your identity. Along the way, you’ll have to interact with several different people, including the salesperson, finance broker and lender. To compensate their work, various commissions and fees are added to the base price of the car.