From 87bef693380c48ebab27f506485bae80bfd851ab Mon Sep 17 00:00:00 2001 From: David Emett Date: Tue, 27 May 2025 15:26:15 +0100 Subject: [PATCH 1/5] JIP-6: Program metadata --- JIP-6.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 JIP-6.md diff --git a/JIP-6.md b/JIP-6.md new file mode 100644 index 0000000..fc7bd91 --- /dev/null +++ b/JIP-6.md @@ -0,0 +1,32 @@ +# JIP-6: Program metadata + +PVM code blobs as defined in the Gray Paper begin with a variable-length metadata section. This JIP +proposes a standard format for this metadata. + +## Format + +The metadata section should begin with the following, serialized as per the codec defined in the +Gray Paper, with `len++[...]` meaning a length-prefixed sequence and `String` meaning a +byte-length-prefixed UTF-8 string: + + 0 (Single byte) + String (Program name) + String (Version) + String (License) + len++[String] (Authors) + +The metadata section may contain data beyond this; any such data should be ignored. + +## Further conventions + +This section describes further conventions on the format of individual metadata fields. Metadata +parsers should gracefully handle metadata that does not conform to these conventions. + +The program name should contain only alphanumeric characters, underscores, and hyphens. Rust +programs should use the crate name as the program name. + +The license field should contain an SPDX license expression. + +Each member of the authors sequence should identify a person or organization. An email address may +be included within angled brackets at the end of each author entry. For example, "Parity +Technologies ". From b0c6254fa0494b434c5a093553a999a8281efae9 Mon Sep 17 00:00:00 2001 From: David Emett Date: Tue, 27 May 2025 15:35:45 +0100 Subject: [PATCH 2/5] Formatting --- JIP-6.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/JIP-6.md b/JIP-6.md index fc7bd91..98ab25d 100644 --- a/JIP-6.md +++ b/JIP-6.md @@ -28,5 +28,5 @@ programs should use the crate name as the program name. The license field should contain an SPDX license expression. Each member of the authors sequence should identify a person or organization. An email address may -be included within angled brackets at the end of each author entry. For example, "Parity -Technologies ". +be included within angled brackets at the end of each author entry. For example, `Parity +Technologies `. From 3341aba2a1d0b596d66f1fdbd11820e7319cbd0f Mon Sep 17 00:00:00 2001 From: David Emett Date: Tue, 27 May 2025 15:35:55 +0100 Subject: [PATCH 3/5] Metadata writers should not include extra data --- JIP-6.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/JIP-6.md b/JIP-6.md index 98ab25d..5631457 100644 --- a/JIP-6.md +++ b/JIP-6.md @@ -15,7 +15,8 @@ byte-length-prefixed UTF-8 string: String (License) len++[String] (Authors) -The metadata section may contain data beyond this; any such data should be ignored. +Writers of metadata should not include any data beyond this, however any such data should be +ignored by parsers. ## Further conventions From d6e51943e0e6bf776ee84063d998911115bafb3f Mon Sep 17 00:00:00 2001 From: Gavin Wood Date: Tue, 27 May 2025 16:00:23 +0100 Subject: [PATCH 4/5] Update JIP-6.md --- JIP-6.md | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/JIP-6.md b/JIP-6.md index 5631457..af90683 100644 --- a/JIP-6.md +++ b/JIP-6.md @@ -5,15 +5,11 @@ proposes a standard format for this metadata. ## Format -The metadata section should begin with the following, serialized as per the codec defined in the -Gray Paper, with `len++[...]` meaning a length-prefixed sequence and `String` meaning a -byte-length-prefixed UTF-8 string: - - 0 (Single byte) - String (Program name) - String (Version) - String (License) - len++[String] (Authors) +Given three octet sequences which are UTF-8 encoded strings program-name $\mathbf{p} \in \mathbb{Y}$, version $\mathbf{p} \in \mathbb{Y}$ and licence $\mathbf{p} \in \mathbb{Y}$, together with a sequence of authors, each of them such strings $\mathbf{A} \in [\mathbb{Y}]$, we define the encoded metadata $\mathbf{m}$ as: + +$$ +\mathbf{m} \equiv [0] \frown \mathcal{E}(\left\updownarrow\mathbf{p}\right., \left\updownarrow\mathbf{p}\right., \left\updownarrow\mathbf{p}\right., \left\updownarrow[\left\updownarrow\mathbf{a}\right.\mid\mathbf{a} \in \mathbf{A}]\right.) +$$ Writers of metadata should not include any data beyond this, however any such data should be ignored by parsers. From aff01149fa53d686177d4651edf7bfe82d315255 Mon Sep 17 00:00:00 2001 From: Gavin Wood Date: Tue, 27 May 2025 16:01:25 +0100 Subject: [PATCH 5/5] Update JIP-6.md --- JIP-6.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/JIP-6.md b/JIP-6.md index af90683..87444a4 100644 --- a/JIP-6.md +++ b/JIP-6.md @@ -5,10 +5,10 @@ proposes a standard format for this metadata. ## Format -Given three octet sequences which are UTF-8 encoded strings program-name $\mathbf{p} \in \mathbb{Y}$, version $\mathbf{p} \in \mathbb{Y}$ and licence $\mathbf{p} \in \mathbb{Y}$, together with a sequence of authors, each of them such strings $\mathbf{A} \in [\mathbb{Y}]$, we define the encoded metadata $\mathbf{m}$ as: +Given three octet sequences which are UTF-8 encoded strings program-name $\mathbf{p} \in \mathbb{Y}$, version $\mathbf{v} \in \mathbb{Y}$ and licence $\mathbf{l} \in \mathbb{Y}$, together with a sequence of authors, each of them such strings $\mathbf{A} \in [\mathbb{Y}]$, we define the encoded metadata $\mathbf{m}$ as: $$ -\mathbf{m} \equiv [0] \frown \mathcal{E}(\left\updownarrow\mathbf{p}\right., \left\updownarrow\mathbf{p}\right., \left\updownarrow\mathbf{p}\right., \left\updownarrow[\left\updownarrow\mathbf{a}\right.\mid\mathbf{a} \in \mathbf{A}]\right.) +\mathbf{m} \equiv [0] \frown \mathcal{E}(\left\updownarrow\mathbf{p}\right., \left\updownarrow\mathbf{v}\right., \left\updownarrow\mathbf{l}\right., \left\updownarrow[\left\updownarrow\mathbf{a}\right.\mid\mathbf{a} \in \mathbf{A}]\right.) $$ Writers of metadata should not include any data beyond this, however any such data should be