Skip to content

Commit

Permalink
Move ZIP source into zips/ subdirectory
Browse files Browse the repository at this point in the history
This makes the repo root more approachable for newcomers; the README can
be seen in GitHub immediately instead of after much scrolling.
  • Loading branch information
str4d committed Jul 16, 2024
1 parent 080306b commit 26f16f4
Show file tree
Hide file tree
Showing 111 changed files with 134 additions and 131 deletions.
18 changes: 9 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

.PHONY: all all-zips tag-release protocol discard
all-zips: .Makefile.uptodate
echo "$(sort $(wildcard zip-*.rst) $(wildcard zip-*.md))" >.zipfilelist.new
echo "$(patsubst zips/%,%,$(sort $(wildcard zips/zip-*.rst) $(wildcard zips/zip-*.md)))" >.zipfilelist.new
diff .zipfilelist.current .zipfilelist.new || cp -f .zipfilelist.new .zipfilelist.current
rm -f .zipfilelist.new
echo "$(sort $(wildcard draft-*.rst) $(wildcard draft-*.md))" >.draftfilelist.new
echo "$(patsubst zips/%,%,$(sort $(wildcard zips/draft-*.rst) $(wildcard zips/draft-*.md)))" >.draftfilelist.new
diff .draftfilelist.current .draftfilelist.new || cp -f .draftfilelist.new .draftfilelist.current
rm -f .draftfilelist.new
$(MAKE) README.rst
$(MAKE) rendered/index.html $(addprefix rendered/,$(addsuffix .html,$(filter-out README,$(basename $(sort $(wildcard *.rst) $(wildcard *.md))))))
$(MAKE) rendered/index.html $(addprefix rendered/,$(addsuffix .html,$(basename $(patsubst zips/%,%,$(sort $(wildcard zips/*.rst) $(wildcard zips/*.md))))))

all: all-zips protocol

Expand All @@ -27,27 +27,27 @@ discard:
touch .Makefile.uptodate

define PROCESSRST
$(eval TITLE := $(shell echo '$(basename $<)' | sed -E 's|zip-0{0,3}|ZIP |;s|draft-|Draft |')$(shell grep -E '^(\.\.)?\s*Title: ' $< |sed -E 's|.*Title||'))
$(eval TITLE := $(shell echo '$(patsubst zips/%,%,$(basename $<))' | sed -E 's|zip-0{0,3}|ZIP |;s|draft-|Draft |')$(shell grep -E '^(\.\.)?\s*Title: ' $< |sed -E 's|.*Title||'))
rst2html5 -v --title="$(TITLE)" $< >$@
./edithtml.sh --rst $@
endef

define PROCESSMD
$(eval TITLE := $(shell echo '$(basename $<)' | sed -E 's|zip-0{0,3}|ZIP |;s|draft-|Draft |')$(shell grep -E '^(\.\.)?\s*Title: ' $< |sed -E 's|.*Title||'))
$(eval TITLE := $(shell echo '$(patsubst zips/%,%,$(basename $<))' | sed -E 's|zip-0{0,3}|ZIP |;s|draft-|Draft |')$(shell grep -E '^(\.\.)?\s*Title: ' $< |sed -E 's|.*Title||'))
pandoc --from=markdown --to=html $< --output=$@
./edithtml.sh --md $@ "${TITLE}"
endef

rendered/index.html: README.rst edithtml.sh
$(PROCESSRST)

rendered/%.html: %.rst edithtml.sh
rendered/%.html: zips/%.rst edithtml.sh
$(PROCESSRST)

rendered/%.html: %.md edithtml.sh
rendered/%.html: zips/%.md edithtml.sh
$(PROCESSMD)

README.rst: .zipfilelist.current .draftfilelist.current makeindex.sh README.template $(wildcard zip-*.rst) $(wildcard zip-*.md) $(wildcard draft-*.rst) $(wildcard draft-*.md)
README.rst: .zipfilelist.current .draftfilelist.current makeindex.sh README.template $(wildcard zips/zip-*.rst) $(wildcard zips/zip-*.md) $(wildcard zips/draft-*.rst) $(wildcard zips/draft-*.md)
./makeindex.sh | cat README.template - >README.rst

.PHONY: linkcheck
Expand All @@ -57,4 +57,4 @@ linkcheck: all-zips

.PHONY: clean
clean:
rm -f .zipfilelist.* README.rst rendered/index.html $(addprefix rendered/,$(addsuffix .html,$(basename $(sort $(wildcard *.rst) $(wildcard *.md)))))
rm -f .zipfilelist.* README.rst rendered/index.html $(addprefix rendered/,$(addsuffix .html,$(basename $(patsubst zips/%,%,$(sort $(wildcard zips/*.rst) $(wildcard zips/*.md))))))
202 changes: 101 additions & 101 deletions README.rst

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions README.template
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ Conduct <https://github.com/zcash/zcash/blob/master/code_of_conduct.md>`__.

The Zcash protocol is documented in its `Protocol Specification <rendered/protocol/protocol.pdf>`__.

To start contributing, first read `ZIP 0 <zip-0000.rst>`__ which documents the ZIP process.
To start contributing, first read `ZIP 0 <zips/zip-0000.rst>`__ which documents the ZIP process.
Then clone `this repo <https://github.com/zcash/zips>`__ from GitHub, and start adding
your draft ZIP, formatted either as reStructuredText or as Markdown.
your draft ZIP, formatted either as reStructuredText or as Markdown, into the `zips/` directory.

For example, if using reStructuredText, use a filename matching ``draft-*.rst``.
For example, if using reStructuredText, use a filename matching ``zips/draft-*.rst``.
Use ``make`` to check that you are using correct
`reStructuredText <https://docutils.sourceforge.io/rst.html>`__ or
`Markdown <https://pandoc.org/MANUAL.html#pandocs-markdown>`__ syntax,
Expand Down
3 changes: 2 additions & 1 deletion edithtml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ sed -i.sedbak 's|<a \(class=[^ ]* \)*href="\([^":]*\)\.rst\(\#[^"]*\)*">|<a \1hr
sed -i.sedbak 's|<a \(class=[^ ]* \)*href="\([^":]*\)\.md\(\#[^"]*\)*">|<a \1href="\2\3">|g' "$2"
sed -i.sedbak 's|&lt;\(https:[^&]*\)&gt;|\&lt;<a href="\1">\1</a>\&gt;|g' "$2"

sed -i.sedbak 's|src="rendered/|src="|g' "$2"
sed -i.sedbak 's|src="../rendered/|src="|g' "$2"
sed -i.sedbak 's|<a href="rendered/|<a href="|g' "$2"
sed -i.sedbak 's|<a \(class=[^ ]* \)*href="zips/|<a \1href="|g' "$2"

perl -i.sedbak -p0e 's|<section id="([^"]*)">\s*.?\s*<h([1-9])>([^<]*(?:<code>[^<]*</code>[^<]*)?)</h([1-9])>|<section id="\1"><h\2><span class="section-heading">\3</span><span class="section-anchor"> <a rel="bookmark" href="#\1"><img width="24" height="24" class="section-anchor" src="assets/images/section-anchor.png" alt=""></a></span></h\4>|g' "$2"

Expand Down
2 changes: 2 additions & 0 deletions makeindex.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Index of ZIPs
<tr> <th>ZIP</th> <th>Title</th> <th>Status</th> </tr>
EndOfHeader
for zipfile in $(cat .zipfilelist.current); do
zipfile=zips/$zipfile
echo Adding $zipfile to index. >/dev/stderr
if grep -E '^\s*Status:\s*Reserved' $zipfile >/dev/null; then
echo " <tr> <td><span class=\"reserved\">`basename $(basename $zipfile .rst) .md | sed -E 's@zip-0{0,3}@@'`</span></td> <td class=\"left\"><a class=\"reserved\" href=\"`echo $zipfile`\">`grep '^\s*Title:' $zipfile | sed -E 's@\s*Title:\s*@@'`</a></td> <td>`grep '^\s*Status:' $zipfile | sed -E 's@\s*Status:\s*@@'`</td>"
Expand Down Expand Up @@ -40,6 +41,7 @@ be deleted.
<tr> <th>Title</th> </tr>
EndOfDraftHeader
for draftfile in $(cat .draftfilelist.current); do
draftfile=zips/$draftfile
echo Adding $draftfile to index of drafts. >/dev/stderr
echo " <tr> <td class=\"left\"><a href=\"`echo $draftfile`\">`grep '^\s*Title:' $draftfile | sed -E 's@\s*Title:\s*@@'`</a></td>"
done
Expand Down
4 changes: 2 additions & 2 deletions rendered/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
<p>Anyone can write a ZIP! We encourage community contributions and decentralization of work on the Zcash protocol. If you’d like to bounce ideas off people before formally writing a ZIP, we encourage it! Visit the <a href="https://discord.gg/kdjfvps">ZcashCommunity Discord chat</a> to talk about your idea.</p>
<p>Participation in the Zcash project is subject to a <a href="https://github.com/zcash/zcash/blob/master/code_of_conduct.md">Code of Conduct</a>.</p>
<p>The Zcash protocol is documented in its <a href="protocol/protocol.pdf">Protocol Specification</a>.</p>
<p>To start contributing, first read <a href="zip-0000">ZIP 0</a> which documents the ZIP process. Then clone <a href="https://github.com/zcash/zips">this repo</a> from GitHub, and start adding your draft ZIP, formatted either as reStructuredText or as Markdown.</p>
<p>For example, if using reStructuredText, use a filename matching <code>draft-*.rst</code>. Use <code>make</code> to check that you are using correct <a href="https://docutils.sourceforge.io/rst.html">reStructuredText</a> or <a href="https://pandoc.org/MANUAL.html#pandocs-markdown">Markdown</a> syntax, and double-check the generated <code>rendered/draft-*.html</code> file before filing a Pull Request. See <a href="protocol/README">here</a> for the project dependencies.</p>
<p>To start contributing, first read <a href="zip-0000">ZIP 0</a> which documents the ZIP process. Then clone <a href="https://github.com/zcash/zips">this repo</a> from GitHub, and start adding your draft ZIP, formatted either as reStructuredText or as Markdown, into the <cite>zips/</cite> directory.</p>
<p>For example, if using reStructuredText, use a filename matching <code>zips/draft-*.rst</code>. Use <code>make</code> to check that you are using correct <a href="https://docutils.sourceforge.io/rst.html">reStructuredText</a> or <a href="https://pandoc.org/MANUAL.html#pandocs-markdown">Markdown</a> syntax, and double-check the generated <code>rendered/draft-*.html</code> file before filing a Pull Request. See <a href="protocol/README">here</a> for the project dependencies.</p>
</section>
<section id="license"><h2><span class="section-heading">License</span><span class="section-anchor"> <a rel="bookmark" href="#license"><img width="24" height="24" class="section-anchor" src="assets/images/section-anchor.png" alt=""></a></span></h2>
<p>Unless otherwise stated in this repository’s individual files, the contents of this repository are released under the terms of the MIT license. See <a href="COPYING">COPYING</a> for more information or see <a href="https://opensource.org/licenses/MIT">https://opensource.org/licenses/MIT</a> .</p>
Expand Down
16 changes: 8 additions & 8 deletions rendered/zip-0315.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,21 @@
<p>It is RECOMMENDED that wallets only hold funds as shielded in the long term; that is, if a wallet supports receiving transparent funds (or supports importing a seed from another wallet that might have done so), then it SHOULD auto-shield such funds by default.</p>
<p>A shielding transaction is always linked to the transparent addresses it spends from. This can cause undesirable information leaks: a) if there are multiple transparent addresses, they will be linked to each</p>
<div>
<h1>System Message: ERROR/3 (zip-0315.rst line 136)</h1>
<h1>System Message: ERROR/3 (zips/zip-0315.rst line 136)</h1>
<p>Unexpected indentation.</p>
</div>
<blockquote>
<p>other;</p>
</blockquote>
<div>
<h1>System Message: WARNING/2 (zip-0315.rst line 137)</h1>
<h1>System Message: WARNING/2 (zips/zip-0315.rst line 137)</h1>
<p>Block quote ends without a blank line; unexpected unindent.</p>
</div>
<ol suffix=")" start="2" type="a">
<li>a link between the input transparent address(es) and the payment will be visible to the recipient(s), or to any other holder of an Incoming Viewing Key for the destination address(es).</li>
</ol>
<div>
<h1>System Message: INFO/1 (zip-0315.rst line 123)</h1>
<h1>System Message: INFO/1 (zips/zip-0315.rst line 123)</h1>
<p>Enumerated list start value not ordinal-1: "b" (ordinal 2)</p>
</div>
<p>Despite the fact that it is not possible to achieve strong privacy guarantees from <em>any</em> use of transparent addresses, it is undesirable to reveal this additional information. In particular, issue b) motivates ruling out the use of "opportunistic shielding", i.e. shielding previously received transparent funds as part of a user-initiated transaction.</p>
Expand Down Expand Up @@ -167,14 +167,14 @@ <h1>System Message: INFO/1 (zip-0315.rst line 123)</h1>
<section id="sent-transactions"><h4><span class="section-heading">Sent transactions</span><span class="section-anchor"> <a rel="bookmark" href="#sent-transactions"><img width="24" height="24" class="section-anchor" src="assets/images/section-anchor.png" alt=""></a></span></h4>
<p>A transaction is sent if it was either: * created by the wallet, or * detected by using the wallet's outgoing viewing keys to decrypt</p>
<div>
<h1>System Message: ERROR/3 (zip-0315.rst line 308)</h1>
<h1>System Message: ERROR/3 (zips/zip-0315.rst line 308)</h1>
<p>Unexpected indentation.</p>
</div>
<blockquote>
<p>Sapling or Orchard outputs, or</p>
</blockquote>
<div>
<h1>System Message: WARNING/2 (zip-0315.rst line 309)</h1>
<h1>System Message: WARNING/2 (zips/zip-0315.rst line 309)</h1>
<p>Block quote ends without a blank line; unexpected unindent.</p>
</div>
<ul>
Expand Down Expand Up @@ -401,15 +401,15 @@ <h1>System Message: WARNING/2 (zip-0315.rst line 309)</h1>
<section class="system-messages">
<h1>Docutils System Messages</h1>
<div id="system-message-1">
<h1>System Message: ERROR/3 (zip-0315.rst line 65)</h1>
<h1>System Message: ERROR/3 (zips/zip-0315.rst line 65)</h1>
<p>Too many autonumbered footnote references: only 0 corresponding footnotes available.</p>
</div>
<div id="system-message-2">
<h1>System Message: ERROR/3 (zip-0315.rst line 65) <a href="#footnote-reference-2">footnote-reference-2</a></h1>
<h1>System Message: ERROR/3 (zips/zip-0315.rst line 65) <a href="#footnote-reference-2">footnote-reference-2</a></h1>
<p>Unknown target name: "zip-0032".</p>
</div>
<div id="system-message-3">
<h1>System Message: ERROR/3 (zip-0315.rst line 65) <a href="#footnote-reference-3">footnote-reference-3</a></h1>
<h1>System Message: ERROR/3 (zips/zip-0315.rst line 65) <a href="#footnote-reference-3">footnote-reference-3</a></h1>
<p>Unknown target name: "zip-0316".</p>
</div>
</section>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions zip-0032.rst → zips/zip-0032.rst
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ The values of :math:`I`, :math:`I_\mathsf{nsk}`, and :math:`R` are the same betw
a full viewing key, and deriving the corresponding spending key. Both of these derivations
are shown in the following diagram:

.. figure:: rendered/assets/images/zip-0032-sapling-internal-key-derivation.png
.. figure:: ../rendered/assets/images/zip-0032-sapling-internal-key-derivation.png
:width: 900px
:align: center
:figclass: align-center
Expand Down Expand Up @@ -432,7 +432,7 @@ field relative to the external full viewing key, which results in different
fields being derived, as specified in [#protocol-orchardkeycomponents]_ and shown in the following
diagram:

.. figure:: rendered/assets/images/zip-0032-orchard-internal-key-derivation.png
.. figure:: ../rendered/assets/images/zip-0032-orchard-internal-key-derivation.png
:width: 720px
:align: center
:figclass: align-center
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
4 changes: 2 additions & 2 deletions zip-0227.rst → zips/zip-0227.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ The Orchard-ZSA Protocol adds the following keys to the key components [#protoco

The relations between these keys are shown in the following diagram:

.. figure:: rendered/assets/images/zip-0227-key-components-zsa.png
.. figure:: ../rendered/assets/images/zip-0227-key-components-zsa.png
:width: 450px
:align: center
:figclass: align-center
Expand Down Expand Up @@ -201,7 +201,7 @@ where :math:`\mathsf{GroupHash}^\mathbb{P}` is defined as in [#protocol-concrete

The relations between the Asset Identifier, Asset Digest, and Asset Base are shown in the following diagram:

.. figure:: rendered/assets/images/zip-0227-asset-identifier-relation.png
.. figure:: ../rendered/assets/images/zip-0227-asset-identifier-relation.png
:width: 600px
:align: center
:figclass: align-center
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion zip-0307.rst → zips/zip-0307.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ There are three logical components to a Zcash light client system:
update its own view of the chain state. The light client MAY be attached to a wallet
backend that will track particular Sapling notes.

.. figure:: rendered/assets/images/zip-0307-arch.png
.. figure:: ../rendered/assets/images/zip-0307-arch.png
:align: center
:figclass: align-center

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
4 changes: 2 additions & 2 deletions zip-0316.rst → zips/zip-0316.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,7 @@ concatenation of
:math:`\mathsf{I2LEOSP}_{16}(j), u) \text{ for } j \text{ from}`
:math:`0 \text{ up to } \mathsf{ceiling}(\ell_R/\ell_H)-1].`

.. figure:: rendered/assets/images/zip-0316-f4.png
.. figure:: ../rendered/assets/images/zip-0316-f4.png
:width: 372px
:align: center
:figclass: align-center
Expand Down Expand Up @@ -1158,7 +1158,7 @@ Heuristic analysis

A 3-round unkeyed Feistel, as shown, is not sufficient:

.. figure:: rendered/assets/images/zip-0316-f3.png
.. figure:: ../rendered/assets/images/zip-0316-f3.png
:width: 372px
:align: center
:figclass: align-center
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 26f16f4

Please sign in to comment.