decentralized-identity / confidential-storage

Confidential Storage Specification and Implementation
https://identity.foundation/confidential-storage/
Apache License 2.0
79 stars 23 forks source link

Specify how object IDs are included in responses #8

Closed alundeen closed 4 years ago

alundeen commented 6 years ago

At the moment it's not clear how a response would include object IDs or other metadata for the returned objects. It might make sense to mirror the meta and data fields of the request payload for each object to provide relevant metadata, e.g:

{
  "@type": "Collections/Response",
  response: {
    requestHash: HASH_OF_REQUEST
  },
  payload: [{
    meta: {
      id: "abc123"
    },
    data: {
      "@context": "http://schema.org/",
      "@type": "MusicPlaylist",
      description: "The best rock of the 60s, 70s, and 80s",
      tracks: [...]
    }
  }, {
    meta: {
      id: "def456"
    },
    data: {
      "@context": "http://schema.org/",
      "@type": "MusicPlaylist",
      description: "Jazz favorites",
      tracks: [...]
    }
  }]
}
csuwildcat commented 6 years ago

I think this is the best direction. It does open the issue of how IDs are assigned. My thinking was that the ID would be the hash of the object, but in order to allow for duplicate objects, there would have to be a deterministic mechanism to generate a unique ID even when objects hash to the same value.

tplooker commented 4 years ago

Resolved on 07/05/2020 call