keria icon indicating copy to clipboard operation
keria copied to clipboard

IPEX Grant for multisig identifiers should use IpexGrantCollectionEnd.sendMultisigExn, not ExchangeCollectionEnd.on_post

Open kentbull opened this issue 7 months ago • 3 comments

SignifyTS does not call IpexGrantCollectionEnd.sendMultisigExn for sending the /multisig/exn messages following sending out the /ipex/grant message for multisig and instead uses ExchangeCollectionEnd.on_post for this purpose. Why is this the case? It would seem that if we have the IpexGrantCollectionEnd.sendMultisigExn code we would use it.

We should use the code dedicated for multisig IPEX grants by changing SignifyTS to use the IpexGrantCollectionEnd.sendMultisigExn via the /identifiers/{name}/ipex/grant rather than ExchangeCollectionEnd.on_post at the /identifiers/{name}/exchanges endpoint.

kentbull avatar May 27 '25 21:05 kentbull

It's the same HTTP endpoint, so it's up to the client using Signify to decide whether to pass the /multisig/exn exn to submitGrant or pass the /ipex/grant exn and send the /multisig/exn manually using the exchanges endpoint.

We're using sendMultisigExn in Veridian, but the Signify tests use the other way. The problem with sendMultisigExn is there's now multiple ways to do it with more chance of bugs, but it does avoid having multiple HTTP calls.

iFergal avatar May 27 '25 21:05 iFergal

It's the same HTTP endpoint

It's not the same HTTP endpoint. See here in ipexing.py:

def loadEnds(app):
    admitColEnd = IpexAdmitCollectionEnd()
    app.add_route("/identifiers/{name}/ipex/admit", admitColEnd)  # <-- This endpoint is different from the one below.
    grantColEnd = IpexGrantCollectionEnd()
    ...

and this code from exchanging.py:

def loadEnds(app):
    exnColEnd = ExchangeCollectionEnd()
    app.add_route("/identifiers/{name}/exchanges", exnColEnd)
    ...

They are two different API endpoints that have similar yet slightly different behavior in KERIA.

it does avoid having multiple HTTP calls.

It's pretty much the same request whether to one endpoint or the other, it's just that sendMultisigExn is geared specifically toward IPEX Grant.

kentbull avatar May 27 '25 22:05 kentbull

What I meant is /identifiers/{name}/ipex/grant is one HTTP endpoint that has a switch statement to decide whether to use sendGrant or sendMultisigExn based on what exn message it receives from Signify. And if you pass /multisig/exn, you can skip using /identifiers/{name}/exchanges.

It's up to the user of Signify to decide which to pass - e.g. here I pass /multisig/exn. Nothing changes in Signify, except maybe the integration tests if you wanted to showcase this.

It's pretty much the same request whether to one endpoint or the other, it's just that sendMultisigExn is geared specifically toward IPEX Grant.

It's either:

  1. Send /multisig/exn to /identifiers/{name}/ipex/grant a. This will do both functions in one go. So you are saving 1 HTTP call.
  2. Send /ipex/grant to /identifiers/{name}/ipex/grant and /multisig/exn to /identifiers/{name}/exchanges

It's not:

  • Send /ipex/grant to /identifiers/{name}/ipex/grant and /multisig/exn to /identifiers/{name}/ipex/grant

iFergal avatar May 28 '25 07:05 iFergal