May 23, 2018
In the management of a relationship or as part of an agreement, business and all parties involved often put a contract in place. The contract defines the terms and conditions that apply in the partnership or relationship like purchaser/merchant, tenant/owner, subscriber/service provider. As technology evolves, many enterprises already offer their customers better, faster and more secure services with the help of the smart contracts powered applications and today we discover how they do it. In this article, we will explain blockchain smart contracts and study use cases in various industries.
List of The Contents
- What are smart contracts
- Understanding blockchain
- From blockchain to smart contracts
- Smart contract use cases
- Smart contract examples
- In conclusion
A traditional contract, the one that is still broadly used to date, is a written document that frameworks cooperation, it includes the terms and conditions of a partnership or service agreement. The contract is written in human language and may be subject to interpretation. Since the written contract is not void of ambiguity, both parties can have different interpretations. It requires a third party to enforce the law and to decide during a dispute for instance, but it is common that a third party is often involved even though there is no dispute.
The execution of a traditional contract requires a human validation, to check the terms and conditions and decide for the next steps according to the written agreement. Therefore traditional contracts can be:
- Time-consuming: checking the contract, validation, and approval, enabling the next steps, etc.
- Resource consuming: execution may require human intervention.
- Costly: it may involve a third party, this is even true during a dispute
The more complex the contract is, involving, for example, several execution steps that enable specific actions or that give rise to certain privileges, the more it requires control and the more there is a risk of disputes.
There is another way to deal with a contract in a way that it overcomes the challenges and limitations as mentioned earlier. As technology evolves, the way we deal with the contract evolves, and the smart contracts are born. However, what is precisely it?
WHAT ARE SMART CONTRACTS
Smart contracts are translations of an agreement including terms and conditions into a computational code (script). Blockchain developers write the script in a programming language like Java, C++, etc. in a way that it is void of ambiguity and does not lead to interpretation. The code translates a set of rules that are automatically executed and validated. A straightforward example is a translation of: “if X provides the service, Y pays for it.”
Smart contract codes are uploaded into the blockchain to check the validity of a contract and enable the required steps. From its initialization, smart contracts in blockchain are automatically executed. The main difference between smart and traditional contracts is that a smart contract doesn’t rely on a third party; cryptographic code enforces it.
We can consider that the vending machine is implementing it mechanically. Consequently, it verifies the following properties:
- There is no third party involved in the transaction
- When you put your coin in the machine and select your product, it delivers the product directly to you as long as you meet the terms and conditions which are: your coin has the same or higher value than the product you want to purchase.
Now that we have more understanding let’s see how does it work?
UNDERSTANDING BLOCKCHAIN
Before we check the examples of smart contracts, it is important to understand how they work; let’s first talk about blockchain.
The blockchain is a concept similar to a book in which we record information. Generally, this information is about a transaction, but this is not always the case and is not the only case. We can see a blockchain as a ledger where we record contracts and transactions. Concepts and ideas that give birth to blockchain are not new. The idea first appears in a paper published by Haber and Stornetta in 1991; you can find more about time-stamping a digital document here.
The goals of the paper are to bring certification and secure digital documents using timestamps. Timestamping is done in a way that it is impossible to change the date in a given document. Therefore, it is easier to define which documents come first. One document that appears with a timestamp older than another document is considered to be created first. This approach exploits the immutability nature of timestamps.
This first proposition has evolved, and technology such as blockchain appears and has permitted refinement of the first proposition. In the blockchain technology approach, the documents are linked together in a block to form a chain. The blockchain is a linked data structure using hash pointers. Consequently, blockchain characteristics and technologies inherit hash function and hash pointers characteristics. These characteristics are:
- Any given input has a single output: the hash.
- The output is standardized: the fixed size that is generally quite large to ensure it resists from a collision.
- Easy to compute: we can determine the time needed to calculate the hash value of input according to the input size.
These characteristics are essential since they ensure that:
- Any transaction can be encrypted.
- For any given transaction, the output has the same size.
- For any given transaction, we can determine the computational time of its hash.
When dealing with a transaction, security is a must. The hash function used by blockchain technology ensures this security, it is chosen according to the following criteria:
- It resists from a collision; a collision happens when two different input results in the same output. There is a collision resistance when serious attempts to find collision remain unsuccessful.
- Knowing the output, it is not feasible to predict the input. So even if the hash value of a given transaction is known, the transaction itself remains unknown.
Since blockchain is linked data structure containing data and hash pointer that points to a previous data. Typically, transactions are linked to each other. Every transaction that has ever happened is recorded in the blockchain and is published. The properties we have previously seen ensure the security of these transactions inside the blockchain.
Now that we understand that transactions are recorded to form a blockchain, the next question is what is the relation between blockchain and smart contracts.
FROM BLOCKCHAIN TO SMART CONTRACTS
Smart contracts are defined and executed inside a distributed blockchain. Every transaction and contract execution has to happen inside the blockchain. There are a few steps to enable its execution:
- Blockchain developers write the smart contract as a script using a programming language, during the coding part, developers implement the logic behind the contract so that when a given action or transaction occurs, the script enables the following step.
- Once the contract code is written, the script is sent out to the blockchain. A distributed network is used to execute the code. Typically every computer made available for computation can execute the contract, and the output of the contract should be the same for identical input regardless of the computer where it is executed.
- Several conditions can be coded, and final users may choose the conditions they needed for their blockchain smart contracts.
Execution of contract is run in a peer-to-peer way, which is very close to decentralization. Simple users connected to the Internet can be the clients, they have to install the client in the computer, we refer to this principle as mining, the computers used to run the program are called nodes.
Typically everyone can create a contract and upload this contract in a specific transaction on the blockchain. Depending on the technology used a specific virtual machine executes the code. Ethereum smart contract, for instance, is executed on Etherum virtual machine. The contract is funded, and like in the traditional payment method, some APIs are made available to expose the contract so that it is enabled to perform transactions automatically according to a specific agreement.
SMART CONTRACT USE CASES
This approach can be applied and used in several industries. In this section, we are going to browse some blockchain smart contracts examples. We can apply it in many areas such as:
- Ensure the authenticity of a copyrighted product. This helps ensure that the product a customer is buying is authentic not just a perfect copy. It can be achieved since the information stored on the blockchain is immutable making it easier to prove that a given product belongs to a specific line of product for instance.
- Money or currency transfer without an intermediary.
- Protect intellectual property
- Protection from theft and counterfeit: tampering a block inside a blockchain requires tampering with all the previous blocks which will ultimately lead to tampering with the initial block which is impossible. Selling a good that does not have a transaction recorded in the blockchain will lead to rejection.
- Internet of things: the idea here is to process transactions automatically no matter how many parties are involved from end to end. For instance, from a vendor A to a buyer B, the good may need to be transported by a transporter T and delivered to a different transporter. Blockchain smart contracts can execute these steps automatically and quickly. When a specific action or condition is met, the next step is automatically enabled. A financial transaction can happen as much as needed.
- To authenticate certificate (job certificate or diploma, etc.)
- Insurance: Like many other sectors, the insurance sectors have explored the blockchain application and started to implement the smart contract. The insurance sector, as with many others, started to investigate the application of blockchain. We’d like to mention a few smart contracts insurance use cases. In 2016, B3i is the first insurance consortium based on the blockchain. French insurance AXA has launched Fizzy a new flight-delay insurance product. Smart contracts in blockchain can help speed up claiming processing, each time there is a claim, the contract is executed automatically to identify the action that should be taken. Does the claim satisfy the terms and conditions and what should be done? Should the contract execute a refund?
To sum up, blockchain through smart contracts offers the following advantages:
- Reduce cost by removing intermediaries
- Reduce contract execution time; every action is executed automatically according to coded rules.
- Automatic process: it does not rely on a third party to enable
- By removing intermediaries, the cost of money transfers can be lowered
- It offers a transparent system: anyone can have access to the blockchain
- Protect data and transactions from fraud. It is impossible to alter the data inside a blockchain and still have a coherent chain.
- The decentralization aspect prevents the system to collapse which is the case when a centralized system is down.
SMART CONTRACT EXAMPLES IN THE REAL SOFTWARE
Let’s see some concrete blockchain smart contract examples to understand the provided value through smart contract use cases in the real world.
Flight delay insurance
The first example of a smart contract application is in insurance. Axa has recently launched its first flight delay insurance using a smart contract. Axa’s flight delay insurance is one of Ethereum smart contract examples; it’s an insurance that covers flight delays. The terms of the insurance are clear, and the reimbursement procedure is automatically. The customer can choose the best coverage that best fit his need. Smart contracts are linked to flight and air traffic databases that record flight’s status. For this product, the refund process is triggered when the system notices a delay of two hours or more.
Fizzy provides automatic compensation for the delayed flights which you can get without actually claiming it
The insurance computation is done transparently since rules are clear and a given input results in the same output. The reimbursement is very deterministic. The customer chooses what he wants to be cover in his insurance.
This solution has many advantages:
- It improves the claim process; making it simpler and faster. Rules are clear, and validation can be immediate. The blockchain is fed by specific sources (air traffic databases) on which it relies to validate the agreed terms and conditions.
- The process is dematerialized and is made more accessible to the customer. The customer doesn’t have to go to the insurance company in person to claim his compensation. He doesn’t have to present any document. All the information needed is already recorded during the insurance subscription.
- It improves user experience and leads to a better customer relationship. The reimbursement process is objective; it is based on facts leading to less frustration that may have caused law interpretation.
Supply chain management
Let’s consider the smart contract supply chain example that streamlines supply chain management. Delivering a product to a customer requires an elaborate organization. It may seem natural to the customer’s point of view, after all, it’s just picking the articles the customer ordered and delivering them to him. From the vendor’s store to the customer’s kitchen there are many processes:
- Products are bought from different suppliers and stored in a warehouse
- A customer makes his order.
- Products are packed in the warehouse.
- They are handed out to a transporter and may be delivered in another center.
- The products are delivered to the customer
Each of these actions is recorded and coded into smart contracts and uploaded in the blockchain. The provenance of food delivered to the store is known and certified.
A consortium between Walmart, IBM and Tsinghua University in Beijing in supply chain management has been launched in October 2017. This approach to supporting supply chain management has the following advantages:
- Transparency: it becomes a lot easier to trace food provenance leading to a safer consumption
- Reduce human actions in the chain
- Tracking lost products become a lot easier.
You can find more about this application here.
Smart contract use cases in intellectual property
Ascribe is one of the smart contracts use cases for intellectual property. This service was launched in 2014. It will help each artist preserve proof of ownership and protects the protected property against illegal use and theft. Unlike Ethereum smart contract examples, this one is based on Bitcoin.
It is implemented in a way that each owner of intellectual property can choose his terms and conditions for the use of his work. The owner can have direct interaction with businesses that are interested in using his work without an intermediary. The owner can, therefore, sell his work efficiently.
The service is simple and easy to use and presents several advantages such as:
- Better protection against illegal use or reuse of intellectual property.
- A safer share of intellectual property. The owner can easily dictate the conditions under which his work can be used. Users can download or use the product and are consenting by doing so in respecting these terms and conditions.
- The intellectual property is protected before it is even published which was not the case for traditional intellectual property protection.
- Better reliability and cheaper proof of ownership.
IN CONCLUSION
This approach has many advantages; it has made contract execution quicker, it can effectively reduce cost; its application can go beyond its current use. Currently, there are many ideas businesses want to implement using the blockchain smart contracts as they are growing awareness of the offered advantages. This approach is not yet used to its full potential and our imagination and our skills to implement contracts are the limits.
There is a growing number of blockchain enthusiasts, use cases of smart contracts will be broader, and more businesses will use it in the future. The first big step to achieve flawless smart contracts is to reach maturity.
What’s your opinion about the implementation of a smart contract for business? Leave your comments and questions in the comment section below. If you’re looking for a professional offshore software development company capable of creating smart contracts powered application or you have any questions you can contact us and we will be happy to provide you with the consultation.