When registering a did through the IndySdkIndyDidRegistrar it is currently not possible to let the transaction be endorsed by another party. We should support this flow.
For the IndySdkIndyDidRegistrar we can leverage the did registration interface jobs to make the did registration a multi-step process.
First we create the did, then the did registrar will return a state of action with the signed request by the transaction author. Then the user of the framework will need to send the request to the endorser (out of scope how this happens for now). The endorser can then sign the transaction (need to add an api for this), and send it back to the author.
Reason for making this a manual process is that I would like to keep the did module as much separated from didcomm as possible. We could later then add the transaction endorser protocol as one way to request endorsement.
An (oversimplified) code example:
// agentA
// agentB
const { didState, jobId } = await agentA.dids.create({
method: 'indy'
})
const endorsedTransaction = await agentB.modules.indyVdr.endorseTransaction({
transaction: didState.transaction
})
const { didState } = await agentA.dids.create({
method: 'indy',
// pass jobId to continue previous process instead of creating new one
jobId,
options: {
endorsedTransaction
}
})
// Did is registered, hooray!
const didDocument = didState.didDocument
Todo
[ ] In the indy vdr did registrar, when we pass createTransactionForEndorser( and endorserDid MUST also be provided ), we want to create the did registration transaction, but we don't want to sign and submit it to the ledger. Instead we create the transaction, set the endorser on the transaction and return it in the didState object with a state of action. We also return a jobId, which could as simple as the ${did}-create
[ ] In the indy vdr did registrar, when it is called with a jobId, we check whether the request is valid (not sure what to check right now??) and then we submit the transaction to the ledger (and store the DidRecord, basically complete the flow until state finished, which is already implemented.)
When registering a did through the IndySdkIndyDidRegistrar it is currently not possible to let the transaction be endorsed by another party. We should support this flow.
For the IndySdkIndyDidRegistrar we can leverage the did registration interface jobs to make the did registration a multi-step process.
First we create the did, then the did registrar will return a state of
action
with the signed request by the transaction author. Then the user of the framework will need to send the request to the endorser (out of scope how this happens for now). The endorser can then sign the transaction (need to add an api for this), and send it back to the author.Reason for making this a manual process is that I would like to keep the did module as much separated from didcomm as possible. We could later then add the transaction endorser protocol as one way to request endorsement.
An (oversimplified) code example:
Todo
createTransactionForEndorser
( andendorserDid
MUST also be provided ), we want to create the did registration transaction, but we don't want to sign and submit it to the ledger. Instead we create the transaction, set the endorser on the transaction and return it in thedidState
object with a state ofaction
. We also return ajobId
, which could as simple as the${did}-create
NymRequest
(https://github.com/hyperledger/indy-vdr/blob/main/wrappers/javascript/indy-vdr-shared/src/builder/NymRequest.ts)setEndorser
(https://github.com/hyperledger/indy-vdr/blob/main/wrappers/javascript/indy-vdr-shared/src/indyVdr/IndyVdrRequest.ts#L47-L53)IndyVdrApi
class that exposes anendorseTransaction
method that takes a signed transaction, and will put a signature on top of it.setMultiSignature
(https://github.com/hyperledger/indy-vdr/blob/main/wrappers/javascript/indy-vdr-shared/src/indyVdr/IndyVdrRequest.ts#L47-L53) and sign it with the wallet.Resources: