Metadata and Comment Schemas
The raw, unhashed transaction metadata and feedback comment for Ink Protocol transactions should follow the schemas below. Adoption of these schemas helps to ensure that all apps and marketplaces write to and read from Ink Protocol's decentralized reputation in an interoperable fashion.
All content should be represented as JSON.
General Schema
Transaction metadata and feedback comments should follow this simple format:
{
"schema": "string",
"data": {
...
}
}
The schema
should include the author, context, and version number. For example:
"schema": "inkprotocol-metadata/1.0"
or
"schema": "inkprotocol-comment/1.0"
In the future, it's possible that others come up with different schemas, and the format above welcomes that.
The data
is a hash that follows the schema
.
Transaction Metadata
The initial draft for inkprotocol-metadata/1.0
:
{
"schema": "inkprotocol-metadata/1.0",
"data": {
"title": …, // String, a description of the good/service being exchanged
"details": …, // String, a longer format description
"url": …, // String, a URL that represents the good/service
"price": {
"currency": …, // String, currency symbol (eg USD, EUR)
"fractional": … // Integer, amount in currency’s lowest denomination
},
"_marketplace": {
// Additional properties specific to the app or marketplace
},
"datetime": … // String, time of transaction, in JavaScript’s Date toJSON format
}
}
Feedback Comment
The initial draft for inkprotocol-comment/1.0
{
"schema": "inkprotocol-comment/1.0",
"data": {
"comment": … // String, the text accompanying the 1-5 rating
}
}
Updated over 5 years ago