Networking

Nodes send mixnet packets to each other using a Substrate notifications protocol. The protocol name is derived from the genesis hash of the blockchain:

/{genesis_hash_hex}/mixnet/1

or (in the case of a blockchain fork):

/{genesis_hash_hex}/{fork_id}/mixnet/1

Notifications with sizes not matching the Sphinx packet size should be discarded. All other notifications should be handled as Sphinx packets.

Nodes should use the peer IDs and external addresses published on the blockchain to connect to mixnodes according to the mixnet topology. If no external addresses have been published for a mixnode, or none of them work, nodes should attempt to discover addresses using the libp2p DHT.

All mixnet node peer IDs should be derived from Ed25519 public keys, "hashed" with the identity function. Nodes may assume this. Note that the peer IDs published on the blockchain and used in forward actions are raw 32-byte Ed25519 public keys.