decentralized-identity / did-key.rs

Rust implementation of the did:key method
Apache License 2.0
47 stars 24 forks source link

Implement support for signed-ietf-json-patch #8

Closed tmarkovski closed 2 years ago

tmarkovski commented 3 years ago

As described here https://github.com/decentralized-identity/did-spec-extensions/blob/master/parameters/signed-ietf-json-patch.md

Objective

The key DID method is designed as deterministic key resolution that resolves into a fixed DID document. The identifier of the DID method is fingerprint of the public part of the key pair; as such it doesn't now provide registration for additional fields in the DID document. RFC 6902 defines a mechanic that can be applied to a JSON object to patch the document which can be used to extend the DID document. The Signed IETF JSON Patch DID Extension describes how this can be utilized in a DID Document by allowing the DID URI to extend it's document with signed data.

Implementation

This implementation should ensure that the API can be extended with the JSON Patch operations by taking an input of (operation, path, json) and producing a result that contains the DID URI of the key in question with the signedIetfJsonPatch URL parameter and it's value. The reverse operation for resolving this URL would resolve the DID document with the patched JSON. The library should perform all needed validations to ensure that the controller is the original signer of the patched data.

Test Vectors

TODO

Breaking Changes

None expected, but there may be changes in API and DID Document structs that will impact current implementations.

Related Issues

https://github.com/transmute-industries/did-key.js/issues/72

https://github.com/w3c-ccg/did-method-key/issues/17