did-extensions icon indicating copy to clipboard operation
did-extensions copied to clipboard

Proposed DID document metadata property: network

Open peacekeeper opened this issue 9 months ago • 3 comments

Some DID methods have the concept of a "network", for example "mainnet", "testnet", "staging", etc. This may sometimes be encoded in the DID itself and separated by ":" characters, e.g.:

did:example:network:123456789abcdefghi

There are also DID methods which encode a "network" in a different way as part of the identifier, or not encode it in the identifier itself at all, but still recognize the concept of a "network".

In all those cases, it could be useful to define a reusable DID document metadata property which returns the "network" as part of DID Resolution e.g.:

{
	"@context": "https://w3id.org/did-resolution/v1",
	"didDocument": {
		"@context": "https://www.w3.org/ns/did/v1",
		"id": "did:example:network:123456789abcdefghi",
		...
	},
	"didResolutionMetadata": {
		"contentType": "application/did"
	},
	"didDocumentMetadata": {
          "network": "testnet"
	}
}

peacekeeper avatar Mar 22 '25 17:03 peacekeeper

This proposal was motivated by a discussion in the DID Resolution repo: https://github.com/w3c/did-resolution/issues/52

peacekeeper avatar Mar 22 '25 17:03 peacekeeper

I am implementing this right now. A question I have is how to control the acceptable set of strings for a network. Right now it seems that a registry is the best option. But how could that be implemented?

melvincarvalho avatar Apr 13 '25 10:04 melvincarvalho

@melvincarvalho I think this would be method-specific, i.e. it's up to you how you want to manage and govern the possible values for this property in your DID method.

peacekeeper avatar Apr 14 '25 11:04 peacekeeper