ceramicnetwork / CIPs

The Ceramic Improvement Proposal repository
https://cips.ceramic.network/
MIT License
82 stars 22 forks source link

Collections Index #26

Closed michaelsena closed 4 years ago

michaelsena commented 4 years ago
cip: 16
title: Collections Index
author: Michael Sena (@michaelsena), Joel Thorstensson (@oed)
status: Draft
category: Standards
type: RFC
created: 2020-05-23
requires: Tile Doctype (CIP-8), DocId to DocId Map (CIP-27)

Simple Summary

Collections Index is a document that stores a list of a DID's data collections.

Abstract

Collections Index provides a single place to associate various data collections to a DID. Individual collections can reference data that exists in a number of places from centralized servers (databases), to decentralized networks (i.e. Ceramic, Filecoin, Arweave, Textile, 3Box, Blockchains) and are usually used to represent user data created by an application or provided by some external data provider (i.e. reputation or scoring systems), but can be used for other purposes as well. By providing a unified location and standard interface for building these associations, the Collections Index can serve to provide a DID-centric data routing system that makes user data portable across platforms.

Collections Index is a subdirectory of the Identity Index (IDX) (CIP-11) and is often linked from the Root Index (CIP-12).

Motivation

Application developers will choose to store user data in a variety of places from decentralized networks to centrally hosted servers. However to realize the vision of a user-centric web where user data is portable across applications and interfaces, there needs to be a solution to cross-application data discoverability, routing, and interpretation. A third-party application needs to know which data is associated to the user, the shape or form of the data, and where to find it.

As a solution to this problem, the Collections Index aims to provide:

Specification

The Collections Index specification consists of a doctype, schema, and tags.

Collections Index Diagram

Doctype

Collections Index is a Tile Doctype (CIP-8).

Schema

The Collections Index utilizes the DocId to DocId Map (CIP-27) schema, which simply stores a list of DocIds which map to other DocIds. A reference to this schema should be included in your Collections Index document when it is created.

For the Collections Index, the first DocId should be the DocId of a Collection Definition (CIP-28), which defines the collection as a set of data store types with specific schemas. (Since this document is usually owned by an application developer it also provides context as to the origin of the data.) The second DocId should be the DocId of a Collection Reference (CIP-29), which describes user-specific information about a given Collection Definition, such as unique store addresses, locations/hosts, etc.

Tags

When creating a Collections Index document, add CollectionsIndex to the tags field.

Example

Usage

Root Index: Collections Index provides a directory of collections, however collections are just one type of resource that can be associated with a DID. The Root Index (CIP-12) provides a top-level root directory for resources, and can contain a property called collections which stores a link to a Collections Index document. The recommended path for mapping from a DID to the Collections Index is: DID/Root Index/Collections Index.

Rationale

Extensibility & Flexibility: It is impossible to predict all of the types of collections that need to be associated with any particular DID. Therefore Collections Index was designed to be an infinitely extensible directory that can support any number of collections.

Decentralization & Trust: Collections directory information is data that needs to be globally-available, censorship-resistant, and live permissionlessly in the public domain (not on any single server). Additionally this information should be owned by a DID and will need to be updated from time to time. These requirements make Ceramic the most appropriate platform for publishing this content.

Implementation

DocId to DocId Map Schema: Find the DocId to DocId Map schema here.

Libraries: Not yet available.

Copyright

Copyright and related rights waived via CC0.

michaelsena commented 4 years ago

@oed I'm thinking the Collections Index should be a schema that stores a list of mappings from DocId to DocId. Should I create a new schema for this, since theoretically that could be useful as a general purpose schema? For this specific purpose it would map Collection Definitions to Collection References.

EDIT: for reference, I created this DocId to DocID Map CIP, but it needs your input on schema.

PaulLeCam commented 4 years ago

@michaelsena I think we can drop this spec as we're using a different setup now.

oed commented 4 years ago

Stale, closing.