Here we give some supporting files, give an example and explain how the example.json was created.
The context fields which could be added to CIP-100 compliant jsonld metadata. See cip-0100.common.jsonld.
A json schema for the common context fields. See cip-0100.common.schema.json.
CIP-100 off-chain metadata json example: example.json
Blake2b-256 hash of the file (to go on-chain): 7b7d4a28a599bbb8c08b239be2645fa82d63a848320bf4760b07d86fcf1aabdc
Files produced to articulate process, these are not necessary in implementations.
Body files, used to correctly generate author's witness:
Blake2b-256 hash digest of canonicalized body: 6d17e71c5793ed5945f58bf48e13bb1b3543187ab9c2afbd280a21afb4a90d35
Whole document canonical representation, used to generate final hash:
This tutorial creates additional intermediate files, these are not required in implementations but are shown here to articulate the process.
Private extended signing key (hex):
105d2ef2192150655a926bca9cccf5e2f6e496efa9580508192e1f4a790e6f53de06529129511d1cacb0664bcf04853fdc0055a47cc6d2c6d205127020760652
Public verification key (hex):
7ea09a34aebb13c9841c71397b1cabfec5ddf950405293dee496cac2f437480a
Create the example.json
file adding in all available values.
Then remove from this document any top-level field that is not @context
or body
.
This creates a intermediate file of example.body.json.
Using a tool which complies with the RDF Dataset Canonicalization, create a canonicalized representation of example.body.json. One such tool is the JSON-LD Playground. Ensure the result ends in a newline.
This creates a intermediate file of example.body.nq.
Using a tool create a Blake2b-256 hash of the canonicalized example.body.nq. One such tool is the ToolKit Bay.
For our example this will result in: 6d17e71c5793ed5945f58bf48e13bb1b3543187ab9c2afbd280a21afb4a90d35
.
Use the hash produced in 3. as the payload for the witness as described in Hashing and Signatures for the chosen witnessAlgorithm
.
One tool for Ed25519 signatures is Ed25519 Online Tool.
For the provided example.json, we use the keys described in Author resulting in a signature
of: 68078efeff90970d2320a2bb5021d1aea81bc4907bf33d54fd17989f020719f3f5c4da3dccf7aa61d51c1e6fececd95309c37e7eef331b199cd5f8e78992ea0d
We can go back to our example.body.json and now add in properties from outside of body
.
- Adding the
hashAlgorithm
ofblake2b-256
. - Adding the
authors
, including information of ourwitness
produced via 4..
By adding this information we create our example.json.
To be able to create a final metadata hash which can be attached on-chain we simply hash the content of the file example.json as is
This results in: 7b7d4a28a599bbb8c08b239be2645fa82d63a848320bf4760b07d86fcf1aabdc
.
We can then host example.json somewhere easily accessible following Best Practices.
Then at submission time of the governance metadata anchor we can provide the on-chain transaction both the URI to the hosted example.json but also the hash generated via 6..