top of page

What is a Smart Contract? Learn how it works in 7 steps.

Smart contract? Blockchain? Is there only Ethereum? Oracles? Let's get some clarity.

Smart Contracts are computer protocols that facilitate, verify or enforce the negotiation and/or execution of a contract.

Typically, they form the basis for the transfer of digital resources. Smart contracts find their reason for existence primarily when considered within blockchain technology.

In fact, smart contracts have existed since the 1990s but have only achieved application value in the last decade thanks precisely to their use in the blockchain.

This combination gives the "modern" smart contract three main forces: automation, transparency and security.

Practical example of Smart Contract:

Here we will explain the concept through the example of air travel insurance:

The smart contract queries APIs (application programming interfaces) for information about departure times and, in the event of a flight delay guaranteed by the policy, automatically triggers reimbursement, without the need for any "human"(security) intervention.

Both the ticket purchase agreement and its refund are viewable by anyone on the blockchain network (transparency).

The "terms" of the exchange agreement between the two parties are always stored on the blockchain and thus have both the characteristic of traceability and non-changeability.

Advantages and Disadvantages of Smart Contracts

The advantage of using a smart contract over a traditional contract is the fact that the specifications of the contract are stored on blockchain thus making the intervention of an intermediary or validating third party unnecessary.

Smart contracts thus have undoubted and significant advantages over traditional contracts from both practical and legal perspectives; huge financial savings on legal fees and a higher level of security and time gain.

The most widely used blockchain for creating smart contracts is the Ethereum network, but over the past few years many others have emerged. Sometimes more convenient and cutting-edge.

Ethereum contracts are managed peer to peer. Users pay no intermediary for it to validate the transaction but rather "pay" for the use of its computational power through their own cryptocurrency "ether."

How does a smart contract work?

Technically we can summarize its operation in 7 steps:

  • 1) The agreement: two parties agree on the details of the contract and enter into it.

  • 2) The verification: the smart contract is entered into the blockchain and made enforceable by the set of participants (nodes + miners).

  • 3) The block: the smart contract becomes part of a block (identifiable by its "hash code") validated by the blockchain participants themselves.

  • 4) The mining: The validation mechanism can be "proof-of-work" or "proof-of-stake." In the prof of work, by solving a mathematical puzzle connected to a blockchain code, validators receive remuneration in the blockchain's reference cryptocurrency.

  • 5) The chain: The block at this point is added to the chain. The transaction is public and visible from the blockchain platform.

  • 6) The oracle: In order for the blockchain to access data external to the network, a third-party agent (in jargon called an oracle) intervenes.The oracle is in charge of monitoring events external to the blockchain; in the case of airline insurance, it checks departure times to see whether or not a delay has occurred or other variables significant to the specific smart contract.

  • 7) Execution: once input is received from the oracle, it automatically triggers the if/then clause written in the informed language characterizing the smart contract.

Join our private Discord server so you don't miss updates on the crypto landscape.


Iscriviti alla Newsletter


Grazie per l'iscrizione!

Latest Articles

bottom of page