Blockchain CBSA – Objectives – Hyperledger
- Hyperledger Project
Let’s talk about the Hyperledger project. Hyperledger is more than just hyperledger, Fabric. It’s really a project. So let’s talk about it. Now, Hyperledger is an open source project that came out of the Linux Foundation. It’s a global collaboration. Essentially. It’s hosted by the Linger Linux Foundation. It has a governance structure, it’s open source as well. Now the project itself consists of essentially three main components. It has the infrastructure component, the framework, and the tool component as well. Let’s go ahead and talk about these.
So let’s go ahead and talk about the portfolio as well. Now when it comes to Hyperledger, the portfolio has quite a bit around how Hyperledger is actually managed and how it is structured. So the infrastructure part of it is going to have the legal, the marketing, the organizational structure. Frameworks are going to be the different blockchains.
And then the tools is going to be essentially the solutions that are basically going to provide value to the individual frameworks, such as Fabric, saw tooth, et cetera. So let’s go ahead and talk now about the Hyperledger framework. Now the framework is essentially going to be comprised of five main blockchains. So when we talk about a framework, we just want to be aware that you understand that a framework is really a blockchain. Now this exam, the CBSA is going to focus only on Fabric, so you don’t have to worry about the other four for this exam.
So Fabric is really a distributed ledger and it has a smart contract engine. Now, when we talk about Hyper ledger fabric, one of the terms we’re going to talk a lot about is going to be chain code. Now, chain code is really a smart contract. This is IBM’s term for a smart contract. That’s really what it is. Now, you may be aware that IBM really developed 95% or so or even a little bit more of Hyperledger. So it’s really their project, but they turned it over to the Hyperledger Foundation to sort of handle, or the Linux Foundation to really handle this open source project.
Now, we also know that hyperledger fabric supports golang. It’s written basically at a low level on Golang, but you can definitely write on JavaScript, which is not low level like going hyperledger fabric is really intended to be a solution that is modular and it really gives you as an enterprise some great capabilities. For example, if you want to swap out your MSP, can you go ahead and swap out your CA?
You could swap out the consensus method like Solo versus Kafka if you want. It’s considered plug and play. So let’s talk about Hyperledger features. Now, Hyperledger Fabric is really a blockchain implementation that is modular and extensible. It is a modular subsystem. It’s designed to be different from other blockchains. There’s no question about it. It is enterprise driven as well, and just realize too that it really does support the enterprise remarkably well.
Some of the benefits of using a hyperledger fabric is that it’s modular and extensible. It’s modular in the sense that you could swap out consensus, your smart contract layer, communication layer, and I won’t read them all to you for the exam. This is not something you didn’t really know.
I’m just sort of covering this for folks that may not be familiar with hyperledger. Interoperability supports backward compatibility and also it will eventually support interoperability between other hyperledger blockchains as well. Now, when it comes to secure solutions, one of the things to pay attention to is that enterprises definitely want to have superb security, right? So that’s really important. So hyperledger fits this because it supports security, supports privacy. It is an enterprise permission blockchain.
Now, one of the things that I did want to point out is that and I always get a question on this, but basically hyperledger does not have a cryptocurrency, nor will it. So there’s no token or cryptocurrency at this time. And there was a statement from Brian Belindorf, which is really the executive that’s running Hyperledger. He basically says he’s sympathetic to it, but he doesn’t see any future right now because, again, hyper ledger is not meant to be permission less. It’s not meant to be really supporting anything around. Cryptocurrency has a rich API solution capacity as well, and it is on GitHub as well.
- Hyperledger Fabric
In this module here. Let’s talk about the objectives around Hyperledger Fabric. Now, one of the areas to focus on on Hyperledger Fabric is really just to understand why you want to use it, the main use cases for it, some of the features that’s really all you need to know for this specific exam. If you really need to know a deeper dive into Hyperledger fabric, I have eight and ten hour courses that are just dedicated to this and I also have one that is really focused on IBM blockchain as a service which deploys Hyperledger as well. So what I’m trying to get at is we’re just covering enough to make you intelligent enough for the exam, nothing more and nothing less. Now, with Hyperledger, we know that it follows a modular design. It’s meant to be plug and play. Now, I always like the term plug and play because it brings back memories of the days that Windows are supposed to be plug and play.
Right? We know how that worked out. But anyways, when it comes to an architecture with Fabric, one of the things to point out is that Fabric has a really distinct and well defined architecture. So it makes it remarkably easy as a blockchain architect to be able to design services for it because it’s so clearly defined. Everything is integrated extremely well. For example, you have identity, membership services, the ledger, you have transactions, you have a smart contract layer. These layers all work together remarkably well. Now, one of the things I would advise is if you haven’t had the chance to get familiar with Fabric, do that a little bit more. But the main thing on the exam I want you to know is that it’s a pluggable architecture. Let’s talk about consensus. Now, Hyperledger Fabric does things a little bit differently than some other blockchains.
One of the things it does differently is that the transaction processing is done different in the sense that transactions are actually ordered before they’re actually validated. We’ll talk about how that works. Basically, let’s talk about why we need Consensus. Now, on the exam, you’ll get a question, and this is not just for Hyperledgers. For any blockchain, Consensus has to satisfy two properties. These two properties are safety and Liveliness. Again, for the exam, you’re expected to know this, and I’m just reiterating this as clearly as I can make sure you know that Safety is going to guarantee the same sequence of inputs based on, again, the results in the same output, right? Again, inputs and outputs are going to be sequential. Essentially, Liveliness is different in the sense that if a node fails, how does this actually get handled? So we need to have safety and Liveliness when it comes to Consensus satisfying properties. Again, liveliness and Safety, you will see this again. Now, when it comes to Hyperledger Fabric, basically Fabric uses Kafka as an ordering service. This is the lottery based Consensus. Now, Kafka, for those that aren’t from Kafka.
It’s also known as Apache Kafka. It’s really a community event streaming platform that can really handle billions and trillions of events. It’s really massive scale, but basically it also is used basically as a messaging key as well. And the goal of Kafka is to really bring things all together. It works remarkably well for a lot of different scenarios, has a lot of good features, can scale basically with Hyper ledger fabric. Kafka supports for example, crash fault tolerance.
It’s not Byzantine fault tolerance, but it does prevent in some respects the system from reaching an agreement if there is an issue. So basically because it’s not BFT, there could be some weaknesses there, but overall it works remarkably well. So it does provide as a pro provides that crash fault tolerance that’s really needed and it’s really quick in a matter of seconds. Now again, I have stated that it’s permission voting based. Basically the leader does the ordering. It also supports instant replicas, et cetera, but basically it’s the ordering service.
Now when you add more nodes, again you have to scale up to meet the performance requirements. For example, there are trade offs of course. So let’s talk about some of the differences here. Now generally in most blockchains the validation is going to take place before the transaction is ordered or written to blockchain with hyperledger it uses an EOV approach instead of an Evo approach. Basically endorsement, let’s just some terms here we want to get as well. Endorsement is driven by policies so based on the number of signatures. For example, when you set up hyperledger fabric, you have to specify the number of nodes that can endorse the transaction. So if you have twelve nodes and you need six to endorse the transaction and only five endorsement, endorsement, that transaction will not be consummated, it’s not going to be validated.
Validated that is okay. Now the ordering phase also is going to get the endorsed transaction and agreed to. The order is going to be committed to the ledger and then what happens is the validation will go ahead and take those transactions and then validate that everything looks good. Now, consensus is planned out in three phases. We know that it’s endorsement, ordering and validation. One of the things on the exam that you want to know is hyperledger fabric does have three phases and consensus.
The first is endorsement, second is ordering and the third is validation. And if you don’t know what those are, they’re right here. Again, just be aware of that. And this is how the transaction flow works as well in the hyperledger fabric workflow. And there are some review questions as well. Let’s go ahead and talk about the ledger now. So with Hyperledger fabric, the ledger is again similar to some other blockchains, but different in some other cases as well.
And there’s a lot of features that are very different for that matter. Now, the hyperledger fabric ledger is a sequence tamper resistant record of all transitions. Again, the transactions are going to be basically invoked based on what’s called an invocation from the chain code. Each of the transactions will have an asset key value pair and therefore committed to the ledger. Now, Fabric ledger has two parts. We have state data and the transaction logs. Now, the state data is a representation of the current state of the assets. Now, probably the most difficult question on the exam will come from this page right here. You want to know the difference between state data and transaction logs. So the state data is basically, again, the current state. This is the world state. The transaction logs is going to be immutable. In other words, it can’t be modified. Now the database.
Now, one of the things about Hyperledger Fabric as we know, is that it has some plug and play capability, some modularity, and you have the ability to choose the database as well. By default, Hyperledger Fabric supports level DV. However, and just for the exam, you want to know, level DV is a default key value state, but Couch DV is an option that can be used as well. Now, why would we want to use CouchDB over level DB? Very good question.
Let’s say you’re a developer and you want to go ahead and do some complex queries. So basically you want to search the JSON, you want to search images or whatever. That’s more of a complex query. So you really couldn’t do that in level DV effectively. And there’s also command variables that are not supported in level DB that would be supported especially from a query perspective and Coach DB, so that’s called a complex query. So if you want to use Coach DB for the world state data, it’s you can do that, but you would want to use what database that would be coachd. All right, let’s move on to the next module and talk about Hyperledger composer.