Smart contracts are the fundamental building blocks of Ethereum applications. They are computer programs stored on the blockchain that allows us to convert traditional contracts into digital parallels. Smart contracts are very logical following an ‘if-this-then-that’ structure. This means they behave exactly as programmed and cannot be changed.

One of the most significant benefits smart contracts have over regular contracts is that the outcome is automatically executed when the contract conditions are realized. There is no need to wait for a human to execute the result. In other words: smart contracts remove the need for trust.

A simple metaphor for a smart contract is a vending machine, which works somewhat similarly to a smart contract - specific inputs guarantee predetermined outputs.

  1. You select a product
  2. The vending machine returns the amount required to purchase the product
  3. You insert the correct amount
  4. The vending machine verifies you have inserted the correct amount
  5. The vending machine dispenses the product of choice

The vending machine will only dispense your desired product after all requirements are met. If you don't select a product or insert enough money - the vending machine won't give out your product.

You can learn more about smart contracts on ethereum.org.