Stake Weighted Scan
When a peer wants to identify their Seeker Node, they query the blockchain using a “scan” function. This function takes the peer ID as input and pseudo-randomly assigns them a Node. The scan function does this using the following steps:
Multiply the total amount of stake in the stake tree by this random number, to produce a number between 0 and
total_staked
.Binary search the stake directory to find which node is associated with the number produced above, returning that node.
This scan function allows anyone who knows your peer ID to efficiently identify your node for a given Epoch, and therefore identify which Seeker Node will accept a relay message for you.
It also ensures that Seeker Nodes are able to tell when a relay message is unlikely to be collected. If the recipient scans to a different Seeker Node, then it is unlikely that the recipient will come to this Node to collect it. This incentivises nodes to only provide services to peers that “scan” to them, and incentivises peers to only use their assigned node.
Last updated