Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CIP-0010/registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
},
{
"transaction_metadatum_label": 1904,
"description": "Proof of origin and quality related verification data in supply chain"
"description": "CIP-1904 - Verifiable supply chain records"
},
{
"transaction_metadatum_label": 1967,
Expand Down
250 changes: 250 additions & 0 deletions CIP-1904/README.md

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions CIP-1904/examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
The following are examples of how the on-chain metadata would look like in an explorer.
This means in JSON format with byte-streams hex-encoded.

Please see the [CDDL](../schema.cddl) for the __correct__ schema with byte streams.

The [complex directory](./complex) contains examples of key rotation, public key URLs and > 64 byte length values.
As mentioned in the spec, some of these complex scenarios can "stack" or "mix" - for example, rotating a key that is greater than 64 bytes in length, or simply a transaction where both a private key and signature are > 64 bytes in length.
This means the examples are not exhaustive but the current set, coupled with the CDDL, should make it clear.
35 changes: 35 additions & 0 deletions CIP-1904/examples/complex/key-rotation-mid-tx-long-signatures.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"t": "scm",
"v": "1",
"st": "georgianWine",
"d": {
"a2gh": {
"s": [
[
[
"0c2b48602f8aefde43fbab49e7225d50f02d091f508d9dc84e538b4d656940d57301141070612016a50a14f26976cb20378b40a965f63d125dd0bc18fae1f00c",
"623238312d343038622"
],
"7b226b6964223a2237326363346636342d623238312d343038622d383430342d393966396264646538393139222c22616c67223a224564445341227d"
],
[
"727b7dbbdacf861297cc25fe4f58ca62fe6a3bbde4577562abb348182e49ca7f634ab76bff00224a5e91ab47b3b24e6547e8edf4d248fb9211c0f1e534cf6f0a",
"27e03340999899aa32712639ca895656c39d50524316d8b7a8abd2600fba270b583c31c4a2052789c7b11b4c1e11ffd0d5d8a301e53590d682e8f5bf54349b0c"
]
],
"h": [
"7b22616c67223a224564445341227d",
"7b22616c67223a224564445341227d"
],
"pk": [
"0e459119216db26ba7fec7a66462ed4502ef5bf5e25f447ce134e0acccf2be6f",
"095f9a1a595dde755d82786864ad03dfa5a4fbd68832566364e2b65e13cc9e44"
],
"pkn": [
0,
1
]
}
},
"cid": "zCT5htke9ZJ963Tsk5hDXizLzVQTha63ojw4X6SyWa3EBXtmWTPQ"
}
32 changes: 32 additions & 0 deletions CIP-1904/examples/complex/key-rotation-mid-tx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"t": "scm",
"v": "1",
"st": "georgianWine",
"d": {
"a2gh": {
"s": [
[
"0c2b48602f8aefde43fbab49e7225d50f02d091f508d9dc84e538b4d656940d57301141070612016a50a14f26976cb20378b40a965f63d125dd0bc18fae1f00c",
"7b226b6964223a2237326363346636342d623238312d343038622d383430342d393966396264646538393139222c22616c67223a224564445341227d"
],
[
"727b7dbbdacf861297cc25fe4f58ca62fe6a3bbde4577562abb348182e49ca7f634ab76bff00224a5e91ab47b3b24e6547e8edf4d248fb9211c0f1e534cf6f0a",
"27e03340999899aa32712639ca895656c39d50524316d8b7a8abd2600fba270b583c31c4a2052789c7b11b4c1e11ffd0d5d8a301e53590d682e8f5bf54349b0c"
]
],
"h": [
"7b22616c67223a224564445341227d",
"7b22616c67223a224564445341227d"
],
"pk": [
"0e459119216db26ba7fec7a66462ed4502ef5bf5e25f447ce134e0acccf2be6f",
"095f9a1a595dde755d82786864ad03dfa5a4fbd68832566364e2b65e13cc9e44"
],
"pkn": [
0,
1
]
}
},
"cid": "zCT5htke9ZJ963Tsk5hDXizLzVQTha63ojw4X6SyWa3EBXtmWTPQ"
}
20 changes: 20 additions & 0 deletions CIP-1904/examples/complex/long-jws-header.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"t": "scm",
"v": "1",
"st": "georgianWine",
"d": {
"a2gh": {
"s": [
"0c2b48602f8aefde43fbab49e7225d50f02d091f508d9dc84e538b4d656940d57301141070612016a50a14f26976cb20378b40a965f63d125dd0bc18fae1f00c",
"7b226b6964223a2237326363346636342d623238312d343038622d383430342d393966396264646538393139222c22616c67223a224564445341227d"
],
"h": [
"727b7dbbdacf861297cc25fe4f58ca62fe6a3bbde4577562abb348182e49ca7f634ab76bff00224a5e91ab47b3b24e6547e8edf4d248fb9211c0f1e534cf6f0a",
"095f9a1a595dde755d82786864ad03dfa5a4fbd68832566364e2b65e13cc9e44"
],
"pk": "0e459119216db26ba7fec7a66462ed4502ef5bf5e25f447ce134e0acccf2be6f",
"pkn": 3
}
},
"cid": "zCT5htke9ZJ963Tsk5hDXizLzVQTha63ojw4X6SyWa3EBXtmWTPQ"
}
20 changes: 20 additions & 0 deletions CIP-1904/examples/complex/long-public-key.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"t": "scm",
"v": "1",
"st": "georgianWine",
"d": {
"a2gh": {
"s": [
"0c2b48602f8aefde43fbab49e7225d50f02d091f508d9dc84e538b4d656940d57301141070612016a50a14f26976cb20378b40a965f63d125dd0bc18fae1f00c",
"7b226b6964223a2237326363346636342d623238312d343038622d383430342d393966396264646538393139222c22616c67223a224564445341227d"
],
"h": "7b22616c67223a224564445341227d",
"pk": [
"727b7dbbdacf861297cc25fe4f58ca62fe6a3bbde4577562abb348182e49ca7f634ab76bff00224a5e91ab47b3b24e6547e8edf4d248fb9211c0f1e534cf6f0a",
"095f9a1a595dde755d82786864ad03dfa5a4fbd68832566364e2b65e13cc9e44"
],
"pkn": 3
}
},
"cid": "zCT5htke9ZJ963Tsk5hDXizLzVQTha63ojw4X6SyWa3EBXtmWTPQ"
}
20 changes: 20 additions & 0 deletions CIP-1904/examples/complex/long-signature.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"t": "scm",
"v": "1",
"st": "georgianWine",
"d": {
"a2gh": {
"s": [
[
"0c2b48602f8aefde43fbab49e7225d50f02d091f508d9dc84e538b4d656940d57301141070612016a50a14f26976cb20378b40a965f63d125dd0bc18fae1f00c",
"a66462ed4502ef5bf5e25f447ce134e0"
],
"7b226b6964223a2237326363346636342d623238312d343038622d383430342d393966396264646538393139222c22616c67223a224564445341227d"
],
"h": "7b22616c67223a224564445341227d",
"pk": "0e459119216db26ba7fec7a66462ed4502ef5bf5e25f447ce134e0acccf2be6f",
"pkn": 3
}
},
"cid": "zCT5htke9ZJ963Tsk5hDXizLzVQTha63ojw4X6SyWa3EBXtmWTPQ"
}
16 changes: 16 additions & 0 deletions CIP-1904/examples/complex/public-key-as-url.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"t": "scm",
"v": "1",
"st": "georgianWine",
"d": {
"a2gh": {
"s": [
"0c2b48602f8aefde43fbab49e7225d50f02d091f508d9dc84e538b4d656940d57301141070612016a50a14f26976cb20378b40a965f63d125dd0bc18fae1f00c",
"7b226b6964223a2237326363346636342d623238312d343038622d383430342d393966396264646538393139222c22616c67223a224564445341227d"
],
"h": "7b22616c67223a224564445341227d",
"pk": "https://example.gov/api/v1/pubkeys/a2gh/v/3"
}
},
"cid": "zCT5htke9ZJ963Tsk5hDXizLzVQTha63ojw4X6SyWa3EBXtmWTPQ"
}
13 changes: 13 additions & 0 deletions CIP-1904/examples/conformityCert.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"t": "conformityCert",
"v": "1",
"st": "georgianWine",
"s": [
"0c2b48602f8aefde43fbab49e7225d50f02d091f508d9dc84e538b4d656940d57301141070612016a50a14f26976cb20378b40a965f63d125dd0bc18fae1f00c",
"7b226b6964223a2237326363346636342d623238312d343038622d383430342d393966396264646538393139222c22616c67223a224564445341227d"
],
"h": "7b22616c67223a224564445341227d",
"pk": "0e459119216db26ba7fec7a66462ed4502ef5bf5e25f447ce134e0acccf2be6f",
"pkn": 3,
"cid": "zCT5htke9ZJ963Tsk5hDXizLzVQTha63ojw4X6SyWa3EBXtmWTPQ"
}
13 changes: 13 additions & 0 deletions CIP-1904/examples/conformityCertRevoke.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"t": "conformityCertRevoke",
"v": "1",
"st": "georgianWine",
"s": [
"0c2b48602f8aefde43fbab49e7225d50f02d091f508d9dc84e538b4d656940d57301141070612016a50a14f26976cb20378b40a965f63d125dd0bc18fae1f00c",
"7b226b6964223a2237326363346636342d623238312d343038622d383430342d393966396264646538393139222c22616c67223a224564445341227d"
],
"h": "7b22616c67223a224564445341227d",
"pk": "0e459119216db26ba7fec7a66462ed4502ef5bf5e25f447ce134e0acccf2be6f",
"pkn": 3,
"cid": "zCT5htke9ZJ963Tsk5hDXizLzVQTha63ojw4X6SyWa3EBXtmWTPQ"
}
25 changes: 25 additions & 0 deletions CIP-1904/examples/scm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"t": "scm",
"v": "1",
"st": "georgianWine",
"d": {
"a2gh": {
"s": [
"0c2b48602f8aefde43fbab49e7225d50f02d091f508d9dc84e538b4d656940d57301141070612016a50a14f26976cb20378b40a965f63d125dd0bc18fae1f00c",
"7b226b6964223a2237326363346636342d623238312d343038622d383430342d393966396264646538393139222c22616c67223a224564445341227d"
],
"h": "7b22616c67223a224564445341227d",
"pk": "0e459119216db26ba7fec7a66462ed4502ef5bf5e25f447ce134e0acccf2be6f",
"pkn": 3
},
"p33l": {
"s": [
"727b7dbbdacf861297cc25fe4f58ca62fe6a3bbde4577562abb348182e49ca7f634ab76bff00224a5e91ab47b3b24e6547e8edf4d248fb9211c0f1e534cf6f0a",
"27e03340999899aa32712639ca895656c39d50524316d8b7a8abd2600fba270b583c31c4a2052789c7b11b4c1e11ffd0d5d8a301e53590d682e8f5bf54349b0c"
],
"h": "7b22616c67223a224564445341227d",
"pk": "095f9a1a595dde755d82786864ad03dfa5a4fbd68832566364e2b65e13cc9e44"
}
},
"cid": "zCT5htke9ZJ963Tsk5hDXizLzVQTha63ojw4X6SyWa3EBXtmWTPQ"
}
74 changes: 74 additions & 0 deletions CIP-1904/schema.cddl
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
transaction_metadata = {
"1904": scm_record / conformity_cert_issue_record / conformity_cert_revoke_record
}


; Common
md_str = tstr .size (1..64)
md_bs = bytes .size (1..64)
md_bs_arr = [2* md_bs]

; If a key rotation occurred, an array of public keys, headers and signatures are supplied and are all suffixed with "_kt"
; The length of each "_kt" array must be the same, where the ith index of each array refers to the ith key and its corresponding JSON Web Signatures

public_key = md_str / md_bs ; URL to public key (application/octet-stream) or public key byte stream
public_key_kt = [2* public_key]

public_key_version = uint
public_key_version_kt = [2* public_key_version]

header = md_bs / md_bs_arr ; JSON Web Signature header - RFC 7515
header_kt = [2* header]

signature = md_bs / md_bs_arr ; detached JSON Web Signature - RFC 7515
signature_arr = [1* signature]
signature_arr_kt = [2* signature_arr]

; CID hereafter refers to the Content Identifier of off-chain data (Multiformats)


; SCM
scm_record =
{ t: "scm"
, ? st: md_str
, v: md_str
, cid: md_str
, d: verification_data
}

verification_data = { * producer_id => producer_verification_data }

producer_id = md_str

producer_verification_data =
{ pk: public_key / public_key_kt
, ? pkv: public_key_version / public_key_version_kt
, h: header / header_kt
, s: signature_arr / signature_arr_kt
}


; Certificate of Conformity
conformity_cert_issue_record =
{ t: "conformityCert"
, ? st: md_str
, v: md_str
, cid: md_str
, pk: public_key / public_key_kt
, ? pkv: public_key_version / public_key_version_kt
, h: header / header_kt
, s: signature_arr / signature_arr_kt
}


; Certificate of Conformity revoke
conformity_cert_revoke_record =
{ t: "conformityCertRevoke"
, ? st: md_str
, v: md_str
, pk: public_key / public_key_kt
, ? pkv: public_key_version / public_key_version_kt
, h: header / header_kt
, s: signature_arr / signature_arr_kt
, cid: md_str
}
6 changes: 6 additions & 0 deletions CIP-1904/subtypes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
{
"st": "georgianWine",
"description": "The National Wine Agency of Georgia oversees the production and quality control of bottles of wine produced in the country. This subtype is used for proof-of-origin and quality control on individual bottles. Supply Chain Management data follows an extended version of the OIV Standard - https://www.oiv.int/standards/international-standard-for-the-labelling-of-wines - and Certificates of Conformity are signed directly by the National Wine Agency. For more information on transaction verification, please see https://cardano-foundation.github.io/cf-georgian-wine-resolver."
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In theory this could just be a link to the outside documentation but I think some description is useful in case of link rot.

This seems a bit long though

}
]