Skip to content

Link to external file content from metadata #50

@matheus23

Description

@matheus23

Goal: Solve issues raised in discussions #18 and #49.
The use case is a file system that supports more than just a single byte array as a file's data. E.g. storing thumbnails of images.

On the public file system this can be supported with adding CIDs that point to more (unixfs) data into metadata, but on the private file system this doesn't work as expected: The CID isn't "discoverable", it needs to be added to the private forest to be syncable. It also needs to be encrypted.

Thus the need for linking to external encrypted bytes from the metadata.

This would be pretty much supporting the same type that .content supports, but within metadata.
For the private side that means that metadata may include content that looks like this:

type ExternalContent = {
  key: Key
  blockSize: Uint64 // in bytes, at max 262132
  blockCount: Uint64
}

For example, this could be a file's metadata (here represented as JSON) with a link to some thumbnail:

{
  "createdAt": 9999999,
  "modifiedAt": 9999999,
  "thumbnail": {
      "key": "<bytes>",
      "blockSize": 262132,
      "blockCount": 3
  }
}

We should also specify that implementations support operations like read_metadata_linked(file, metadataKey: string): Bytes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions