Closed Zzocker closed 3 years ago
@Zzocker This looks awesome! The only thing I'd change is to make this part of the current Fabric connector by way of introducing it as a signing credential type and it's own endpoint. That way we don't need to duplicate a lot of code between the current Fabric connector and the one being proposed here. I shall help out with the code changes!
@petermetz , yes you are right about creating a another plug-in for this will lead to duplication of code. But I will say, that if we implement it in existence connector, will lead to breaking changes and package version might have to upgraded to 1.x.y.
@Zzocker Pre-1.0 breaking changes can be made between minor releases as well. In general, anything that's 0.x.x as a version is considered unstable (that's why I keep telling everyone that Cactus is not ready yet for production use). TLDR: I'm okay with breaking changes as long as we can complete them before the 1.0 release.
Background
One question that every person designing a HL fabric based solution ask is : What the hack should I do with private key and certificates of clients? . Although
fabric-sdk
provide two different kind of approaches.storing client's private key and certificate together on some database (which implements wallet interface). For this approach a rough flow goes something like this
org's application
server toinvoke
orquery
chaincode using a giveKEY
.org's application
upon receiving the request , it fetchesprivate key
andcertificate
corresponding toKEY
.message
in order to query or invoke chaincode.NOTE : developer of the application has to implement authentication for client's
KEY
store private key in HSM , but in this approach
application
andHSM
have to be present on same physical machine (i.eHSM
should directly be connected withmachine
running the application). This approach is mostly used for developing client's desktop application, which will be responsible for communicating with fabric peers.money pot
for hackers to exploit .org's
application.Now comes the
fabric-secure-connector
which only brings the advantages from both the approaches. Secure Fabric connector provides a solution to the fabric organization for managing their client's private key such that the client's private key is never brought toNode Server
for singing. Currentlyfabric-secure-connector
provide a option of keeping client's private key intoVault Transit Engine
or in browserExtension
(TODO).Broadly this package will support two kind of identity
Another component , is browser
extension
forNOTE : design of extension is TBD
FAQ :
Can this not be implemented in
cactus-plugin-ledger-connector-fabric
?Ans : Can be , but will lead to lot of breaking changes. developer can choose
cactus-plugin-ledger-connector-fabric
for thefirst approach
andfabric-secure-connector
to support multiple type of identity.Is their any use case of it ?
Ans: currently we are trying to implement
vault
andws
identity forblockchain-carbon-accounting
project (under hyperledger labs)Any Blockage that can be faced during the implement
fabric-secure-connector
?Ans : currentlyfabric-sdk-node
support sync singing of message , herebut since forPR mergedIdentity
supported by this package will requiresign
method to be asasync
, so currentfabric-sdk-node
cannot be directly used. To solve this I have already opened a PR tofabric-node-sdk
here . In meanwhile they merge the PR and release version2.2
, I have pushed a npm package of my fork.Where can we find an implementation of it?
Ans: https://github.com/Zzocker/blockchain-carbon-accounting/tree/secureFabric/secure-fabric . this support
vault
identity for now.Thank you
@petermetz @sichen1234 @brioux @knagware9 @udosson
Below are technical details of how I am planning to implement
Top Level exported
class
andinterface