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.

A simple framework for a multisig transaction on the Bitcoin blockchain
A simple framework for a multisig transaction on the Bitcoin blockchain

The next iteration saw the creation of protocol smart contracts—blockchains with a few core programmatic instructions (called opcodes) built-in. Protocol smart contracts are blockchains that operate as a single application with the ability to execute a few opcodes. However, protocol smart contracts are difficult to scale because each change to the smart contract (protocol) requires a hard fork—a radical change that mandates the creation of a new blockchain and for each node to upgrade their software.

Ethereum revolutionized smart contracts in 2015 by launching scriptable smart contracts, turning the blockchain into a “world computer” that runs many different applications at the same time. Developers manage their own set of smart contracts and can change them at any time without the need for a hard fork. The scripting language abstracts low-level development complexity, enabling developers to build smart contracts in a matter of days and weeks as opposed to months and years.

The current evolution is scriptable smart contracts that connect with real-world data and systems existing outside the blockchain (off-chain). Connected smart contracts use secure middleware known as an oracle to trigger the smart contract’s execution using off-chain data. Oracles can also allow the smart contract to send data to other systems, such as settling the smart contract off-chain by sending payment instructions to a traditional fiat payment system.

More detail: https://blog.chain.link/what-is-a-smart-contract-and-why-it-is-a-superior-form-of-digital-agreement/