简体   繁体   中英

Where does Hyperledger fabric store the public key and private key of the user?

What is the role of pubkey & privkey in fabric network and how are they stored and accessed?

1.In org1.yaml, we have mentioned paths for credentialStore and cryptoStore. what type of files for the user gets stored here? Isn't it the pubkey and privkey of the user stored in cryptoStore? (if true, is it just for the development environment ?)

2.how is privkey accessed in the network for performing a txn? Or how does the user provide the privkey while performing a txn?

  1. It signs the transaction (eg. initiated by an application user, with an associated blockchain identity, issued by his/her org) with its private key and includes its public key in the transaction payload sent to peers and/or orderers. Peers and orderers (part of the Fabric blockchain network) then verify the signatures using the public key in the transaction.

  2. A state/credential store would be used to store the public certificates for enrolled identities that the application needs to use, whereas the crypto store would be used to store the private keys of identities and there are different types of stores available when using the client SDK (eg.FileKeyValueStore, CouchDBKeyValueStore as described here ) - for SDK info and perspective, see https://fabric-sdk-node.github.io/release-1.4/tutorial-network-config.html#Setup-the-stores

  3. In the context of your question summary (user context) and this q3, probably best to understand the context of identity https://hyperledger-fabric.readthedocs.io/en/release-1.4/identity/identity.html and then wallets from the latest Fabric documentation, to consolidate your learning https://hyperledger-fabric.readthedocs.io/en/release-1.4/developapps/wallet.html?highlight=wallet from an application (end) user perspective, this is how they would interact with the ledger & the blockchain network.

From the documentation :

A single wallet can hold multiple identities, each issued by a particular Certificate Authority. Each identity has a standard structure comprising a descriptive label, an X.509 certificate containing a public key, a private key, and some Fabric-specific metadata. 在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM