Reader small image

You're reading from  Blockchain for Enterprise

Product typeBook
Published inSep 2018
Reading LevelBeginner
PublisherPackt
ISBN-139781788479745
Edition1st Edition
Languages
Concepts
Right arrow
Author (1)
Narayan Prusty
Narayan Prusty
author image
Narayan Prusty

Narayan Prusty is a full-stack developer. He works as a consultant for various start-ups around the world. He has worked on various technologies and programming languages but is very passionate about JavaScript, WordPress, Ethereum, Solr, React, Cordova, MongoDB, and AWS. Apart from consulting for various start-ups, he also runs a blog titled QNimate and a video tutorial site titled QScutter, where he shares information about a lot of the technologies he works on.
Read more about Narayan Prusty

Right arrow

Chapter 5. Building Interoperable Blockchains

There are various permissioned and public blockchains representing different assets, information, and business processes. One of the major requirements for using these networks is to enable them to talk to each other, which is a major challenge to overcome. It would be great if there were only one blockchain to rule them all, but that's definitely not going to happen, because it's not possible for only one blockchain to win in terms of security, privacy, efficiency, flexibility, platform complexity, developer ease of use, and so on. The future of blockchains will be several public and permissioned blockchains interoperating with each other. In this chapter, we are going to explore how to achieve interoperability between multiple Quorum networks.

In this chapter, we will cover the following topics:

  • Understanding what blockchain interoperability means and the various popular projects related to it
  • Examining the use cases that interoperable blockchains...

Understanding blockchain interoperability


Interoperable blockchains are blockchains that can talk to each other. Each blockchain can read the other's state. There will be many occasions when you will want to enable your smart contracts to talk to centralized or other decentralized apps. When we talk about interoperability between DApps we're talking about something different than interoperability between blockchains.

Note

Enabling an Ethereum smart contract to check whether a file exists in IPFS or not is enabling interoperability between DApps, whereas enabling an Ethereum smart contract to fetch a Bitcoin account balance is enabling interoperability between blockchains.

Getting Ethereum smart contracts to make REST APIs call to centralized apps is considered enabling interoperability between Ethereum and WWW. But in this chapter, we will learn about interoperability between blockchains, specifically interoperability between Quorum networks.

There are various popular projects being developed...

What can interoperable blockchains achieve?


Before going further and looking at how to achieve blockchain interoperability, we need to know what kinds of things that interoperable blockchains can achieve. There are obviously many use cases for interoperable blockchains, but we will be looking at the use cases that interoperability between blockchains mostly aims to achieve. It may achieve one or more of the following use cases:

  • Portable assets: Moving assets back and forth from one blockchain to another. These are also called one-to-one pegs or two-way pegs
  • Payment-versus-payment and payment-versus-delivery: These are technically known as atomic swaps. When two users are exchanging assets that reside in two different blockchains, a guarantee is needed, stating that either both transfers happen or neither does. For example, if one blockchain holds digitalized USD and the other holds digitalized EUR, then users should be able to exchange these assets atomically.
  • Fetching information and reacting...

Strategies for implementing blockchain interoperability


Let's look at the various strategies with which you can achieve one or more of the previous use cases. We will learn the strategies that we can implement in Quorum, but not all the ones that are available for public or other blockchains. We will also look at examples of how to implement these strategies.

Single custodian

The easiest way to achieve interoperability is to have a centralized third-party through which blockchains can talk to each other. Essentially, you need to trust the third-party. 

However, centralized interoperability projects, such as Oraclize, have solved the trust problem. Oraclize enables your Ethereum smart contracts to communicate with the WWW; that is, it enables you to make REST API calls, fetch a Bitcoin account balance, check the file status in IPFS, and so on. Oraclize also provides a proof for smart contracts stating that the results have not been manipulated; therefore, Oraclize has tackled the trust issue...

Building a FedCoin


FedCoin is a digital currency issued by a central bank and hedged one to one with their fiat currency. Digitalizing fiat currency using blockchain has several benefits, such as enabling easy cross-border payments, saving reconciliation efforts, and so on. 

Let's build some digitalized INR and USD on two different blockchain networks. Then, let's create some atomic swap contracts to enable the exchange of these currencies between banks atomically. This use case would require you to create two different Quorum networks using IBFT consensus. In each network there is one authority, which is the central bank, and N number of peers, which are other banks. So, you can assume that in the first network, the Federal Reserve System (FRS) is the authority and Bank of America (BOA) and ICICI banks are the peers. Similarly, in the second network, the Reserve Bank of India (RBI) is the authority and BOA and the ICICI bank are the peers.

You don't have to build this network now because...

Summary


In this chapter, we looked at the various options for building interoperable blockchains. To summarize, single custodian, multisignature federations, and hash locking are easy to implement, whereas sidechains are complicated and require a lot of engineering. Soon, we will have production-permissioned blockchain platforms that have sidechains support built in. 

Finally, we implemented hash locking by simulating two central and commercial banks. You can go ahead and try to build two different networks and attempt to conduct an atomic exchange. 

In the next chapter, we will learn how to build a blockchain as a server for Quorum. While building this, we will learn about the concepts of DevOps and cloud computing too.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Blockchain for Enterprise
Published in: Sep 2018Publisher: PacktISBN-13: 9781788479745
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Narayan Prusty

Narayan Prusty is a full-stack developer. He works as a consultant for various start-ups around the world. He has worked on various technologies and programming languages but is very passionate about JavaScript, WordPress, Ethereum, Solr, React, Cordova, MongoDB, and AWS. Apart from consulting for various start-ups, he also runs a blog titled QNimate and a video tutorial site titled QScutter, where he shares information about a lot of the technologies he works on.
Read more about Narayan Prusty