Recovering a DID from a seed


#1

After generating a DID, ver and signing key from a seed, it is stored in my wallet.

How do I retrieve that particular DID from the seed?
I can get the VerKey from the seed, but not the DID

Calling create and store my did with a seed where the did already exists returns only the error.

thanks


#2

Once you use a seed, ideally you should never need it again. The exception is if you need to put it in a different wallet, or your wallet becomes corrupted and there is no backup, or something similar. This is because everything you may need is stored in your wallet: the DID, the verkey, and the private key. When you later return and want to use these keys, you tell libindy which DID you want to use, and it signs using the corresponding private key that it gets from the wallet. So the DID is what you need to remember. In this example, a credential definition is being written to the ledger, after a pool and wallet have been opened, and a DID which is already in the wallet is specified.

   result = await ledger.sign_and_submit_request(pool_handle, wallet_handle, did, cred_def_request)

#3

Yes I understand that, but then I need some kind of light database that I can use to keep track of DIDs, that you look up using matadata.
I am sure that there will be a great accumulation of DIDs within the wallet, which might be troublesome if I loose context and even access to the wallet and need recovery (another topic all together)


#4

The wallet has a tagging interface that you can use to index items (including DIDs or any other blob) in an arbitrary way, if that is helpful to your use case. See https://github.com/hyperledger/indy-hipe/tree/master/text/0013-wallets#tags-and-queries


#5

perfect, just what I am looking for.

Thanks