Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

What Is Smart Contracts Blockchain and Its Use Cases in Business

DZone's Guide to

What Is Smart Contracts Blockchain and Its Use Cases in Business

Want to learn more about smart contracts in business? Learn more about smart contracts and blockchain in this post.

· Security Zone ·
Free Resource

Discover how to provide active runtime protection for your web applications from known and unknown vulnerabilities including Remote Code Execution Attacks.

smart contracts in blockсhain in comparison to the ordinary contracts image 1

The execution of a traditional contract requires human validation to check the terms and conditions and decide 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, the more it requires control and the more there is a risk of disputes. For example, this can involve several execution steps that enable specific actions or that give rise to certain privileges.

There is another way to deal with a contract in a way that it overcomes these challenges and limitations mentioned previously. As technology evolves, the way we deal with contracts evolve, and the smart contract is born. However, what is 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 misinterpretation. 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 in blockсhain in comparison to the ordinary contracts image 2

Smart contracts' code is 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 a smart contract and a traditional contract is that a smart contract doesn’t rely on a third party; cryptographic code enforces it.

We can consider a vending machine that 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 into the machine and select your product, it delivers the product directly to you, as long as you meet the terms and conditions — 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 smart contract works.

Understanding Blockchain

To better understand how 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 appeared in a paper published by Haber and Stornetta in 1991; you can find out more about time-stamping a digital document here.


what is blockchain illustration image

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 immutable nature of timestamps.

This first proposition has evolved and technology, such as blockchain, has appeared and permitted the refinement of the first proposition. In the approach used by blockchain technology, 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 functions' and hash pointers' characteristics. These characteristics are:

  • Any given input has a single output: the hash.
  • The output is standardized — a 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 are found 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 a linked data structure, it contains data and a hash pointer that points to the 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 technology and a 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 the blockchain. There are a 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 of the computer where it is executed.
  • Several conditions can be coded, and final smart contract users may choose the conditions needed for this smart contract.

Execution of a contract is run in a peer-to-peer way, which is very close to decentralization. Simple users connected to the Internet can often be clients. They have to install the client on 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 contracts, for instance, are executed on an Etherum virtual machine. The contract is funded, and, like in a 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.

Use Cases for Smart Contracts

Smarts contracts can be applied and used in several industries. In this section, we are going to browse a few smart contract examples and use cases. We can use a smart contract in many areas such as:

  • Ensuring the authenticity of a copyrighted product — A smart contract helps ensure that the product a customer is buying is authentic and not just a perfect copy. It can be achieved since the information stored on blockchain is immutable making it easier, for instance, to prove that a given product belongs to a specific line of products.
  • 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 certificates (job certificates, diplomas, etc.)
  • Insurance — Like many other sectors, the insurance sector has explored the applicability of blockchain and started to implement smart contracts. In 2016, B3i, the first insurance consortium based on the blockchain, was held. French insurance AXA has also launched Fizzy, a new flight-delay insurance product. A smart contract can help speed up claims 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 offer the following advantages:

  • Reduce cost by removing intermediaries.
  • Reduce contract execution time — every action is executed automatically, according to coded rules.
  • Automatic process— smart contracts do not rely on third parties to enable them.
  • 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 from collapsing, which is the case when a centralized system is down.

Smart Contract Examples in Real Software

Let’s see some concrete smart contract examples to understand the use of the smart contracts 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 contracts. The terms of the insurance are clear, and the reimbursement procedure is automatic. The customer can choose the coverage that best fits their needs. The smart contract is linked to flight and air traffic databases that record the flight’s status. For this product, the refund process is triggered when the system notices a delay of two hours or more.

FIzzy smart contract blockchain use case implemenation example

Fizzy provides automatic compensation for 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 they want to be covered in their insurance.

This solution has many advantages:

  • It improves claim processes, 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 upon terms and conditions.
  • The process is dematerialized and made more accessible to the customer. The customer doesn’t have to go to the insurance company in person to claim their compensation. They don't have to present any documentation. All the information needed has already been recorded during the insurance subscription process.
  • 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 the 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 these actions 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 was 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 becomes a lot easier.

You can find more about this application here.

Use of Smart Contract in Intellectual Property

Ascribe is an example use case of a smart contract for intellectual property. This service was launched in 2014. It will help each artist preserve proof of ownership and protect 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 by consenting in doing so and 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.

Conclusion

A smart contract has many advantages — it has made contract execution quicker, it can effectively reduce cost, and its application can go beyond its current use. Currently, there are many ideas businesses want to implement using the contract as they are growing in awareness of the advantages smart contract offers. A smart contract is not yet used to its full potential and our imagination and skills to implement the smart contract are limitless.

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.

Find out how Waratek’s award-winning application security platform can improve the security of your new and legacy applications and platforms with no false positives, code changes or slowing your application.

Topics:
smart contracts ,ethereum ,blockchain and ethereum ,security ,supply chain management

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}