When to create an organization in hyperledger fabric network? - hyperledger-fabric

Hyperledger enables you to create participants (via chaincode) as well as Organisations (via fabric setup). In a supply chain or any process, how do you decide which one is an Organisation and which one is a participant.
From my understanding, all participants of same category should fall under one organisation.
But then I have another issue, will buyers also gonna have their own organizations?

Organizations on Hyperledger works like a Board of Directors, they vote in consensus inside your network, if you are the only one org then everything is auto approved by you, Ex. An upgrade in chaincode with new model.
Use case: Think about if we build a blockchain network for Banks, every institution will be an org and the participants are their respective clients.

It all depends on security and privacy factors.
let consider Maersk, If the network is setup within Maersk what's the purpose of hiding data within themselves ? untill and unless there is no trust within.
So if Data Availabilty > Data privacy, i'd go on creating Maersk as one Organization and all sub entity under them are Peers and one channel so that they can share data within and between them.
Now, what if someone other than Maersk entity needs to be involved? like fleet, shipping, delivery, Manufacturer etc, they are the separate Orgs as these Organizations don't need to share every data flowing in and out, they only require what they want to serve for Maersk.
There might be a case where each entity works separate and has their own rules and interaction with multiple other parties under a main entity. Then again you need to decide based on the data sharing ,Transparency, Availability between parties. if data is just available between one or two entity where does DLT concept comes in ? and how/where does consensus fit in ?!!
You need to keep all these factors over use case and decide upon creation of Org and Peer.
Correct me if i'm wrong

Related

hyperledger for uncentralized database

I am trying to implement a tamper proof uncentralized database of some records. these record are static and they cannot be transferred between participants, i.e, not like some currency or a stock. i just want them to be stored as they are. Identity is an important thing with my project. only certain people can add blocks to the chain, rest of them should be only there to verify the chain. Can i implement a blockchain for this usecase? if it is possible should i use an ethereum chain or hyperledger fabric?
According to your use case which is, certain people, add records and certain query records. A typical normal access control application and the database can solve your issue but,
If you deal with untrusted people and need complete transparency with identity-based access control and equal rights of all participants then hyperledger fabric is best.

Hyperledger through a business perspective

If a third party provides a set of organizations with a Hyperledger network using which those organizations can perform a certain set of transactions in a collaborative way with trust.
Then what are the ways in which the third party can earn money?
If the third party wants to take a commission on the transactions taking place between the different organizations then does it always need to be part of all the different channels?
Your question seems pretty unclear and out of context.
Hyperledger Network is a Permissioned Blockchain Network so, any third person cannot easily join the network, they need to be authorized by certain peers.
Also, About "commission on the transaction", Hyperledger Network is formed by the consortium of organizations so, why would there be commission on transactions.? Think About it! However, You can configure the Network however you like it.

Hyperledger Fabric design

I am new to the area of DLTs or "blockchain" and I am trying to create an application on top of Hyperledger Fabric. Before I describe my use case, I need to mention that due to my use case's nature I need a private & permissioned "blockchain" which justifies the choice of Fabric (I am aware of other platforms e.g. Corda, private Ethereum, but Fabric seems to match my use case better).
Use Case
My use case consists of two different types of participants. A number of organizations (which upload and share information about individuals on the distributed ledger) and a client who can query information about an individual.
The client should not be able to see the transactions uploaded by the organizations and will not have write rights on the DL. He has read-only rights. Moreover, the organizations trust each other and there is also a level of trust between them and the client.
Design thoughts
Based on what I've read, I was thinking of creating a DL network that includes all of these parties and use channels which, based on the documentation, can be used to create a grouping among a number of participants (the organizations in my case) thus "hiding" the transactions from the parties which are not included in this group (the client in my case).
However, later I read about chaincode (a.k.a. smart contracts) which:
can be invoked by an application external to the blockchain when that
application needs to interact with the ledger
which confused me since if the "blockchain" can be queried from an external entity, that probably means that the client should not be included in the trusted network.
Am I headed in the wrong direction (design-wise)?
Based on your description, Hyperledger Fabric channels sound like a good solution. You should also familiarise yourself with private data collections, as this is another way of hiding some of the data from some peers. Which option is best for your scenario will depend on how your datasets are structured, and whether you also need to keep the data private from the orderer.
Clients are not part of the network. They query the blockchain by connecting to a peer and then requesting data from that peer. They can then only access the data visible to that peer (which is stored locally by that peer). So, it is not possible for a client to access more data than is available to the peer the client is connected to.
In your example, you would have a "client" organisation, with at least one peer. This peer would be part of the network, and your client application would then connect to it for access to data on the ledger (typically using the Hyperledger Fabric Node SDK).
There are two types of chaincode in Hyperledger Fabric.
User Chaincode (often just referred to as "chaincode") is used to update the ledger for a channel, and is only installed on those peers which require it (i.e. endorsing peers). Since your "client" peer would not be an endorsing peer, it would not have access to the user chaincode for the channel.
System Chaincode which all peers have access to, provides (among other things) an interface to allow queries to be run against the ledger.

Hyperledger fabric - Single Org vs Multi Org and When to setup Multi Org environment?

I have a web-based application for HR Employee management.
This application has many clients that login into the web app and uses the features.
I want to integrate this app into the blockchain. I want some of the data (compliance related, sensitive) to be recorded in the blockchain.
Data will be written to blockchain by my application only. My clients will only view the data.
What approach should I use?
a) Single Org (my app) with multiple peers (1 peer per client).
b) Multi-Org: Org1 = My app, Org 2 = Client 1, Org 3 = Client 2 .... n.
If any other approach please suggest.
Note: Individual Clients won't be sharing any data among themselves.
I want to use the hyper ledger fabric blockchain for only storing the information because it is immutable and tamper proof.
Even If I go with multi-org scenario, Both orgs will be added by me on servers managed by us. Will this cause trust issues in courts legally? Can I prove that data has not been tampered although all servers hosting blockchain are mine?
Based on your statement "Individual Clients won't be sharing any data among themselves", I would suggest 2 options based on the native capabilities of HLF, depending on whether all data in the transaction is private, or only a subset of the data.
No data is shared - one channel per peer, one peer/org per client OR one peer with multiple channels. In the multi-peer case, transaction data is only stored on the one peer which is a member of the channel. No other peers receive the data.
Some data is shared - one channel for all peers, one peer/org per client. In this case, a private data collection can be used to store private data. Transactions are stored on the ledgers of all peers, containing all the data in the case of the initiating peer, and only the public data plus the hash of the private data on all other peers.
Neither of these options provides data redundancy across peers, but since you didnĀ“t state this as a requirement, I'm assuming this isn't a problem.
Since you state that you will be in control of all peers, the immutability guarantee doesn't count for much, as there is nothing to prevent you from rewriting the entire blockchain at any time. Despite this, such a solution would still be superior to a traditional database, since it would be immune to changes at an individual transaction level.

Hyperledger Consensus - how does it work?

Here is our use-case:
Anna would like to sell her shares to Peter, and Olga needs to approve it (as an owner of the company).
How would that work on blockchain hyperledger fabric/composer with consensus?
In particular, what part of that is a transaction, what is a proposal (is a proposal requires a physical approval of a transaction by a living person?) and how is that handled on blockchain, what happens in the application and outside of the application.
Please be as specific as possible.
Thanks!
A few things first:
Composer uses whatever consensus algorithm the underlying blockchain is configured to use. So; Hyperledger Fabric at the moment offers SOLO or KAFKA.
KAFKA offers fault tolerance only, not byzantine fault tolerance.
So:
Endorsement Policies do exist which is what you are describing. It does not require approval by a living person, you can make everything programmatic, it could even be an IoT device. The approver must simulate the transaction and see if they agree with the output. Olga is the approver in your scenario.
It's important to make all chaincode (transactions in Composer) deterministic, so they can be simulated in that way.
There is a good description on transaction flow on Fabric's docs: http://hyperledger-fabric.readthedocs.io/en/latest/txflow.html
I'm releasing a paper in a month that has a section on consensus comparisons and Composer/Fabric specifically. I can send you a draft if you're interested further.
There are two aspects to your question, one is the approval aspect of a living person and second is the integrity of the ledger state (consensus).
I will explain in the reverse order.
Consensus Part
So Hyperledger Fabric is an enterprise solution that targets to maintain a consistent ledger on which all organization of the consortium needs to agree upon. This is achieved by combining the ledgers of multiple organization into one ledger and the transactions recorded in this one ledger will include transaction from each party.
These transactions are not random transactions but rather implementation of Smart Contract called chaincode in Fabric terminology. Whenever a chaincode is deployed on a Fabric channel(a private subnet associated with its own ledger) it initializes the World State i.e default assets and their values.
Next each organization agree upon an endorsement policy, for example 1 peer from each organization should endorse the transaction(called transaction proposal in this state), the endorsement is simply a read-write set of the transaction having read set(values of assets before transaction simulation), write set(values of assets after the transaction simulation). If the endorsement from all peers(all those peers that satisfy the endorsement policy) is same, which means the world state of assets is consistent across all the peers(atleast those that satisfy endorsement policy) and hence ledger data integrity is achieve.
The consensus further includes batching transactions into blocks and ordering of the transactions within the block by ordering service which validates the endorsers signatures again and the World State validation is done one final time when the block reaches peers for committing.
Approval part
When you have an approval process that requires a participant interaction, it is something that you will have to take care of in your chaincode. Composer is the best place to start.
From Composer examples look at the CarAuction example and you will understand the for each state transition you will have to have registery e.g a seller participant owns an asset Car but when the Car is auctioned for selling it has to be added to a listing registry using transaction where it will be visible to all bidder participants, this movement of state of Car asset is achieved by a transaction AuctionMyCardOrSomething invoked by authorized party here seller. Then when the Auctioneer(another participant with a different role) executes another transaction called closed bidding then the Car ownership can be transferred to the highest bidder if all conditions are satisfied. Node that placing a bid is also a transaction.
Pay attention the the Auctioneer and state transitions in this example and the same model can be applied to your case. Each time state transition is required you have to execute a transaction and update the ledger.
Hope this helps.

Resources