Build a blockchain insurance app


With its distributed ledger, smart contracts, and non-repudiation capabilities, blockchain is revolutionizing the way financial organizations do business, and the insurance industry is no exception. This code pattern shows you how to implement a web-based blockchain app using the IBM Blockchain Platform to facilitate insurance sales and claims.


Most of us have been there: You’ve just had a fender-bender, and now you’re dreading the time and effort it is going to take to deal with your insurance company, the police, and the other driver. Even if things go relatively smoothly, it is still a major disruption of your schedule.

But what if you as a developer could turn things around and actually disrupt the insurance industry? What if you could improve not only your own experience but also that of millions of people around the world dealing with the same inconveniences, delays, and administrative frustrations? Well, this is your chance.

Blockchain presents a huge opportunity for the insurance industry. It offers the chance to innovate around the way data is exchanged, claims are processed, and fraud is prevented. Blockchain can bring together developers from tech companies, regulators, and insurance companies to create a valuable new insurance management asset.

A natural pairing through its distributed ledger, smart contracts, and non-repudiation capabilities that act as a shared infrastructure, blockchain can transform all kinds of insurance processes. Currently, many insurance processes are manual, error-prone, and can require long processing times. There are often different versions of the same data in multiple systems of record, leading to added costs and lengthy disputes.

With blockchain, manual processes are automated by sharing information on plan participants, entitlements, and claim data. Smart contracts are computationally encoded with participant registration and verification rules. Shared data and smart contract computations reduce downstream disputes. Benefits verification is based on multiple data sources that are readily available to all service providers.

The bottom line: Blockchain technology provides an opportunity for the insurance industry to improve operating efficiencies, lower the costs of transaction processing, enhance the customer experience, improve data quality, and increase trust among parties.

When you complete this code pattern, you will know how to build a functional blockchain insurance application. The web-based app, which is written in Node.js and React, has four participants (peers):

  • The Insurance peer is the company that provides the insurance for the product (in our example, the car) and who is responsible for processing the claims.
  • The Police peer is responsible for verifying the accident or theft claims.
  • The Repair shop peer is responsible for repairs of the product.
  • The Shop peer sells the products to a consumer.

So how does the app actually work? Imagine a sports enthusiast, Susie, decides she wants to purchase a new bike. She goes to the bike shop and finds an amazing deal on a road racer. As part of the purchase process, she is offered an insurance contract, which she agrees is important to have. She signs up for it, providing her personal data along with a start and end date for the contract. The daily price is calculated by a formula in the chaincode once the contract is processed. When all the paperwork is complete, Susie is given credentials so she can log in at any time if she needs to file a claim. At this point, a block is written to the blockchain to maintain the transaction.

As luck would have it, 10 days later, her bike is stolen when she rides up to the Berkeley Hills. After reporting the theft to the police, she opens the self-service tab on the app, logs in, describes the theft, and files her claim with the insurance company. When she submits the claim, it is written onto the block as another transaction. The claim is first processed by the police, who can either confirm or deny the theft; in this case, the theft is confirmed, the police attach a file reference number, and another block is written to the chain. (In the same manner, if Susie had filed a claim for a bike accident that resulted in damage to the bike, it would be a repair shop that processed the claim instead of the police.) The insurance company monitors all active claims on the blockchain, so when the police submit their verification, the company receives that confirmation and submits a reimbursement for the claim. Just as with the previous transactions, the reimbursement is written to the blockchain. Susie is happy to see that the insurance company has paid her claim (although not quite as happy as she would be if she had her bike back). Note that insurance companies have the option to activate or deactivate certain contracts. This does not mean that contracts that have already been signed by customers will no longer be valid; it simply does not allow new signings for these types of contracts. In addition, the insurance company can create new contract templates with different terms and conditions or a different pricing structure.

So do not fret about possible disruptions to your routine the next time you have a bit of automotive, or cycling, bad luck. Complete this code pattern, build your blockchain skills, and help disrupt an entire industry!


blockchain insurance app flow

  1. The blockchain operator creates an IBM Kubernetes Service cluster (32CPU, 32RAM, 3 workers recommended) and an IBM Blockchain Platform service.
  2. IBM Blockchain Platform creates a Hyperledger Fabric network on an IBM Kubernetes Service, and the operator installs and instantiates the smart contract on the network.
  3. The Node.js application server uses the Fabric SDK to interact with the deployed network on IBM Blockchain Platform.
  4. The React UI uses the Node.js application API to interact and submit transactions to the network.
  5. The user interacts with the insurance application web interface to update and query the blockchain ledger and state.


Find the detailed steps for this pattern in the README file. The steps will show you how to:

  • Create IBM Cloud services
  • Build a network – Certificate Authority
  • Build a network – Create MSP Definitions
  • Build a network – Create Peers
  • Build a network – Create Orderer
  • Build a network – Create and Join Channel
  • Deploy Insurance Smart Contract on the network
  • Connect application to the network
  • Enroll App Admin Identities
  • Run the application