0056: Service Decorator

Status

Summary

The ~service decorator describes a DID service endpoint inline to a message.

Motivation

This allows messages to self contain endpoint and routing information normally in a DID Document. This comes in handy when DIDs or DID Documents have not been exchanged.

Examples include the Connect Protocol and Challenge Protocols.

The ~service decorator on a message contains the service definition that you might expect to find in a DID Document. These values function the same way.

Tutorial

Usage looks like this, with the contents defined the Service Endpoint section of the DID Spec:

json= { "@type": "somemessagetype", "~service": { "recipientKeys": ["8HH5gYEeNc3z7PYXmd54d4x6qAfCNrqQqEB3nS7Zfu7K"], "routingKeys": ["8HH5gYEeNc3z7PYXmd54d4x6qAfCNrqQqEB3nS7Zfu7K"] "serviceEndpoint": "https://example.com/endpoint" } }

Reference

The contents of the ~service decorator are defined by the Service Endpoint section of the DID Spec.

The decorator should not be used when the message recipient already has a service endpoint.

Drawbacks

The current service block definition is not very compact, and could cause problems when attempting to transfer a message via QR code.

Rationale and alternatives

Prior art

The Connect Protocol had previously included this same information as an attribute of the messages themselves.

Unresolved questions