impierce / openid4vc

Rust implementation of the OpenID4VC standards. The library will offer implementations for SIOPv2, OpenID4VP and OpenID4VCI.
https://www.impierce.com
Apache License 2.0
28 stars 3 forks source link

Allow for `DidMethod`'s with partitioned namespaces #72

Closed nanderstabel closed 5 months ago

nanderstabel commented 6 months ago

Description

Currently DidMethod only supports for the actual DID method part as described in the W3C Did specification, which means that "did:example:123" is an invalid DidMethod, but "did:example" is a valid DidMethod.

This indeed is on par with what's described in the SIOPv2 specification:

When Subject Syntax Type is Decentralized Identifier, valid values MUST be a did: prefix followed by a supported DID method without a : suffix. For example, support for the DID method with a method-name "example" would be represented by did:example.

The problem however is that some DID methods may have some sort of logic that supports some sort of 'sub-method'. More specifically, the did:iota supports multiple networks and their corresponding identifiers are prefixed by either:

In the W3c spec, the following is described about using colons in the method-specific-id part of a DID:

Note: Colons in method-specific-id

The meaning of colons in the method-specific-id is entirely method-specific. Colons might be used by DID methods for establishing hierarchically partitioned namespaces, for identifying specific instances or parts of the verifiable data registry, or for other purposes. Implementers are advised to avoid assuming any meanings or behaviors associated with a colon that are generically applicable to all DID methods.

So that means SIOPv2 is limiting a bit since it only allows a SIOP Provider to add did:iota to their metadata, even though in reality it may only be supporting did:iota:smr for example.

Motivation

Therefore we need to 'loosen' the strictness of DidMethod a bit so that it will accept did:iota:smr as a valid DidMethod with a namespace.

This will make oid4vc more interoperable with DID methods that have specific functionalities regarding namespaces.

Resources

To-do List