What's the best way to get a Canton participant's fingerprint/namespace?

When you allocate a party in Canton, it returns as partyName::fingerprint. As an actor outside of the participant, I’d like to figure out the participant’s fingerprint so I can know, prior to allocation, what my party’s name will be. Is that possible?

The best option I’m aware of is to query the participant id and use the namespace from that, e.g., see this grpcurl session:

moritz@right-adjunct ~/foobar> grpcurl -plaintext localhost:6865 com.daml.ledger.api.v1.admin.PartyManagementService/GetParticipantId
{
  "participant_id": "sandbox::1220ac922ccc5e275ccc65d61b37e4f31897f7504b7bf9a0d204956dc6798a682889"
}
moritz@right-adjunct ~/foobar [1]> grpcurl -plaintext -d '{"party_id_hint": "alice"}' localhost:6865 com.daml.ledger.api.v1.admin.PartyManagementService/AllocateParty
{
  "party_details": {
    "party": "alice::1220ac922ccc5e275ccc65d61b37e4f31897f7504b7bf9a0d204956dc6798a682889",
    "is_local": true
  }
}

You can guess this if you like, but the ledger API doesn’t permit you to make this assumption; the produced party ID “is implementation-specific”.

I don’t know whether Canton provides stricter guarantees, if you intend for your allocator to only work with Canton.

1 Like

+1 to this!

Regardless, Canton could decide to change this between versions, so only Ledger API guarantees should be taken as such. I think the way to think of party IDs is as opaque handles, which is what they are as per Ledger API.