From 90bef6fa4752add96bff7ebf016d247cc120c34d Mon Sep 17 00:00:00 2001 From: Max Inden Date: Mon, 4 Oct 2021 17:35:51 +0200 Subject: [PATCH] relay/circuit-v2: Move /p2p/QmTarget to the end of Multiaddr --- relay/circuit-v2.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/relay/circuit-v2.md b/relay/circuit-v2.md index 40c956f62..3660dd673 100644 --- a/relay/circuit-v2.md +++ b/relay/circuit-v2.md @@ -300,8 +300,8 @@ Instead of negotiating the security protocol in-band, security protocols should be encapsulated in the multiaddr (see [The multiaddr security component section](../addressing/README.md#the-multiaddr-security-component)). A relayed connection is not an exception. A target advertises the support for a security -protocol for relayed connections by appending -`/p2p-circuit-security/` to its relayed multiaddresses. An +protocol for relayed connections by including +`/p2p-circuit-security/` in its relayed multiaddresses. An initiator may include any set of relayed multiaddr in the `peer` field of `HopMessage` on type `CONNECT` in which all addresses end with the same `/p2p-circuit-security/`. The initiator is thus signaling to the @@ -312,10 +312,10 @@ As an example, let's say the target listens for incoming relayed connections via relay `R1` and relay `R2`. In addition it supports both TLS Noise as security protocols. It would then advertise the following relayed multiaddresses: -- `/p2p-circuit/p2p/QmTarget/p2p-circuit-security/tls` -- `/p2p-circuit/p2p/QmTarget/p2p-circuit-security/noise` -- `/p2p-circuit/p2p/QmTarget/p2p-circuit-security/tls` -- `/p2p-circuit/p2p/QmTarget/p2p-circuit-security/noise` +- `/p2p-circuit/p2p-circuit-security/tls/p2p/QmTarget` +- `/p2p-circuit/p2p-circuit-security/noise/p2p/QmTarget` +- `/p2p-circuit/p2p-circuit-security/tls/p2p/QmTarget` +- `/p2p-circuit/p2p-circuit-security/noise/p2p/QmTarget` Once the initiator received the above multiaddresses and decides to initiate a relayed connection to the target, it needs to decide whether it wants to secure @@ -323,8 +323,8 @@ the relayed connection via TLS or Noise. Say it decides for Noise it would then include the multiaddresses below in it `HopMessage` with type `Connect` in the `peer` field: -- `/p2p-circuit/p2p/QmTarget/p2p-circuit-security/noise` -- `/p2p-circuit/p2p/QmTarget/p2p-circuit-security/noise` +- `/p2p-circuit/p2p-circuit-security/noise/p2p/QmTarget` +- `/p2p-circuit/p2p-circuit-security/noise/p2p/QmTarget` Note that all addresses sent by the initiator in the `peer` field MUST share the same security protocol for the relayed connection