Skip to content

'allow_multiple` allows returning multiple CredentialItems but the current response structure doesn't support this #70

Open

Description

@GarethCOliver

Current response structure is

CredentialRef => CredentialItem

rather than CredentialRef => [+CredentialItem]

which is needed allow for multiple credentials to be returned for a particular CredentialQuery

Activity

  1. martijnharing commented on Oct 8, 2026

    @martijnharing
    Collaborator

    Looking at the current structureI think the problem is actually a bit bigger.

    In the response there is the following structure:

    Envelope = {
      credentials:    1 => { + CredentialRef => CredentialItem },
      scenarios:      2 => { + ScenarioRef   => [ + CredentialRef ] } ,
    }
    

    Assuming that the ScenarioRef and CredentialRef refer to the corresponding identifiers in the request (which is implied, but not actually said). While this works for the ScenarioRef, it has issues for the CredentialRef. Not only because of the issue you mentioned, but also in the case where a single CredentialItem is a response to multiple CredentielQueries.
    Your solution works for the case of allow_multiple, but I think we should probably also fix the other case.

    Some possible solutions:

    Option 1

    Each CredentialItem has an array that describes which CredentialQuery it's an answer to.
    For each scenario, reference all the credentialItems that are relevant.

    This would look like:

    Envelope = {
      credentials:  1 => [ + CredentialItem ],
      scenarios:    2 => { + ScenarioRef => [ + credentialsIndex ] },
    }
    
    ItemIndex = uint 
    
    CredentialItem = {
      format:          1 => tstr,
      data:            2 => Document / ZkDocument / SdJwtData,
      credential_refs: 3 => [ + CredentialRef ], 
    }
    

    option 2

    Each CredentialItem has an array that describes which credentialQuery its an answer to
    Each Scenario references the credentialQueries that are relevant

    This would look like:

    Envelope = {
      credentials:  1 => [ + CredentialItem ],
      scenarios:    2 => { + ScenarioRef => [ + CredentialRef ] },
    }
    
    CredentialItem = {
      format:          1 => tstr,
      data:            2 => Document / ZkDocument / SdJwtData,
      credential_refs: 3 => [ + CredentialRef ],   ; queries this item satisfies
    }
    

    option3
    Each credentialItem has an array which describes which CredentialQuery and which Scenario it's an answer to

    This would look like:

    Envelope = {
      credentials:  1 => [ + CredentialItem ],
    }
    
    CredentialItem = {
      format:          1 => tstr,
      data:            2 => Document / ZkDocument / SdJwtData,
      credential_refs: 3 => [ + CredentialRef ], 
      scenario_refs:   4 => [ + ScenarioRef ],  
    }
    

    I think I have a slight preference for option 2.

  2. martijnharing commented on Oct 8, 2026

    @martijnharing
    Collaborator

    So I made this comment before reading #69 , I propose continuing the discussion there and check if it also addresses the issue mentioned here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions