decentralized-identity / ion-sdk

TypeScript SDK for ION
Apache License 2.0
30 stars 14 forks source link

Hashtag in services id validates with error #37

Open sondreb opened 1 year ago

sondreb commented 1 year ago

Attempted to use the id value of '#dwn' in the service entry when creating an DID instance using ion-tools, but it fails with the following error:

Error: IdNotUsingBase64UrlCharacterSet: Key ID '#dwn' is not a Base64URL string.

Was using #dwn as id because that's the example used in the DWN specification.

This bug was reported on ion-sdk, while it was ion-tools that was used, but I think the error is probably related to the SDK?

sondreb commented 1 year ago

If I'm not mistaken, the ION DID node will transform a service ID of dwn into #dwn. So parsing the existing DID Document from ION node needs to remove the hashtags before re-submitting (clientside validation as shown above fails).