Smart Contracts

Thanks to blockchain technology it is possible to design smart contracts that are executed automatically. Next, we explain how they work and why they are considered a revolution.

Smart contracts are computer programs designed to be executed automatically as the people or companies involved in an agreement comply with its clauses. They are based on blockchain technology and promise to transform the traditional way of doing business in the not too distant future, eliminating the need to interpret whether a clause has been executed or not, thus making smart contracts deterministic and executed autonomously.

To understand the concept of smart contract it is necessary that we first know what blockchain is. When we talk about blockchain we are referring to a shared registry, that is, a large database that is replicated in several places, called nodes, so it is impossible for it to be maliciously modified. Thanks to this technology we can store and share data and information of any kind in a secure way, even between parties that do not trust each other.

Each inserted block of information is transmitted and stored in each of the blockchain replicas, creating what is called a distributed ledger. These blocks of information are linked to each other as they are validated by different users, through cryptographic seals that are generated both with the information of the last block and the cryptographic seal of the immediately previous block (hence the name of blockchain or block chain). In this way, the security and authenticity of the transactions are guaranteed because once validated they cannot be altered or deleted without the rest of the users knowing and without altering the cryptographic seals of all the blocks.

In short, what blockchain provides is a new way of transmitting value without intermediaries, because it is a decentralized and shared database that also uses cryptography to guarantee the immutability of the registered information.

How does a smart contract work?

As the security of transactions is guaranteed through blockchain technology, smart contracts can operate automatically, this means that verification by a supervisory entity is not necessary. It will suffice to indicate in a computer program what is the result that has to be executed after a certain event occurs, that is: if X occurs, then Y.

It is essential that each of the parties involved in the contract knows and accepts in advance the rules and the steps that are going to be executed, because once the execution of the smart contract has started, the programmed rules cannot be altered. Each step or clause formed is registered in the blockchain and cannot be modified.

How to use a smart contract?

So far, we have talked about smart contracts as a technology that works within the blockchain universe, but can also work in traditional economic ecosystems, external to the blockchain network. The external interaction can be provided by the different participants in the smart contract, including a figure called the oracle. These are external sources of information agreed by the participants that update the necessary information in the blockchain to be able to verify compliance with the agreements and thus execute the corresponding steps.

Commercial transactions are an example of how a smart contract can help transform the traditional economy. Let’s imagine that on one hand we have a company that sells frozen foods and on the other, a supermarket chain that buys them. They are in different countries and it is the first time that they are going to do business together, so they turn to a smart contract that facilitates the transaction and guarantees that each of the parties complies with the agreement.

In this case, the oracle could be the transport company, which, when the merchandise is delivered, registers it in the blockchain, through a smart contract. Thus, once you arrive at your destination, the payment order will be automatically issued. Even if the temperature of the container was monitored with an IoT device (Internet of Things or Internet Of Things, in English), it could register if the cold chain has been broken and the smart contract would execute the corresponding penalty clause, previously programmed. in the same.