From 9b2ae79baf5e3b50c4803cb82afcf88d4d57877c Mon Sep 17 00:00:00 2001 From: Daira Hopwood Date: Wed, 9 Nov 2022 21:08:50 +0000 Subject: [PATCH] [zip-guide] Expand on conventions for Terminology, Specification, and References (#645) * [zip-guide] Expand on conventions for Terminology, Specification, and References. Signed-off-by: Daira Hopwood * Update zip-guide.rst Signed-off-by: Daira Hopwood Co-authored-by: Deirdre Connolly --- zip-guide.html | 71 ++++++++++++++++++++++++++++++++++------ zip-guide.rst | 87 +++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 136 insertions(+), 22 deletions(-) diff --git a/zip-guide.html b/zip-guide.html index 35ff8402..687b1c04 100644 --- a/zip-guide.html +++ b/zip-guide.html @@ -3,6 +3,7 @@ ZIP guide: {Something Short and To the Point} +
@@ -22,7 +23,10 @@ Pull-Request: <https://githu

{Delete this section.}

Terminology

-

{Edit this to reflect the key words that are actually used.} The key words "MUST", "MUST NOT", "SHOULD", and "MAY" in this document are to be interpreted as described in RFC 2119. 1

+

{Edit this to reflect the key words that are actually used.} The key words "MUST", "REQUIRED", "MUST NOT", "SHOULD", and "MAY" in this document are to be interpreted as described in RFC 2119. 1

+

{Avoid duplicating definitions from other ZIPs. Instead use wording like this:}

+

The terms "Mainnet" and "Testnet" in this document are to be interpreted as defined in the Zcash protocol specification 5.

+

The term "full validator" in this document is to be interpreted as defined in the Zcash protocol specification 4.

The terms below are to be interpreted as follows:

{Term to be defined}
@@ -34,7 +38,7 @@ Pull-Request: <https://githu

Abstract

{Describe what this proposal does, typically in a few paragraphs.

The Abstract should only provide a summary of the ZIP; the ZIP should remain complete without the Abstract.

-

Use links where applicable, e.g. 2 3.}

+

Use links where applicable, e.g. 2 3.}

Motivation

{Why is this proposal needed?

@@ -48,19 +52,38 @@ Pull-Request: <https://githu

{This section is entirely optional. If it is present, it describes issues that the proposal is not attempting to address, that someone might otherwise think it does or should.}

Specification

-

{This section describes what should change, using precise language and conformance key words. Anything that is required in order to implement the ZIP (or follow its process, in the case of a Process ZIP) should be in this section.

+

{Replace this entire section.}

+

The Specification section describes what should change, using precise language and conformance key words. Anything that is required in order to implement the ZIP (or follow its process, in the case of a Process ZIP) should be in this section.

Avoid overspecification! Also avoid underspecification. Specification is hard. Don't be afraid to ask for help.

-

Unless the specification is particularly simple, you will need to organise it under subheadings.}

+

Feel free to copy from other ZIPs doing similar things, e.g. defining RPC calls, consensus rules, etc.

+

ZIPs MUST take into account differences between the Zcash Mainnet and Testnet 5 where applicable. A consensus ZIP MUST be able to be deployed on both Mainnet and Testnet.

+

Unless the specification is particularly simple, you will need to organise it under subheadings.

Example subheading

-

{At least while the ZIP is in Draft, we encourage writing open questions and TODOs.}

+

At least while the ZIP is in Draft, we encourage writing open questions and TODOs.

Open questions

    -
  • What happens if a full node can't parse the fandangle as a doohicky?
  • +
  • What happens if a full validator can't parse the fandangle as a doohicky?

TODO: define byte encoding for the Jabberwock.

-

{Feel free to copy from other ZIPs doing similar things, e.g. defining RPC calls, consensus rules, etc.}

+

Comparison of ZIPs to RFCs

+

Like RFCs, ZIPs are precise technical documents that SHOULD give enough implementation to implement part of a Zcash-related protocol or follow a Zcash-related process.

+

ZIPs are different from RFCs in the following ways:

+
    +
  • Many (but not all) ZIPs are "living documents"; they are updated in-place as the relevant areas of the protocol or process change. Unlike in the RFC process, making a change in an area described by a published ZIP does not necessarily require creating a new ZIP, although that is an option if the change is extensive enough to warrant it.
  • +
  • The expected structure of a ZIP is more constrained than an RFC. For example, the Specification section is REQUIRED, and all of the conformance requirements MUST go in that section. The ZIP editors will help you to ensure that things go in the right sections.
  • +
  • Security considerations SHOULD be spread throughout the text, in the places where they are most relevant.
  • +
+
+

Using mathematical notation

+

Embedded + \(\LaTeX\) + is allowed and encouraged in ZIPs. The syntax for inline math is ":math:`latex code`" in reStructuredText or "$latex code$" in Markdown. The rendered HTML will use KaTeX 6, which only supports a subset of + \(\LaTeX\!\) + , so you will need to double-check that the rendering is as intended.

+

In general the conventions in the Zcash protocol specification SHOULD be followed. If you find this difficult, don't worry too much about it in initial drafts; the ZIP editors will catch any inconsistencies in review.

+

Valid reStructuredText

This is optional before publishing a PR, but to check whether a document is valid reStructuredText, first install rst2html5. E.g. on Debian-based distros:

sudo apt install python3-pip pandoc perl sed
@@ -69,6 +92,10 @@ pip3 install docutils==0.19 rst2html5
make zip-xxxx.html

(or just make) and view zip-xxxx.html in a web browser.

+

Conventions for references

+

For references to the Zcash protocol specification, prefer to link to a section anchor, and name the reference as [#protocol-<anchor>]. This makes it more likely that the link will remain valid if sections are renumbered or if content is moved. The anchors in the protocol specification can be displayed by clicking on a section heading in most PDF viewers. References to particular sections should be versioned, even though the link will point to the most recent stable version.

+

Do not include the "https://zips.z.cash/" part of URLs to ZIPs or the protocol spec.

+

Reference implementation

{This section is entirely optional; if present, it usually gives links to zcashd or zebrad PRs.}

@@ -86,7 +113,7 @@ pip3 install docutils==0.19 rst2html5 2 - Zcash Protocol Specification, Version 2020.1.24 or later + Zcash Protocol Specification, Version 2022.3.8 or later @@ -94,14 +121,38 @@ pip3 install docutils==0.19 rst2html5 3 - Zcash Protocol Specification, Version 2020.1.24. Section 1: Introduction + Zcash Protocol Specification, Version 2022.3.8. Section 1: Introduction + + + + + + + + + + +
4Zcash Protocol Specification, Version 2022.3.8. Section 3.3: The Block Chain
+ + + + + + + +
5Zcash Protocol Specification, Version 2022.3.8. Section 3.12: Mainnet and Testnet
+ + + + +
6KaTeX - The fastest math typesetting library for the web
- + diff --git a/zip-guide.rst b/zip-guide.rst index 152c800c..847b1e62 100644 --- a/zip-guide.rst +++ b/zip-guide.rst @@ -29,8 +29,16 @@ Terminology =========== {Edit this to reflect the key words that are actually used.} -The key words "MUST", "MUST NOT", "SHOULD", and "MAY" in this document are to -be interpreted as described in RFC 2119. [#RFC2119]_ +The key words "MUST", "REQUIRED", "MUST NOT", "SHOULD", and "MAY" in this +document are to be interpreted as described in RFC 2119. [#RFC2119]_ + +{Avoid duplicating definitions from other ZIPs. Instead use wording like this:} + +The terms "Mainnet" and "Testnet" in this document are to be interpreted as +defined in the Zcash protocol specification [#protocol-networks]_. + +The term "full validator" in this document is to be interpreted as defined in +the Zcash protocol specification [#protocol-blockchain]_. The terms below are to be interpreted as follows: @@ -87,30 +95,70 @@ it does or should.} Specification ============= -{This section describes what should change, using precise language and conformance -key words. Anything that is *required in order to implement the ZIP* (or follow its -process, in the case of a Process ZIP) should be in this section. +{Replace this entire section.} + +The Specification section describes what should change, using precise language and +conformance key words. Anything that is *required in order to implement the ZIP* +(or follow its process, in the case of a Process ZIP) should be in this section. Avoid overspecification! Also avoid underspecification. Specification is hard. Don't be afraid to ask for help. +Feel free to copy from other ZIPs doing similar things, e.g. defining RPC calls, +consensus rules, etc. + +ZIPs MUST take into account differences between the Zcash Mainnet and Testnet +[#protocol-networks]_ where applicable. A consensus ZIP MUST be able to be deployed +on both Mainnet and Testnet. + Unless the specification is particularly simple, you will need to organise it under -subheadings.} +subheadings. Example subheading ------------------ -{At least while the ZIP is in Draft, we encourage writing open questions and TODOs.} +At least while the ZIP is in Draft, we encourage writing open questions and TODOs. Open questions '''''''''''''' -* What happens if a full node can't parse the fandangle as a doohicky? +* What happens if a full validator can't parse the fandangle as a doohicky? TODO: define byte encoding for the Jabberwock. -{Feel free to copy from other ZIPs doing similar things, e.g. defining RPC calls, -consensus rules, etc.} +Comparison of ZIPs to RFCs +-------------------------- + +Like RFCs, ZIPs are precise technical documents that SHOULD give enough +implementation information to implement part of a Zcash-related protocol or follow a +Zcash-related process. + +ZIPs are different from RFCs in the following ways: + +* Many (but not all) ZIPs are "living documents"; they are updated in-place as + the relevant areas of the protocol or process change. Unlike in the RFC process, + making a change in an area described by a published ZIP does not *necessarily* + require creating a new ZIP, although that is an option if the change is extensive + enough to warrant it. +* The expected structure of a ZIP is more constrained than an RFC. For example, + the Specification section is REQUIRED, and all of the conformance requirements + MUST go in that section. The ZIP editors will help you to ensure that things + go in the right sections. +* Security considerations SHOULD be spread throughout the text, in the places + where they are most relevant. + +Using mathematical notation +--------------------------- + +Embedded :math:`\LaTeX` is allowed and encouraged in ZIPs. The syntax for inline +math is "``:math:`latex code```" in reStructuredText or "``$latex code$``" in +Markdown. The rendered HTML will use KaTeX [#katex]_, which only supports a subset +of :math:`\LaTeX\!`, so you will need to double-check that the rendering is as +intended. + +In general the conventions in the Zcash protocol specification SHOULD be followed. +If you find this difficult, don't worry too much about it in initial drafts; the +ZIP editors will catch any inconsistencies in review. Valid reStructuredText ---------------------- @@ -127,6 +175,18 @@ Then, with ``zip-xxxx.rst`` in the root directory of a clone of this repo, run:: (or just ``make``) and view ``zip-xxxx.html`` in a web browser. +Conventions for references +-------------------------- + +For references to the Zcash protocol specification, prefer to link to a section +anchor, and name the reference as ``[#protocol-]``. This makes it more likely +that the link will remain valid if sections are renumbered or if content is moved. +The anchors in the protocol specification can be displayed by clicking on a section +heading in most PDF viewers. References to particular sections should be versioned, +even though the link will point to the most recent stable version. + +Do not include the "``https://zips.z.cash/``" part of URLs to ZIPs or the protocol spec. + Reference implementation ======================== @@ -139,6 +199,9 @@ References ========== .. [#RFC2119] `RFC 2119: Key words for use in RFCs to Indicate Requirement Levels `_ -.. [#protocol] `Zcash Protocol Specification, Version 2020.1.24 or later `_ -.. [#protocol-introduction] `Zcash Protocol Specification, Version 2020.1.24. Section 1: Introduction `_ +.. [#protocol] `Zcash Protocol Specification, Version 2022.3.8 or later `_ +.. [#protocol-introduction] `Zcash Protocol Specification, Version 2022.3.8. Section 1: Introduction `_ +.. [#protocol-blockchain] `Zcash Protocol Specification, Version 2022.3.8. Section 3.3: The Block Chain `_ +.. [#protocol-networks] `Zcash Protocol Specification, Version 2022.3.8. Section 3.12: Mainnet and Testnet `_ +.. [#katex] `KaTeX - The fastest math typesetting library for the web `_ .. [#zip-0000] `ZIP 0: ZIP Process `_
47 ZIP 0: ZIP Process