“state channel” v.s “micro-payment channel” : are they the same? - payment

We use "micro-payment channels" such as "Bitcoin Lightning Network" or "Duplex Micro-Payment Channels" for saving transaction fee, accelerating payments, supporting better micro-payment and scaling blockchain.
Is there any difference between "state channel" v.s "micro-payment channel"? and if so, what are differences?

Micro-payment channel is a subset of state channel. State channels are more general form of payment channels applying the same idea to any kind of state transition systems on Blockchain.
State channels in ethereum supports wider use-cases than payments on bitcoin network.
Good ref: https://www.jeffcoleman.ca/state-channels/

Related

Why there should be orderer node in hyperledger? Can the orderer node's function be transferred to Peer node?

I want to ask about blockhain Hyperledger Fabric. Is it possible to let Peer nodes to do Orderer node's task which is packing the transaction into new block?
I kind of think the orderer node is kind of a redundant node since for example in Bitcoin network, the packing of the transactions into block and the verification of new transaction is solely done by the full node(miner node).
Can anyone give me justification why there should be orderer's node in the Hyperledger Fabric?
And if I were to build my project on Hyperledger network and forgo orderer node(which means the peer node will do both the verification of transaction and the packing of transaction) is it possible?
Please tell me your thoughts and ideas.
Thank you.
TL;DR
HLF by design is deterministic so the orderer nodes are important. Only they participate in consensus not all peers and the blocks they produce are Final (Not prone to forks).
No you cannot make a peer orderer as well. Your network configuration for HLF must have at least one orderer to work
Hyperledger Fabric (HLF) vs Bitcoin
HLF is a private permissioned blockchain where as Bitcoin is a public permissionless blockchain. You should not expect them to work similarly.
Public blockchains
In public blockchain for example bitcoin everyone is treated equal in other words no one have special privileges you may think well miner are the ones minning block but the important point is anyone can become miner its open game no restriction on who can become miner or who can run a node etc.
Private Blockchain
In private blockchain for example HLF roles are predefined at the time of setting up and starting blockchain. Each role has certain tasks and privileges and restriction. The no of organisations peers, endorser peers, orderers, channels all are predefined and some have special privileges which no other role has like orderer whose is responsible for receiving endorsed transactions from peers and put them into blocks then these blocks are distributed to all peers. These blocks are Final.
But Why?
Private Blockchains (Like HLF) full-fill special use cases for example supply chain, B2B operations In such use cases one may want to harness positives of blockchain like transparency, auditing, provenance but may also want some sort of role based access or restrictions of certain data to certain audience public blockchains like Ethereum and bitcoin does not fit here.
Now coming toward your question
Why is there an orderer node in HLF isn't it redundant ?
No it's not redundant, HLF has deterministic consensus algorithms where as Ethereum and Bitcoin have probabilistic consensus algorithms which means there can be ledger forks. In HLF there are no Ledger forks because fork occur when two equal participants have conflict at a common point. Incase of HLF the participants are not equal as peers cannot participate in consensus process the block order set by orderers is Final. And rightfully so because for the use cases it is designed for does not want forks and want to have special roles and much much more transaction throughput.
Must must Read !
https://hyperledger-fabric.readthedocs.io/en/release-2.2/orderer/ordering_service.html#what-is-ordering
No it is not possible to assign peers orderer's role you must have at least 1 orderer in your HLF network to work.

Hyperledger Fabric with Raft Protocol: How are transactions packaged into Blocks?

So I do understand the concept of the Raft Protocol.
But I struggle with it in the use case of a Hyperledger Fabric Ordering Service.
What I understand so far:
When a transaction is proposed and endorsed by peers the application forwards it to the ordering service.
The Raft Leader-Node receives this transaction and writes it to his Log then sends it to his Follower-Nodes that also update their Logs.
What I don't understand:
Where and how are the blocks created?
Do all Nodes create a Block and check if a majority has the same?
I read somewhere that a Blockcutter-method is invoked by the Leader and the resulting Block is then proposed to the local Raft Finite State Machine (what is this?).
It's too wasteful to do a consensus round for each transaction. Instead, the Raft leader aggregates several transactions into a batch, and then creates a block from that batch, using a block cutter object.
Then, the Raft leader initiates a consensus round to make the block be replicated to all followers via the Raft protocol.

Use "X509 MSP" and "idemix MSP" at the same time

I am creating an electronic voting software on the Hyperledger Fabric platform and I need some transactions to be carried out by using ecerts "X509 MSP" and other transactions using "idemix MSP". That is, in some transactions, users must be recognized and in other transactions they must not. I thought about doing two different channels, one that uses "X509 MSP" and the other that uses "idemix MSP", is it possible that both channels communicate with each other? Is there any other better option to implement the above?
I am a bit lost if someone were able to direct me to a solution I would appreciate it very much.
So there is a 1-1 mapping between an MSPID and the MSP provider type. But an organization can have course have 1 or more MSPIDs.
So for any given organization "N", you could have OrgNMSP1 use X509 and OrgNMSP2 use Identity Mixer. Both of these can be added to the same channel(s).
A more likely scenario would be to have a single Idemix MSP used by all orgs, but either case will work.

How to handle an event raised in one channel in a different channel in Hyperledger Composer of Fabric?

I have this scenario that a single node is part of different channels. In one channel there are only traders. In the other channel there are traders and regulator. Details of the trades should not be shared with the regulator. The only thing which is being shared is aggregated value at the end of the business day. By aggregated value, we mean how much of each asset is sold, not the detail of each trade. In other words there is confidential information between two parties that cannot be shared with regulator, and there is aggregated value that is not confidential and must be shared with the regulator.
Now I have an event when there is a nomination. By nomination I mean a trade made over some asset in the first channel, the one without regulator. Is it possible to handle this trading event in the other channel where the regulator is?
As I read through the documents, channels are isolated. But how isolated are they? Are they isolated in a way that events raised in one channel cannot be seen or handled in another channel? In that case, how do you suggest to implement this scenario? I mean do you suggest any specific architecture or tools enabling implementation of this scenario? Also do you think Hyperledger Fabric or Composer are suitable for these requirements?
I appreciate any help. Thank you.
So you have two channels, two separate ledgers and two separate business networks (as you've configured it).
Your 'nomination' is, in effect, a 'transaction' as described above. (events in Composer mean, business events that are usually subscribed to by a client application FYI).
In Hyperledger Composer, you can do 'cross-channel' or 'inter business network' queries. So can allow [only] the Regulator (from the 2nd channel) to query [only] those trade 'events' (ie transactions with the fields that contain the 'trade') or indeed assets (updated by the transaction), if need be - back in the '1st' channel (and access controls) in the 2nd channel can restrict the Regulator to do only that 'query' (if that's all he/she is supposed to have jurisdiction to do). Hope this helps.
See example
https://hyperledger.github.io/composer/latest/tutorials/invoke-composer-network

How to maintain provenance in a network while using channels

I am wondering of how to maintain provenance in a network while using channels. In marbles example, lets say Regulator, Manufacturer, country dealer and retailers are transacting on a blockchain network.
Regulator,Manufacturer and dealer are transacting on Channel1 whereas dealer transact with retailer1 on Channel2 and with retailer2 on Channel3, just to keep privacy on selling price for different retailers. As marble1 was originated in Channel1 by the manufacturer , How do the same marble is available in Channel2 or Channel3 for transactions without duplicating the marble and keeping its provenance to Channel1.
I don't know how works the marbles example. However, I think that not all the participants could see all the information and provenance for a marble.
The dealer is in the three channels, so he would be duplicating the info in the three channels. The dealer would has an application that links all the info.
I believe that this issue is more related to the client application.
It is related to client code. A channel cannot send data to other channel due to privacy in fabric. One can implement state of transaction in application code. One way to achieve it through the application code could be to keep id of marble same in all channnels and then run GetHistoryForKey() method on different channel and then accumulate txns in one place in client app to arrive at a solution.

Resources