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.
List of The Contents
- What are smart contracts
- Understanding blockchain
- From blockchain to smart contracts
- Use cases for the smart contracts
- Smart contracts implementation 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 a different interpretation of the contract. 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 a traditional contract can be:
- Time-consuming: checking the contract, validation, and approval, enabling next steps, etc.
- Resource consuming: execution of a traditional contract 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 contract evolves, and the smart contract is born. However, what is precisely a smart contract?
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 contracts codes are uploaded into the blockchain to check the validity of a contract and enable required steps. From its initialization, a smart contract is automatically executed. The main difference between smart contract and a traditional contract is that smart contract doesn’t rely on a third party; cryptographic code enforces it.
We can consider that vending machine is implementing a smart contract mechanically. 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 of what smart contracts are let’s see how does smart contract work?
To better understand how do smart contracts 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. Time stamping 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 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: 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 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 contract.
FROM BLOCKCHAIN TO SMART CONTRACTS
A smart contract is defined and executed inside a distributed blockchain. Every transaction and contract execution has to happen inside blockchain. There are few steps to enable this smart contract 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 the computer where it is executed.
- Several conditions can be coded, and final smart contract users may choose the conditions he needed for his smart contract.
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 traditional payment method, some APIs are made available to expose the contract so that it is enabled to perform transaction automatically according to a specific agreement.
USE CASES FOR THE SMART CONTRACTS
Smarts contract can be applied and used in several industries. In this section, we are going to browse few smart contract examples and use cases. We can use a smart contract in many areas such as:
- Ensure the authenticity of a copyrighted product. A smart contract 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 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 a 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. A smart contract 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 blockchain application and started to implement the smart contract. The insurance sector, as with many others, started to investigate the application of blockchain. In 2016, B3i the first insurance consortium based on the blockchain. French insurance AXA has launched Fizzy a new flight-delay insurance product. A smart contract 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 contract offers the following advantages:
- Reduce cost by removing intermediaries
- Reduce contract execution time; every action is executed automatically according to coded rules.
- Automatic process: smart contract 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 transaction 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 smart contract examples to understand the use of the smart contract in the real world.
Flight delay insurance
The first example of smart contract application is in insurance. Axa has recently launched its first flight delay insurance using 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 for the best coverage that best fit his need. The smart contract is 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 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 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.
You can find information about this first example at Fizzy Website
Supply chain management
A second example of a use case for smart contracts is in managing a supply chain. Delivering product to a customer requires 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 this action is recorded and coded into a smart contract 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. Using smart contract to support 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
Use of smart contract in intellectual property
Ascribe is an example of a use of a smart contract for the 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 smart contract is based on Bitcoin.
The smart contract 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 an illegal use or reuse of the intellectual property.
- A safer share of the 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.
This smart contract application can be found at Ascribe Website
A smart contract 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 business want to implement using the contract as they are growing awareness of the advantages smart contract offers. A smart contract is not yet used to its full potential and our imagination and our skills to implement the smart contract are the limits.
There is a growing number of blockchain enthusiasts, smart contract’s use will be broader, and more businesses will use it in the future. The first big step to achieve a flawless smart contract is to reach maturity.
What’s your opinion about implementation of the smart contracts in business? Leave your comments and questions in the comment section below. If you’re looking for the 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.