decentralized-identity / sidetree

Sidetree Specification and Reference Implementation
https://identity.foundation/sidetree/spec
Apache License 2.0
438 stars 112 forks source link

DID document ID when resolved with initial state #777

Closed troyronda closed 4 years ago

troyronda commented 4 years ago

The reference implementation currently returns a resolution result (example):

{
  '@context': 'https://www.w3.org/ns/did-resolution/v1',
  didDocument: {
    id: 'did:sidetree:EiAGKGgSjFsbGS8dvnZzsK3NqtMGnuxuj6h5O0KDT49jQg?-sidetree-initial-state=eyJkZWx0YV9oYXNoIjoiRWlCU09rbFh0LUMzakZPcWVLcDZCMG92eGd2THotOW9fOHlHeF9kRW9TR05PQSIsInJlY292ZXJ5X2NvbW1pdG1lbnQiOiJFaUJRNEExVkt3aVNkUmVtVFFRREZsVVE3T1NZRm9NWi1ia2JxalhJM09fYl93In0.eyJ1cGRhdGVfY29tbWl0bWVudCI6IkVpRHgtRF9ISXlTdF80NmhpWWRJUW1WYV9mcVU3WlZJQV9seUtvREhNX20wX1EiLCJwYXRjaGVzIjpbeyJhY3Rpb24iOiJyZXBsYWNlIiwiZG9jdW1lbnQiOnsicHVibGljX2tleXMiOlt7ImlkIjoic2lnbmluZ0tleSIsInR5cGUiOiJFY2RzYVNlY3AyNTZrMVZlcmlmaWNhdGlvbktleTIwMTkiLCJqd2siOnsia3R5IjoiRUMiLCJjcnYiOiJzZWNwMjU2azEiLCJ4IjoiU2U5ZHJIR0UxbHNQYzl6aGNQRlZ3UjAtSG9xbGI1bUdTTXlIUDBEZkwzQSIsInkiOiJpZk9rQm9wWlhKLTFSRjlpVlR1d3BEcE8ycm5fQ1RENEdHeU4xRkIzT1YwIn0sInB1cnBvc2UiOlsiYXV0aCIsImdlbmVyYWwiXX1dLCJzZXJ2aWNlX2VuZHBvaW50cyI6W3siaWQiOiJzZXJ2aWNlRW5kcG9pbnRJZDEyMyIsInR5cGUiOiJzb21lVHlwZSIsImVuZHBvaW50IjoiaHR0cHM6Ly93d3cudXJsLmNvbSJ9XX19XX0',
    '@context': [ 'https://www.w3.org/ns/did/v1', [Object] ],
    service: [ [Object] ],
    publicKey: [ [Object] ],
    authentication: [ '#signingKey' ]
  },
  methodMetadata: {
    recoveryCommitment: 'EiBQ4A1VKwiSdRemTQQDFlUQ7OSYFoMZ-bkbqjXI3O_b_w',
    updateCommitment: 'EiDx-D_HIySt_46hiYdIQmVa_fqU7ZVIA_lyKoDHM_m0_Q'
  }
}
troyronda commented 4 years ago

See

id: did:sidetree:EiAGKGgSjFsbGS8dvnZzsK3NqtMGnuxuj6h5O0KDT49jQg?-sidetree-initial-state=eyJkZWx0YV9oYXNoIjoiRWlCU09rbFh0LUMzakZPcWVLcDZCMG92eGd2THotOW9fOHlHeF9kRW9TR05PQSIsInJlY292ZXJ5X2NvbW1pdG1lbnQiOiJFaUJRNEExVkt3aVNkUmVtVFFRREZsVVE3T1NZRm9NWi1ia2JxalhJM09fYl93In0.eyJ1cGRhdGVfY29tbWl0bWVudCI6IkVpRHgtRF9ISXlTdF80NmhpWWRJUW1WYV9mcVU3WlZJQV9seUtvREhNX20wX1EiLCJwYXRjaGVzIjpbeyJhY3Rpb24iOiJyZXBsYWNlIiwiZG9jdW1lbnQiOnsicHVibGljX2tleXMiOlt7ImlkIjoic2lnbmluZ0tleSIsInR5cGUiOiJFY2RzYVNlY3AyNTZrMVZlcmlmaWNhdGlvbktleTIwMTkiLCJqd2siOnsia3R5IjoiRUMiLCJjcnYiOiJzZWNwMjU2azEiLCJ4IjoiU2U5ZHJIR0UxbHNQYzl6aGNQRlZ3UjAtSG9xbGI1bUdTTXlIUDBEZkwzQSIsInkiOiJpZk9rQm9wWlhKLTFSRjlpVlR1d3BEcE8ycm5fQ1RENEdHeU4xRkIzT1YwIn0sInB1cnBvc2UiOlsiYXV0aCIsImdlbmVyYWwiXX1dLCJzZXJ2aWNlX2VuZHBvaW50cyI6W3siaWQiOiJzZXJ2aWNlRW5kcG9pbnRJZDEyMyIsInR5cGUiOiJzb21lVHlwZSIsImVuZHBvaW50IjoiaHR0cHM6Ly93d3cudXJsLmNvbSJ9XX19XX0',
OR13 commented 4 years ago

Please comment on https://github.com/w3c/did-core/issues/337

csuwildcat commented 4 years ago

This is intentional, because if you are using an unachored DID and only include the short-form suffix of the ID in your resulting DID Document, there is a good chance a counter party could end up including the ID in a credential or other form of data that would subsequently be unresolvable, given it doesn't contain the long-form data. The Sidetree reference and ION return a DID Doc with the short-form ID when it detects an ID is anchored.

csuwildcat commented 4 years ago

With the move to a fully qualified DID URI for long-form, this is no longer applicable.