The programmable nature of the blockchain allows people to put contracts in the form of code on the blockchain and execute them automatically under agreed conditions, which are called smart contracts.
The concept of smart contracts dates back to at least 1995, when Nick Szabo proposed the following definition: "A smart contract is a set of digitally defined promises, including an agreement on which the contracting parties can execute those promises." He also explores the potential uses of smart contracts in various areas involving contractual agreements, such as credit systems, payment processes, and copyright management.
We can simply think of a smart contract as a "program", except that it deals with the agreement of rights and obligations between people.
When certain conditions are meet, it performs a specific task. Thus, smart contract systems usually follow the "if ... then ..." statements. However, even though smart contracts have become mainstream technology, they are neither legal nor intelligent. They are a piece of code running on a distributed system (the blockchain).
In essence, blockchain smart contracts support the creation of trustless protocols. This means that the parties executing the contract can make commitments through the blockchain without having to know or trust each other. Once the contents of the contract are confirmed by both parties, the contract will not be executed if the trigger conditions are not met. In addition, the use of smart contracts can significantly reduce operational costs by eliminating the need for intermediaries.