-
Notifications
You must be signed in to change notification settings - Fork 14
Waku v2: Briding with waku v1 #159
Comments
Disclaimer: This is a first write up and I'd have to look more into the libp2p side to understand if all is possible, mostly the part regarding the signature (See TBI mentions) is not clear and needs further investigation. Payload bridgingA bridge would require obviously support for both Waku versions:
For Waku v2, most of the envelope fields will be removed. There is no more nonce (to calculate PoW) and expiry and TTL (to calculate when an envelopes is expired) field. For messages flowing from Waku v1 to Waku v2, the usual checks should remain as with normal v1 to v1 relaying:
Next, a new Waku v2 envelope should be created, the payload copied, and the envelope published as message on Waku v2 gossip domain. For messages flowing from v2 to v1, the bridge will have to create a Waku v1 envelope. It will have to set a new expiry/ttl and it will have to do the, limited, PoW calculation. Payload encryption removal and passing of signatureupdate: This section is obsolete, see #159 (comment) So the idea is to remove the encryption in Waku v2, and to leave this to the layer up (where it is also done for encryption in e.g. the Status application) E.g.
For Waku v1 side:
For Waku v1-v2 bridge:
And eventually, the decryption step in Waku v2 can be removed once v1 and bridge is dropped. However, to avoid the annoyance of having to support the old envelope data format & having to either get the signature at libp2p PubSub or at payload level, the step of removing the encryption could also be done from one v1 version to another v1 version. Note: It is still under discussion if we should leave the option for optional encryption in Waku v2 open. So this is more a discussion about how the Status application/specification should use it. And it will also require additional changes, e.g. waku-org/nwaku#39 (comment) |
Update: Anyhow, this means that we could move both signing & encryption to the layer up, which makes more sense as it is more clearly separated. For the bridge it is just a matter of passing along the data field of Waku v1 to the payload field of Waku v2, and vice versa. The filters in v2 will not be able trigger purely on whether it can decrypt. This is for a layer higher. The logic currently in Waku v1 [envelope data format spec] (https://github.com/vacp2p/specs/blob/master/specs/waku/envelope-data-format.md) will need to be repeated on the application side when using Waku v2, for messages originating from a Waku v1 client. A question that remains is where to do the signing. Currently it is before Waku v1 encryption, but when Waku encryption is removed, is it still fine to leave the signature there without the Waku encryption? |
@kdeme Any update on this? |
Problem
Waku v2 will run on libp2p (Flood/GossipSub + request - response protocol(s) ).
Waku v1 is a "capability" on devp2p/rlpx.
As it currently is specified, the
envelope
structure will also change.This issue is about investigating how a bridge can work, transferring back and forth these different envelopes, maintaining the payloads.
Acceptance criteria
Lay out how a bridge between these networks can work.
The text was updated successfully, but these errors were encountered: