getSectorNodes (18)

Finalized

The getSectorNodes message requests presence records (relay-capable nodes) responsible for a given network "sector".

Sectors enable sharded routing. A sector is identified by a 10‑byte sectorPrefix, derived from a wallet address: first 10 bytes of SHA3-512(addressNoChecksum). This request lets a node discover appropriate relays for an address without probing the whole network.

Core Data Types

Payload Structure

FieldData TypeMinMaxDescription
sectorPrefixIxiBytes101010-byte sector identifier (first 10 bytes of SHA3-512 of the wallet address without checksum).
maxNodesIxiVarUInt1(capped at 20 by responders)Requested upper bound on returned relay presences. Values >20 are treated as 20.

Behavioral Notes

  • Sent to discover relay-capable peers for a sector (used prior to targeted S2 / streaming routing).
  • Broadcast typically toward master/high-capacity nodes; relay nodes must be excluded from the broadcast set if local node is already a relay/master.
  • Receiving node parses prefix + desired count. If it has cached data for the sector it immediately answers; otherwise it may forward the request upstream (rebroadcast).
  • Responders cap maxNodes at 20.
  • Response (sectorNodes) payload: sectorPrefix (IxiBytes), nodeCount (IxiVarUInt), then nodeCount presence records each as IxiBytes (length-prefixed serialized Presence including endpoints and signatures).
  • Returned presences are relay nodes whose wallet sector prefix matches the requested prefix; receivers may add them to relay sector caches and optionally initiate connections.