Sharan Raj
Sharan Raj

Reputation: 13

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?

Upvotes: 1

Views: 1877

Answers (2)

Badr Bellaj
Badr Bellaj

Reputation: 12821

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 user either it is an application that signs transaction on behalf of end-users by using their wallet file (containing private key) or the users can communicate with the network using a peer/peer-cli by using the key held by the peer (exp on fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/users/[email protected]/msp/keystore/c5b57e49f017cd9a66114e1ce1b405da38c1895f45de9frb4bf9a6c55ea45frfrd8ba_sk) enter image description here

Upvotes: 0

Paul O'Mahony
Paul O'Mahony

Reputation: 6740

  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.

Upvotes: 1

Related Questions