2.2 KiB
2.2 KiB
Status Node Manager Pairing Protocol
Introduction
This documents provides a high-level outline of the pairing protocol that is used to establish a persistent connection between the Nimbus GUI app and the Status node manager. The connection can be established even when both of the endpoints lack public IP addresses and can be maintained without re-configuration even after arbitrary changes to their physical locations. These properties are achieved through the use of the Waku2 communication protocol.
Pairing procedure
The protocol involves the following steps:
- The user initiates the pairing procedure in the GUI app.
- The app generates a 64-bit random number
P
. - Using this number and a key derivation function
kdf(x, salt)
, the app derives a Waku topic nameT = kdf(P, TOPIC_SALT)
and a handshake keyHS = kdf(P, HANDSHAKE_KEY_SALT)
.TOPIC_SALT
andHANDSHAKE_KEY_SALT
are protocol constants. - The app connects to the Waku network using identity key
APP_IDENTITY
and starts listening for messages sent to theT
topic. - The user enters the same number on the machine where the Status node manager is running and the node manager is able to derive the same values for
T
andHS
. - The node manager connects to the Waku network using identity key
NODE_MANAGER_IDENTITY
and sends a messageHELLO_APP = encrypt(HS, node_manager_identity)
to theT
topic. - The app receives the
HELLO_APP
messages and successfully decrypts it usingHS
. The app persistsNODE_MANAGER_IDENTITY
in its local storage. - The app responds by sending the message
HELLO_NODE_MANAGER = encrypt(HS, app_identity)
on theT
topic. - The node manager receives the
HELLO_NODE_MANAGER
message and successfully decrypts it usingHS
. The node manager persistsAPP_IDENTITY
in its local storage. - The node manager tries to establish a Waku Noise Session using the app identity key. The app accepts the session.
- On every consecutive start-up, both sides immediately try to establish noise sessions with all of their persisted counterparties. Incoming sessions from known counterparties are accepted.