## Clarification/Example

Here's more on how the multi-relay query would work. Say you want to do a query on multiple relays. You would arbitrarily pick the three relays R1, R2, R3, and randomly assign each one a bucket B1, B2, B3. Then your query to each relay would simply need to designate which bucket you want that relay to be, and how many total buckets you have.

So as any given relay is going thru the result of it's own query all it needs to know is it's hashing into 1 of N buckets (where it knows what N is) and it needs to know if it's functioning as the first bucket, it needs to send bucket 1 records back. If the relay was told it's doing a bucket 2 of N it should send back things that hash into bucket 2, and so on.

So for a 3 Relay system (N=3) we have:

* Relay 1 sends back:

- All Bucket 1 Events (as query results array)

- Merkelized Hash for all Bucket 2 Events (as a string)

- Merkelized Hash for all Bucket 3 Events (as a string)

* Relay 2 sends back:

- All Bucket 2 Events (as query results array)

- Merkelized Hash for all Bucket 1 Events (as a string)

- Merkelized Hash for all Bucket 3 Events (as a string)

* Relay 3 sends back:

- All Bucket 3 Events (as query results array)

- Merkelized Hash for all Bucket 1 Events (as a string)

- Merkelized Hash for all Bucket 2 Events (as a string)

So again it's arbitrary how many Relays you query from and it's arbitrary which relay you randomly make 1, which one is 2, and which one is 3. The only important thing is each relay returns just it's bucket of results, and the merklized hash for all other buckets.

In reality the actual NIP would probably need to say all the Merkelized Hashes can just go in a single array of strings, but it's more clear to enumerate it the way I did above, to make it clear.

So the only additional query criteria parameter would be something like this bucket prop:

```json

{

...

"bucket-target": 1,

"bucket-count": 3

}

```

This would tell the relay: "Query as if you're bucket 1 of 3", and send back only bucket 1 Events, and merkel hashes for buckets 2, 3.

Reply to this note

Please Login to reply.

Discussion

No replies yet.