Items
Items are stored off-chain. Each item links to the next item in the list, and contains data as well as (validated) information for verifying the next item.
{
"validated": {
"itemRaw": text (json of item, see below),
"itemHash": hex,
"nextHash": [0-255 * 32],
"timestamp": unix timestamp (seconds from epoch)
},
"hash": hex,
"next": {
"objId": [0-255 * 32],
"accessType": {
<access type>: {
}
}
}
}
item (inside item raw)
{
"type": ITEM|CORRECTION,
ref?,
"display"?: {
img: text (url),
label: text,
long_description: text,
help_text: text,
},
"data"
}
validatedthis section contains the information that can be validated using the solstory architecture.itemRawjson dictionaries don't have a defined ordering, so in order for verification to work properly this needs to be raw text that separately serialized before the entire object is serialized. The raw text is what gets used for the hashing algorithm.itemHashhash ofitemRaw- should be recalculated by the client api for verification.nextHashthe hash of the next itemtimestampa unix timestamp from when the object was madehashthis should be calculated fromitemHash,nextHash, and timestamp. See the reference implementation or the rust program (if you're doing this wrong, the rust program will reject your update). Generally client side APIs should recalculate this manually and compare itnextthis specifier gives the information required to locate the next item in the story/chain.
item
typespecifies the item type. Currently the only two types areITEMandCORRECTIONwhere anITEMis a regular record and aCORRECTIONcorrects the record specified inrefby its hash.refspecifies which record this record is linking to, currently only in use forCORRECTIONdisplaythese specifiy how an item should be displayed.dataany data included in the rcord, contains arbitrary JSON.