commit 9793b6e8bdeb3f761213b4990358db15cbe22cfd
parent 97e2c29f737449ed06bdb4856356ccbe9966da30
Author: Martin Schanzenbach <schanzen@gnunet.org>
Date: Thu, 3 Mar 2022 18:33:45 +0100
add path elements
Diffstat:
1 file changed, 123 insertions(+), 3 deletions(-)
diff --git a/draft-schanzen-r5n.xml b/draft-schanzen-r5n.xml
@@ -823,6 +823,126 @@ Connectivity | |Underlay| |Underlay|
<name>Extended query</name>
<t>TODO: Talk about XQuery in the context of messages.</t>
</section>
+ <section anchor="p2p_pathelement">
+ <name>Path Element</name>
+ <t>
+ A Path Element represents a hop in the path a message as taken
+ through the network.
+ An ordered list of Path Elements may be appended to any routed
+ message.
+ A Path Element identifies a peer on the path.
+ The Path Element is signed by the next peer on the path.
+ This signature is also part of the Path Element along with the
+ Peer ID of the previous peer.
+ </t>
+ <t>
+ The public key of the peer which created the signature is in the
+ next path element, or is the sender of the message if this was the
+ last path element.
+ The wire format of a Path Element is illustrated in
+ <xref target="figure_pathelement"/>.
+ </t>
+ <figure anchor="figure_pathelement" title="The Wire Format of a Path Element.">
+ <artwork name="" type="" align="left" alt=""><![CDATA[
+0 8 16 24 32 40 48 56
++-----+-----+-----+-----+-----+-----+-----+-----+
+| PEER PREDECESSOR |
+| (32 byte) |
+| |
+| |
++-----+-----+-----+-----+-----+-----+-----+-----+
+| SIGNATURE |
+| (64 byte) |
+| |
+| |
+| |
+| |
+| |
+| |
++-----+-----+-----+-----+-----+-----+-----+-----+
+ ]]></artwork>
+ </figure>
+ <t>where:</t>
+ <dl>
+ <dt>PEER PREDECESSOR</dt>
+ <dd>
+ is the Peer ID of the previous hop.
+ </dd>
+ <dt>SIGNATURE</dt>
+ <dd>
+ is a 64 byte EdDSA signature using the current hop's private
+ key affirming the previous hop.
+ </dd>
+ </dl>
+ <t>
+ The SIGNATURE covers a 64-bit pseudo header
+ conceptually prefixed to the block expiration, a hash of the block
+ payload, as well as the predecessor peer ID and the peer ID of the
+ peer creating the signature.
+ The wire format is illustrated
+ in <xref target="figure_pathelewithpseudo"/>.
+ </t>
+ <figure anchor="figure_pathelewithpseudo" title="The Wire Format of the Path Element for Signing.">
+ <artwork name="" type="" align="left" alt=""><![CDATA[
+0 8 16 24 32 40 48 56
++-----+-----+-----+-----+-----+-----+-----+-----+
+| SIZE | PURPOSE |
++-----+-----+-----+-----+-----+-----+-----+-----+
+| EXPIRATION |
++-----+-----+-----+-----+-----+-----+-----+-----+
+| BLOCK HASH |
+| (64 byte) |
+| |
+| |
+| |
+| |
+| |
+| |
++-----+-----+-----+-----+-----+-----+-----+-----+
+| PEER PREDECESSOR |
+| (32 byte) |
+| |
+| |
++-----+-----+-----+-----+-----+-----+-----+-----+
+| PEER SUCCESSOR |
+| (32 byte) |
+| |
+| |
++-----+-----+-----+-----+-----+-----+-----+-----+
+ ]]></artwork>
+ </figure>
+ <dl>
+ <dt>SIZE</dt>
+ <dd>
+ A 32-bit value containing the length of the signed data in bytes
+ in network byte order.
+ The length of the signed data <bcp14>MUST</bcp14> be 144 bytes.
+ </dd>
+ <dt>PURPOSE</dt>
+ <dd>
+ A 32-bit signature purpose flag. This field <bcp14>MUST</bcp14> be 6 (in network
+ byte order).
+ </dd>
+ <dt>EXPIRATION</dt>
+ <dd>
+ denotes the absolute 64-bit expiration date of the HELLO.
+ In microseconds since midnight (0 hour), January 1, 1970 UTC in
+ network byte order.
+ </dd>
+ <dt>BLOCK HASH</dt>
+ <dd>
+ a SHA-512 hash over the block payload.
+ </dd>
+ <dt>PEER PREDECESSOR</dt>
+ <dd>
+ the Peer ID of the previous hop.
+ </dd>
+ <dt>PEER SUCCECSSOR</dt>
+ <dd>
+ the Peer ID of the signer.
+ </dd>
+ </dl>
+ </section>
<section anchor="p2p_hello" numbered="true" toc="default">
<name>HelloMessage</name>
<section anchor="p2p_hello_wire">
@@ -991,7 +1111,7 @@ Connectivity | |Underlay| |Underlay|
<dt>PUTPATH</dt>
<dd>
the variable-length PUT path.
- The path consists of a list of PATH_LEN peer addresses.
+ The path consists of a list of PATH_LEN Path Elements.
</dd>
<dt>BLOCK</dt>
<dd>
@@ -1296,12 +1416,12 @@ Connectivity | |Underlay| |Underlay|
<dt>PUTPATH</dt>
<dd>
the variable-length PUT path.
- The path consists of a list of PATH_LEN peer addresses.
+ The path consists of a list of PATH_LEN Path Elements.
</dd>
<dt>GETPATH</dt>
<dd>
the variable-length PUT path.
- The path consists of a list of PATH_LEN peer addresses.
+ The path consists of a list of PATH_LEN Path Elements.
</dd>
<dt>BLOCK</dt>
<dd>