Skip to content

Commit

Permalink
init proper test vectors
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryun1 committed Sep 22, 2024
1 parent 62037b8 commit 938f00e
Show file tree
Hide file tree
Showing 4 changed files with 113 additions and 56 deletions.
29 changes: 15 additions & 14 deletions CIP-0136/cip-xxxx.common.jsonld → CIP-0136/cip-136.common.jsonld
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
{
"@context": {
"@language": "en-us",
"CIP100": "https://github.com/cardano-foundation/CIPs/blob/master/CIP-0100/README.md#",
"CIPXXX": "https://github.com/cardano-foundation/CIPs/blob/master/CIP-0XXX/README.md#",
"CIP136": "https://github.com/cardano-foundation/CIPs/blob/master/CIP-0136/README.md#",
"hashAlgorithm": "CIP100:hashAlgorithm",
"body": {
"@id": "CIPXXX:body",
"@id": "CIP136:body",
"@context": {
"references": {
"@id": "CIPXXX:references",
"@id": "CIP100:references",
"@container": "@set",
"@context": {
"GovernanceMetadata": "CIP100:GovernanceMetadataReference",
"Other": "CIP100:OtherReference",
"label": "CIP100:reference-label",
"uri": "CIP100:reference-uri",
"RelevantArticles": "CIPXXX:RelevantArticles"
"RelevantArticles": "CIP136:RelevantArticles"
}
},
"summary": "CIPXXX:summary",
"rationaleStatement": "CIPXXX:rationaleStatement",
"precedentDiscussion": "CIPXXX:precedentDiscussion",
"counterargumentDiscussion": "CIPXXX:counterargumentDiscussion",
"conclusion": "CIPXXX:conclusion",
"summary": "CIP136:summary",
"rationaleStatement": "CIP136:rationaleStatement",
"precedentDiscussion": "CIP136:precedentDiscussion",
"counterargumentDiscussion": "CIP136:counterargumentDiscussion",
"conclusion": "CIP136:conclusion",
"internalVote": {
"@id": "CIPXXX:internalVote",
"@id": "CIP136:internalVote",
"@context": {
"constitutional": "CIPXXX:constitutional",
"unconstitutional": "CIPXXX:unconstitutional",
"abstain": "CIPXXX:abstain",
"didNotVote": "CIPXXX:didNotVote"
"constitutional": "CIP136:constitutional",
"unconstitutional": "CIP136:unconstitutional",
"abstain": "CIP136:abstain",
"didNotVote": "CIP136:didNotVote"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"title": "CIP-XXX Common",
"title": "CIP-136 Common",
"description": "Metadata document for Cardano Constitutional Committee vote rationales, extending CIP-100",
"type": "object",
"required": ["hashAlgorithm", "authors", "body"],
Expand Down Expand Up @@ -72,6 +72,13 @@
"type": "object",
"required": ["summary", "rationaleStatement"],
"properties": {
"references": {
"title": "References",
"type": "array",
"items": {
"$ref": "#/definitions/Reference"
}
},
"summary": {
"type": "string",
"title": "Summary",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,54 @@
"@context": {
"@language": "en-us",
"CIP100": "https://github.com/cardano-foundation/CIPs/blob/master/CIP-0100/README.md#",
"CIPXXX": "https://github.com/cardano-foundation/CIPs/blob/master/CIP-0108/README.md#",
"CIP136": "https://github.com/cardano-foundation/CIPs/blob/master/CIP-0136/README.md#",
"hashAlgorithm": "CIP100:hashAlgorithm",
"body": {
"@id": "CIPXXX:body",
"@context": {
"references": {
"@id": "CIPXXX:references",
"@container": "@set",
"@context": {
"GovernanceMetadata": "CIP100:GovernanceMetadataReference",
"Other": "CIP100:OtherReference",
"label": "CIP100:reference-label",
"uri": "CIP100:reference-uri"
}
},
"summary": "CIPXXX:summary",
"rationaleStatement": "CIPXXX:rationale-statement",
"precedentDiscussion": "CIPXXX:precedentDiscussion",
"counterargumentDiscussion": "CIPXXX:counterarguments",
"conclusion": "CIPXXX:conclusion",
"internalVote": {
"@id": "CIPXXX:internalVote",
"@context": {
"constitutional": "CIPXXX:constitutional",
"unconstitutional": "CIPXXX:unconstitutional",
"abstain": "CIPXXX:abstain",
"didNotVote": "CIPXXX:didNotVote"
}
"@id": "CIP136:body",
"@context": {
"references": {
"@id": "CIP100:references",
"@container": "@set",
"@context": {
"GovernanceMetadata": "CIP100:GovernanceMetadataReference",
"Other": "CIP100:OtherReference",
"label": "CIP100:reference-label",
"uri": "CIP100:reference-uri",
"RelevantArticles": "CIP136:RelevantArticles"
}
},
"summary": "CIP136:summary",
"rationaleStatement": "CIP136:rationaleStatement",
"precedentDiscussion": "CIP136:precedentDiscussion",
"counterargumentDiscussion": "CIP136:counterargumentDiscussion",
"conclusion": "CIP136:conclusion",
"internalVote": {
"@id": "CIP136:internalVote",
"@container": "@set",
"@context": {
"constitutional": "CIP136:constitutional",
"unconstitutional": "CIP136:unconstitutional",
"abstain": "CIP136:abstain",
"didNotVote": "CIP136:didNotVote"
}
}
}

}
},
"authors": {
"@id": "CIP100:authors",
"@container": "@set",
"@context": {
"name": "http://xmlns.com/foaf/0.1/name",
"witness": {
"@id": "CIP100:witness",
"@context": {
"witnessAlgorithm": "CIP100:witnessAlgorithm",
"publicKey": "CIP100:publicKey",
"signature": "CIP100:signature"
}
"@id": "CIP100:authors",
"@container": "@set",
"@context": {
"did": "@id",
"name": "http://xmlns.com/foaf/0.1/name",
"witness": {
"@id": "CIP100:witness",
"@context": {
"witnessAlgorithm": "CIP100:witnessAlgorithm",
"publicKey": "CIP100:publicKey",
"signature": "CIP100:signature"
}
}
}
}
}
},
"hashAlgorithm": "blake2b-256",
Expand Down
49 changes: 48 additions & 1 deletion CIP-0136/test-vector.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,50 @@
# Test Vector for CIP-136

Here we create some useful definitions and some examples.

## Common Context

### Common Fields

The context fields which could be added to CIP-136 compliant jsonld files.
See [cip-0136.common.jsonld](./cip-0136.common.jsonld).

### Common Fields Schema

A json schema for the common context fields.
See [cip-0136.common.schema.json](./cip-0136.common.schema.json).

## Examples

### Treasury Withdrawal is Unconstitutional

Example metadata document file: [treasury-withdrawal-unconstitutional.jsonld](./examples/treasury-withdrawal-unconstitutional.jsonld).
Blake2b-256 of the file content (to go onchain): ``

#### Intermediate files

Files produced to articulate process, these are not necessary in implementations.

Body files, used to correctly generate author's witness:
- [treasury-withdrawal-unconstitutional.body.jsonld](./examples/treasury-withdrawal-unconstitutional.body.jsonld)
- [treasury-withdrawal-unconstitutional.body.nq](./examples/treasury-withdrawal-unconstitutional.body.nq)

Blake2b-256 hash digest of canonicalized body: ``

## How-to Recreate Examples

This tutorial creates additional intermediate files, these are not required in implementations but are shown here to articulate the process.

### Author

Keys used for author property, provided here for convenience.

Private extended signing key (hex): `105d2ef2192150655a926bca9cccf5e2f6e496efa9580508192e1f4a790e6f53de06529129511d1cacb0664bcf04853fdc0055a47cc6d2c6d205127020760652`

Public verification key (hex):
`7ea09a34aebb13c9841c71397b1cabfec5ddf950405293dee496cac2f437480a`

Public verification key hash (hex): `0fdc780023d8be7c9ff3a6bdc0d8d3b263bd0cc12448c40948efbf42`

Mainnet public enterprize address (hex): `610fdc780023d8be7c9ff3a6bdc0d8d3b263bd0cc12448c40948efbf42`

// todo

0 comments on commit 938f00e

Please sign in to comment.