Skip to content

Commit

Permalink
Final draft for CIP-0100
Browse files Browse the repository at this point in the history
Provides a JSON-LD and JSON Schema file for the minimal features.

Reworks the wording of many bits, especially to reference a parallel CIP
to extend CIP-0013.

Provides example test vectors.

Folds the "augmentation" concept into a simple "references" field.
  • Loading branch information
Quantumplation committed Dec 11, 2023
1 parent 2382cf0 commit f1a75b2
Show file tree
Hide file tree
Showing 8 changed files with 339 additions and 79 deletions.
126 changes: 70 additions & 56 deletions CIP-0100/README.md

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions CIP-0100/cip-0100.common.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"@context": {
"Proposal": "https://cips.cardano.org/cip/CIP-0100#Proposal",
"hashAlgorithm": "https://cips.cardano.org/cip/CIP-0100#hashAlgorithm",
"body": {
"@id": "https://cips.cardano.org/cip/CIP-0100#body",
"@context": {
"references": {
"@id": "https://cips.cardano.org/cip/CIP-0100#references",
"@container": "@set",
"@context": {
"GovernanceMetadata": "https://cips.cardano.org/cip/CIP-0100#GovernanceMetadataReference",
"Other": "https://cips.cardano.org/cip/CIP-0100#OtherReference",
"label": "https://cips.cardano.org/cip/CIP-0100#reference-label",
"uri": "https://cips.cardano.org/cip/CIP-0100#reference-uri"
}
},
"comment": "https://cips.cardano.org/cip/CIP-0100#comment",
"externalUpdates": {
"@id": "https://cips.cardano.org/cip/CIP-0100#externalUpdates",
"@context": {
"title": "https://cips.cardano.org/cip/CIP-0100#update-title",
"uri": "https://cips.cardano.org/cip/CIP-0100#update-uri"
}
}
}
},
"authors": {
"@id": "https://cips.cardano.org/cip/CIP-0100#authors",
"@container": "@set",
"@context": {
"did": "@id",
"name": "http://xmlns.com/foaf/0.1/name",
"witness": {
"@id": "https://cips.cardano.org/cip/CIP-0100#witness",
"@context": {
"witnessAlgorithm": "https://cips.cardano.org/cip/CIP-0100#witnessAlgorithm",
"publicKey": "https://cips.cardano.org/cip/CIP-0100#publicKey",
"signature": "https://cips.cardano.org/cip/CIP-0100#signature"
}
}
}
}
}
}
146 changes: 146 additions & 0 deletions CIP-0100/cip-0100.common.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
{
"title": "CIP-100 Common",
"description": "A base-line CIP-100 governance metadata document",
"type": "object",
"required": [
"hashAlgorithm",
"authors",
"body"
],
"properties": {
"hashAlgorithm": {
"$ref": "#/definitions/hashAlgorithm"
},
"authors": {
"title": "Authors",
"description": "The authors of this governance metadata",
"type": "array",
"items": {
"$ref": "#/definitions/Author"
}
},
"body": {
"$ref": "#/definitions/Body"
}
},
"definitions": {
"hashAlgorithm": {
"title": "Hash Algorithm",
"description": "The hash algorithm used to authenticate this document externally",
"type": "string",
"enum": [
"blake2b-224"
]
},
"Author": {
"title": "Author",
"description": "An author endorsing the content of a metadata document",
"type": "object",
"required": [
"witness"
],
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"witness": {
"$ref": "#/definitions/Witness"
}
}
},
"Witness": {
"title": "Witness",
"description": "A witness proving that the author endorses the content of the metadata",
"type": "object",
"properties": {
"witnessAlgorithm": {
"title": "WitnessAlgorithm",
"type": "string",
"enum": [
"ed25519"
]
},
"publicKey": {
"title": "PublicKey",
"type": "string"
},
"signature": {
"title": "Signature",
"type": "string"
}
}
},
"Body": {
"title": "Body",
"description": "The body of the metadata document that is hashed to produce a signature",
"properties": {
"references": {
"title": "References",
"type": "array",
"items": {
"$ref": "#/definitions/Reference"
}
},
"comment": {
"title": "Comment",
"type": "string"
},
"externalUpdatess": {
"title": "ExternalUpdates",
"type": "array",
"items": {
"$ref": "#/definitions/ExternalUpdate"
}
}
}
},
"Reference": {
"title": "Reference",
"description": "A reference to a document",
"type": "object",
"required": [
"@type",
"label",
"uri"
],
"properties": {
"@type": {
"title": "Type",
"type": "string",
"enum": [
"GovernanceMetadata",
"Other"
]
},
"label": {
"title": "Label",
"type": "string"
},
"uri": {
"title": "URI",
"type": "string"
}
}
},
"ExternalUpdate": {
"title": "ExternalUpdate",
"type": "object",
"description": "An source for updates *after* the metadata is published",
"required": [
"title",
"uri"
],
"properties": {
"title": {
"title": "Title",
"type": "string"
},
"uri": {
"title": "URI",
"type": "string"
}
}
}
}
}
5 changes: 0 additions & 5 deletions CIP-0100/cip-100.augmentation.jsonld

This file was deleted.

18 changes: 0 additions & 18 deletions CIP-0100/cip-100.common.jsonld

This file was deleted.

9 changes: 9 additions & 0 deletions CIP-0100/example.body.canonical
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
_:c14n0 <https://cips.cardano.org/cip/CIP-0100#update-title> "Blog"@en-us .
_:c14n0 <https://cips.cardano.org/cip/CIP-0100#update-uri> "https://314pool.com"@en-us .
_:c14n2 <https://cips.cardano.org/cip/CIP-0100#body> _:c14n5 .
_:c14n3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://cips.cardano.org/cip/CIP-0100#OtherReference> .
_:c14n3 <https://cips.cardano.org/cip/CIP-0100#reference-label> "CIP-100"@en-us .
_:c14n3 <https://cips.cardano.org/cip/CIP-0100#reference-uri> "https://cips.cardano.org/cip/CIP-0100"@en-us .
_:c14n5 <https://cips.cardano.org/cip/CIP-0100#comment> "This is a test vector for CIP-100"@en-us .
_:c14n5 <https://cips.cardano.org/cip/CIP-0100#externalUpdates> _:c14n0 .
_:c14n5 <https://cips.cardano.org/cip/CIP-0100#references> _:c14n3 .
10 changes: 10 additions & 0 deletions CIP-0100/example.canonical
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
_:c14n0 <https://cips.cardano.org/cip/CIP-0100#update-title> "Blog"@en-us .
_:c14n0 <https://cips.cardano.org/cip/CIP-0100#update-uri> "https://314pool.com"@en-us .
_:c14n2 <https://cips.cardano.org/cip/CIP-0100#body> _:c14n5 .
_:c14n3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://cips.cardano.org/cip/CIP-0100#OtherReference> .
_:c14n3 <https://cips.cardano.org/cip/CIP-0100#reference-label> "CIP-100"@en-us .
_:c14n3 <https://cips.cardano.org/cip/CIP-0100#reference-uri> "https://cips.cardano.org/cip/CIP-0100"@en-us .
_:c14n4 <http://xmlns.com/foaf/0.1/name> "Pi Lanningham"@en-us .
_:c14n5 <https://cips.cardano.org/cip/CIP-0100#comment> "This is a test vector for CIP-100"@en-us .
_:c14n5 <https://cips.cardano.org/cip/CIP-0100#externalUpdates> _:c14n0 .
_:c14n5 <https://cips.cardano.org/cip/CIP-0100#references> _:c14n3 .
59 changes: 59 additions & 0 deletions CIP-0100/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"@context": {
"@language": "en-us",
"Proposal": "https://cips.cardano.org/cip/CIP-0100#Proposal",
"hashAlgorithm": "https://cips.cardano.org/cip/CIP-0100#hashAlgorithm",
"body": {
"@id": "https://cips.cardano.org/cip/CIP-0100#body",
"@context": {
"references": {
"@id": "https://cips.cardano.org/cip/CIP-0100#references",
"@container": "@set",
"@context": {
"GovernanceMetadata": "https://cips.cardano.org/cip/CIP-0100#GovernanceMetadataReference",
"Other": "https://cips.cardano.org/cip/CIP-0100#OtherReference",
"label": "https://cips.cardano.org/cip/CIP-0100#reference-label",
"uri": "https://cips.cardano.org/cip/CIP-0100#reference-uri"
}
},
"comment": "https://cips.cardano.org/cip/CIP-0100#comment",
"externalUpdates": {
"@id": "https://cips.cardano.org/cip/CIP-0100#externalUpdates",
"@context": {
"title": "https://cips.cardano.org/cip/CIP-0100#update-title",
"uri": "https://cips.cardano.org/cip/CIP-0100#update-uri"
}
}
}
},
"authors": {
"@id": "https://cips.cardano.org/cip/CIP-0100#authors",
"@container": "@set",
"@context": {
"did": "@id",
"name": "http://xmlns.com/foaf/0.1/name",
"witness": {
"@id": "https://cips.cardano.org/cip/CIP-0100#witness",
"@context": {
"witnessAlgorithm": "https://cips.cardano.org/cip/CIP-0100#witnessAlgorithm",
"publicKey": "https://cips.cardano.org/cip/CIP-0100#publicKey",
"signature": "https://cips.cardano.org/cip/CIP-0100#signature"
}
}
}
}
},
"hashAlgorithm": "blake2b-224",
"authors": [
{ "name": "Pi Lanningham", "witness": { "witnessAlgorithm": "ed25519", "publicKey": "46e4db7f87497ba232977ccd591b3d040316b155e8c60e3ea49176c03fa269de", "signature": "abcd"}}
],
"body": {
"references": [
{ "@type": "Other", "label": "CIP-100", "uri": "https://cips.cardano.org/cip/CIP-0100" }
],
"comment": "This is a test vector for CIP-100",
"externalUpdates": [
{ "title": "Blog", "uri": "https://314pool.com" }
]
}
}

0 comments on commit f1a75b2

Please sign in to comment.