decentralized-identity / ethr-did-resolver

DID resolver for Ethereum Addresses with support for key management
Apache License 2.0
210 stars 76 forks source link

[feature] add encryption key support to DID documents #52

Closed mirceanis closed 4 years ago

mirceanis commented 4 years ago

Problem

This DID resolver uses attribute names in the ERC1056 contract to compose the DID document. The attributes must follow a particular format to be counted during document resolution. did/pub/(Secp256k1|RSA|Ed25519)/(veriKey|sigAuth)/(hex|base64) (Essentially did/pub/<key algorithm>/<key purpose>/<encoding>)

These algorithms and key purposes only cover signing and verifying signatures, not encryption.

Proposal

I propose extending this support to the following did/pub/(Secp256k1|RSA|Ed25519|X25519)/(veriKey|sigAuth|enc)/(hex|base64) adding X25519 key algorithm and enc key purpose.

Example

A DIDAttributeChanged event for the identity 0xf3beac30c498d9e26865f34fcaa57dbb935b0d74 with the name did/pub/X25519/enc/base64 and the value of 0x302a300506032b656e032100118557777ffb078774371a52b00fed75561dcf975e61c47553e664a617661052 generates a PublicKey entry like this:

{
  id: "did:ethr:0xf3beac30c498d9e26865f34fcaa57dbb935b0d74#delegate-1",
  type: "X25519KeyAgreementKey2019",
  owner: "did:ethr:0xf3beac30c498d9e26865f34fcaa57dbb935b0d74",
  publicKeyBase64: "MCowBQYDK2VuAyEAEYVXd3/7B4d0NxpSsA/tdVYdz5deYcR1U+ZkphdmEFI="
}
uport-automation-bot commented 4 years ago

:tada: This issue has been resolved in version 2.2.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

uport-automation-bot commented 4 years ago

:tada: This issue has been resolved in version 2.3.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: