Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration with Hyperledger Fabric #24

Open
amiller opened this issue Aug 24, 2018 · 7 comments
Open

Integration with Hyperledger Fabric #24

amiller opened this issue Aug 24, 2018 · 7 comments
Assignees
Labels
applications Applications for HBMPC benchmarking Requires benchmarking in order to measure performance/overheads/optimizations hyperledger integration leading issue: #24
Milestone

Comments

@amiller
Copy link
Contributor

amiller commented Aug 24, 2018

We need to commit to a plan for demonstrating the offline phase and online phase with an integration using hyperledger fabric.

@amiller amiller added this to the Offline Phase milestone Aug 24, 2018
@amiller amiller added applications Applications for HBMPC benchmarking Requires benchmarking in order to measure performance/overheads/optimizations labels Aug 24, 2018
@amiller
Copy link
Contributor Author

amiller commented Aug 30, 2018

A rough shot at a next steps TODO list based on conversation w/ sylvain:

  • Docker image that builds fabric and honeybadgermpc dependencies
  • Identify a suitable "snip" point in Hyperledger Fabric endorser code, that lets endorsers communicate with the hbmpc application before approving a transaction. This should be at the endorser, roughly in between when it receives a transaction and when it signs it. Essentially the mpc will act like a "pre-ordering" service
  • Extend the fabric chaincode configuration file to include instructions for hbmpc to connect to endorsers. The main idea for a fabric integration will be to have the endorsers in a private chaincode deployment play the role of nodes in the MPC protocol. Fabric already provides a way to configure a set of endorsers which do not have communication requirements, so we will piggy-back on top of that.
    This will require forming point-to-point socket connections, to be taken care of from within the hbmpc application (the configuration file may just specify hostname, port, and authentication info)
  • Clients submitting secret shared input. The idea will be for the client to send a private payload by initiating an instance of AVSS. We should try to use existing channels for client <--> endorser communication. Since the AVSS protocol is non-interactive for the dealer, the client should simply invoke an hbmpc script to generate a single message of the inputs. This is provided as private payload submitted along the transaction to each endorser.
    Given a transaction T, and payload shares S[1],...,S[N], the client sends (T,S[i]) to endorser i. The secret shares are imported in hbmpc using the AVSS protocol, and associated with the transaction hash.
    When the transaction is (pre)-committed, the secret shared data is written to a key value store, T.id => [S]
  • Initiating MPC computations. We'd like to use the chaincode to determine when to initiate a MPC computation. Initiating an MPC computation can include identifying which secret shared values to include as inputs (by their designated keys). MPC computations may take as input data from multiple parties, in which case the different inputs are referred to using the transaction IDs that provided them. The effect of the MPC is to write new values to the key-value store.
  • Providing output. The output of an MPC computation can be either public, or transmitted to a client. If transmitted to a client, the client must request it from an endorser.

@amiller
Copy link
Contributor Author

amiller commented Sep 3, 2018

The following are suggestions from Angelo of where to start this:
https://hyperledger-fabric.readthedocs.io/en/release-1.2/systemchaincode.html
https://hyperledger-fabric.readthedocs.io/en/release-1.2/chaincode4noah.html
https://stackoverflow.com/questions/47134059/what-is-system-chaincode-in-fabric

A System Chaincode in fabric is what allows access to the underlying host, not just a container. This is where would want to patch in the ability to execute the Python hbmpc as a separate process with subprocess

fabric/core/scc - this folder contains all the available system chaincodes
and the infrastructure to manage them. Look also at peer/node/start.go:611
to understand how the built-in SCC are instantiated.

@amiller amiller removed this from the Offline Phase milestone Sep 6, 2018
@sbellem
Copy link
Collaborator

sbellem commented Sep 7, 2018

Endorsement and validation is no longer under fabric/core/scc:

The former system chaincodes for endorsement and validation have been replaced by the pluggable endorsement and validation function as described by the Pluggable transaction endorsement and validation documentation.

The docs were outdated and just got updated very recently.

@sbellem
Copy link
Collaborator

sbellem commented Sep 11, 2018

@amiller @smkuls I have marked the docker image task as done, although we will probably make improvements and/or adjustments as the integration moves forward. I think it is good to get going right now though and that we can move to the other tasks. More details about the docker-based setup can be found in #52, more notably in #52 (comment) under the Foreseeable possibe improvements/adjustments paragraph.

@sbellem sbellem added the hyperledger integration leading issue: #24 label Sep 13, 2018
@smkuls smkuls removed their assignment Nov 11, 2018
@smkuls smkuls assigned sbellem and hybridNeo and unassigned sbellem Feb 28, 2019
@amiller
Copy link
Contributor Author

amiller commented Apr 19, 2019

This is largely completed by @hybridNeo in separate repos https://github.com/hybridNeo/honeybadgerscc
Can you summarize in this issue what you did and talk about how we can merge it into this codebase so that we can continue on with it? Or how we can keep building on our separate fork of fabric?

@amiller
Copy link
Contributor Author

amiller commented May 19, 2019

@hybridNeo ping, please post somewhere a README or instructions on how we can run your RPS demo
This repository is relevant but does not contain relevant instructions https://github.com/initc3/fabric

@amiller amiller added this to the 0.1 (alpha) milestone May 19, 2019
@amiller amiller changed the title Integration with Hyperledger Integration with Hyperledger Fabric May 24, 2019
@amiller
Copy link
Contributor Author

amiller commented May 24, 2019

I think some other related repositories are:

@amiller amiller modified the milestones: 0.1 (alpha), 1.0 (beta) Jun 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
applications Applications for HBMPC benchmarking Requires benchmarking in order to measure performance/overheads/optimizations hyperledger integration leading issue: #24
Projects
None yet
Development

No branches or pull requests

4 participants