How to implement B2B Data Transfer Application in MultiChain ?

+2 votes

Hello All,

I do have a use case where shipment details will be shared across 3 companies -(A, B, C).

Can anyone explain how this can be implemented in MultiChain?

"Company A" provides shipment details saying that "Package x" Should go from USA-Mexico.

"Company B" picks the order and says he can deliver it via its local partner which is company 'C'

Now  "Company C" delivers and updates the asset with Proof of delivering info.

 

Usually, in Etherium, we write a Smart Contract with business logic on who can do what and check if company C can do this job.

In Hyperledge, we create a channel for A-B-C and deploy smart contract with this logic.Each company executes smart contract to check their state database and submit transactions and blocks as needed

 

asked Mar 23, 2018 by SharedMocha

2 Answers

0 votes
So MultiChain has a data-centric rather than a state machine or computation-centric model. You wouldn't write a smart contract for this, but rather use a stream to which each of the parties can write, and each can also read in order to see the events relating to the shipment. Presumably each shipment would use a different key in this stream, or you could have one stream for each shipment.
answered Mar 25, 2018 by MultiChain
Is stream like a channel?
Let me explain a business scenario -Say for example "company B" has a need that "field x" should be updated after "field y"-How can we achieve this?In Smart  Contracts, we can build the logic to check.

My other question is -If "Company B" wants to issue payment to "Company C" after a shipment is done-Will "Company B" post a new request in a separate "Stream" where only 'Company C & B" are involved ? Is there a way we can build the logic to create assets in different streams from the current stream i am in and check its status ?
To answer the first question, you would apply this logic when reading the data, only paying attention to "field y" if "field x" is already set.

To answer the second question, if you want completely separate ecosystems in terms of data and assets, you would use different blockchains in MultiChain. That's what "channels" (in the Fabric sense) are.
Let me put an example and pls correct me if you feel its wrong.

As per my understanding-
1.) We create a chain which one (or) many assets and participants.
2.)We then create  "Streams" within that chain.

Now, why do we really need a "Stream" when we can directly use the "Chain" to send, receive, update assets? What advantage does streams give?

In my example can't I have one chain with 3 participants that keep on creating assets like (Shipment item1, Shipment item2) and update them ?
0 votes

This capability has already been built into the GM-X ERP application (see https://geoprise.com/content/gm-x-blockchain for details). We do not use smart contracts, only the sending of data between nodes using streams. If we have a Buyer and a number of Sellers we can generate a RFQ (Request for Quotation) at the Buyer's node, then send this to selected Sellers. Each Seller can then send in a Quotation to the Buyer. The Buyer reviews all these Quotations, chooses one, then sends a Purchase Order to that Seller. The Seller completes the order, then sends an ASN (Advance Shipment Notification) to the Buyer which is used to generate the Shipment when the goods arrive.

This procedure is exactly the same as sending data between nodes via web services, but it uses a blockchain instead.

answered Mar 27, 2018 by Tony Marston
Thanks Tony.
But can you pls explain why i should use streams? I can directly create assets on a chain itself without the need of streams, right?
As per my understanding Streams are part of chains.
How much data can you send with an asset? An asset is a single object whereas a stream can contain data (up to 64MB) on many objects. You cannot use assets to send RFQs, quotations, purchase orders or shipments.

You can use a blockchain for any combination of smart contracts, assets or streams. We use streams as that is the only way to send XML documents between nodes. So instead of sending XML documents via web services we are using a blockchain, which is more secure and which has a tamper-proof history.
...