⚙️Data Model
The data model described here is compliant with transform.storage v1.0.0.
Last updated
The data model described here is compliant with transform.storage v1.0.0.
Last updated
The goal of CO2.Storage is to store environmental asset data along with explicit information on its data type, making it easy to transform or compare data between different assets. Both the underlying data and the assets themselves are stored as IPLD DAGs.
Below, every rectangle corresponds to an IPLD object with its own CID. Every arrow corresponds to an attribute of that object, labeled with the attribute name.
For a video overview and demo of the data model below, see the second half of the February 2022 Filecoin Green Virtual Meetup.
An example of this data model is Type: bafyreidav… / Schema: bafyreihxmr3…
Types are stored using the data model above. The type block contains some metadata about the type, along with a schema defining that type. The fields included in the type block are:
cid: this is the CID corresponding to a JSON-schema defining the data type, shown in the schematic above
name: a short label for this type
version: version of the transform.storage protocol, in this case "1.0.0"
base (optional): if this was cloned from another type, base is the CID of that type
parent (optional): null for v1.0.0
creator (optional): wallet creating this type
reference (optional): null for v1.0.0
timestamp (optional): UTC timestamp when this type was created
description (optional): longer label for this type
An example of this data model is Asset: bafyreidzoai4… / Type: bafyreidav… / Data: bafyreictxcw…
As shown above, assets link data in a payload to the datatype associated with that data. The asset itself contains some additional metadata. Its attributes are:
cid: this is the CID of the actual data we are describing; the 'payload' of the asset data
template: the CID of a type as defined above
name: a short label for this asset
version: version of the transform.storage protocol, in this case "1.0.0"
parent (optional): null for v1.0.0
creator (optional): wallet creating this asset
timestamp (optional): UTC timestamp when this asset was created
description (optional): longer label for this asset
protocol_name: transform.storage
Any data can be signed by a contributor as part of a Provenance Protocol community, as shown.
The format for these provenance messages is:
Message B:
{
“protocol” : “provenance protocol”,
“version” : “1.0.0”,
"provenance_message" : <CID of Message A>,
“signature” : <sign CID of Message A>,
“contributor_key” : <key of message signer>,
“method” : “eth_signTypedData_v4”,
“verifying_contract” : “0x7c75AA9001c4…”,
“chain_id” : “0x1”
}
Message A:
{
“protocol” : “provenance protocol”,
“version” : “1.0.0”,
“data_license” : <from account>,
“provenance_community”: <name of community>,
“contributor_name” : <name of contributor>,
“contributor_key” : <key of message signer>,
“payload” : <CID of Data / Type / Asset>,
“notes”: null
}