Issue
According to the DID Nostr specification:
Relay URLs at the origin level MUST include a trailing slash (e.g., wss://relay.example.com/).
Currently, the resolver outputs relay URLs without trailing slashes:
{
"id": "did:nostr:...#1",
"type": "Relay",
"serviceEndpoint": "wss://relay.damus.io"
}
Expected
{
"id": "did:nostr:...#1",
"type": "Relay",
"serviceEndpoint": "wss://relay.damus.io/"
}
Suggested Fix
When constructing the service array, append a trailing slash to relay URLs if not already present:
const relayUrl = url.endsWith('/') ? url : url + '/';
This ensures compliance with the DID Nostr specification's MUST requirement for relay service endpoints.