Skip to content
Supply chain

Blockchain: Smart Contracts – Part I

What is a Smart Contract?

It is an agreement between two or more parties that allows the transfer of natural language contracts or contractual clauses into computer code, capable of self-execution without intermediaries.

Smart contracts are developed using scripts, which are documents containing instructions written in programming code. It is important to separate two areas of a smart contract: the technological and the legal.

Parts of a Smart Contract

The parts that every smart contract must include to be considered as such and to be valid are the following:

Subject of the contract

The Smart Contract must have access to goods or services under contract to automatically lock and unlock them.

Terms and conditions

The terms of a smart contract take the form of an exact sequence of operations.

Digital signatures

The agreement is initiated when all participants sign the contract with their private keys.

Decentralized platform

The smart contract is implemented on the Blockchain and distributed among its nodes.

Technological Scope

What technology is behind Smart Contracts?

Smart contract information is stored on thousands of computers or servers acting as nodes in the Blockchain network, where the information is duplicated with the assurance that no one can alter it. Each time a block is confirmed and added to the chain, it is communicated to all nodes, and it is added to the copy each one stores.

The blockchain is a P2P network where all nodes are equal, resulting in a distributed system resistant to cyberattacks, failures, or falsifications. The following image illustrates the optimal network type for Blockchain technology, from a theoretical perspective.

Smart contracts can be applied in private, public, and hybrid Blockchains. A public Blockchain allows access to any user in the world. All that is needed is a computer and an Internet connection. For example, the public Bitcoin Blockchain consists of the Bitcoin protocol, the bitcoin unit of account or token, and the Blockchain, the database where transactions are recorded.

A private Blockchain, unlike a public Blockchain, is not open to the public; instead, it can only be accessed by invitation. Some of the most famous ones include Hyperledger, R3, or Ripple.

Hybrid Blockchains are a combination of public and private ones. In a hybrid Blockchain, participating nodes are chosen or restricted by an individual or group of people, but all transactions are public. This means that nodes participate in the maintenance and security of this Blockchain, but all transactions are visible to users worldwide, and they do not need to know the content of the Blockchain, unlike private Blockchains where transactions are also private.

How are Smart Contracts generated?

The first step is to program the code that forms the smart contract. Using a programming language allows for precisely coding what the contract parties want it to do. The more complex the conditions, the less capable the contract is of executing them, at least until this technology matures. Smart contracts are executed based on met or unmet conditions that determine the outcome.

The second step is to publish the contract on the Blockchain, whether it is a public or private Blockchain. The fact that the contract is published does not mean it can be read by external agents; this is because contracts are encrypted.

Once the contract is published, it is stored on the Blockchain and can be executed. Since it is on the Blockchain, the contract can be executed by the nodes, and a consensus on the outcome is necessary. As defined in the contract, it may be necessary to update the chain.

It is common for contracts to require external information, as not all the necessary information for fulfilling clauses is integrated into the contracts themselves. Oracles provide the data needed to trigger smart contracts to execute when the original contract terms are met. These conditions could be anything related to the smart contract: temperature, payment completion, price changes, etc.

These oracles are the only way smart contracts interact with data outside the Blockchain environment. Oracles provide external information that the smart contract cannot access and act on its behalf to execute external actions beyond its scope. It is not always more efficient to use external oracles, as they can be incorporated into the smart contract itself.

Part of a Smart Contract for a car lease in exchange for ethers. (github.com/magonicolas/Ethereum-Solidity)

Legal Scope

The term Smart Contracts can refer to anything from contracts or contractual clauses in natural language transferred to computer code, to more complex cases represented and executed directly by scripts.

For a smart contract to be considered a legally binding and enforceable agreement in court, it must meet the essential legal requirements of any contract: the consent of the parties, a lawful object, and a cause (valid reason, including consideration).

Legal limits on freedom of contract must also be included in the Smart Contract for it to be considered valid and legally enforceable. In some cases, it will be necessary to resort to mixed solutions that combine code with natural language.

Benefits of Smart Contracts

When discussing the benefits of using smart contracts versus traditional contracts, both the benefits of smart contracts themselves and the benefits of the underlying technology are considered.

In addition to their ability to self-execute, thereby reducing time and resource costs, smart contracts have the advantage of being integrated into the Blockchain. This ensures that all information is recorded, immutable, secure, and accessible.

In conclusion, the following benefits can be derived from Smart Contracts and Blockchain:

  • Transparency
  • Traceability
  • Integrity
  • Authorship
  • Security
  • Resource Optimization
  • Eliminates Bureaucracy
  • Eliminates Authoritarian Figures

Smart Contracts in Industry 4.0

Industry 4.0 envisions a new paradigm in production systems, shifting from mass production to personalization. For this, digitalization stands as the cornerstone of this industrial revolution, relying on technologies such as the Industrial Internet of Things (IIoT), 3D printing, machine-to-machine (M2M) communications, smart sensors, etc.

As mentioned in previous posts, data gains significant importance. It will cease to be a mere result of the manufacturing process and will become the basis of the product or service.

A distributed system like that provided by Blockchain will allow for identification, authentication, and communication between devices. Therefore, it will be possible to record the activity of each sensor/actuator in the industrial network and thus guarantee the integrity of the data generated by the IIoT, without fear of record manipulation and its consequences.

Smart factories will be composed of IIoT devices and/or manufacturing modules connected to each other, operating in a self-managed or self-sufficient manner. In this way, and through the use of technologies like Blockchain, a new economy will emerge where the devices themselves, through M2M communications, will be capable of reaching agreements for the supply of raw materials, parts, maintenance, energy, and the delegation and coordination of production, and even logistics, which will be reflected in Smart Contracts and whose payment will be automatically executed when the conditions established in the contract are met.

Sources: Alex Preukschat (2017), Blockchain: The Industrial Revolution of the Internet

Leave a Reply

Your email address will not be published. Required fields are marked *