Avatar
Clay Ferguson
89482c018acff70163b55de55690783a5f30dcf27fd142f93a089610589342cd
Software Developer. Dallas TX. Creator of Quanta Web Platform. https://quanta.wiki

`By: Clay Ferguson, May 14, 2023`

# Nostr Merkel+Modulo Balanced Query (MMBQ)

`Caveat: There will be a new version of this doc that uses MurmurHash instead Modulo for generating buckets, but that's a trivial alteration of the algo.`

The following is an explanation of two ways to deal with retrieval of Nostr Events from multiple relays, designed to get all information from all relays, and ensure all information is gotten, and to ensure no duplicate data is transferred from multiple relays.

In other words we want to avoid getting the same data from multiple relays, in cases where all relays are in sync relative to the results of a given query.

I'm not claiming to have invented the concept of using Merkle Trees for syncing, I'm just attempting to lay out the precise and simplest possible way I can see this technique of Merkle Sync being applied to Nostr Relays. No one in the Nostr community is going to want to jump to a big merkle tree for all data, *but* applying the optimization I describe below seems like a great way to distribute load (load balance) across Relays *and* check for "in sync" or "not in sync" across relays too.

https://quanta.wiki/mobile/api/bin/6461649f07725530e5c83cc2?nodeId=646154a307725530e5c8394e

`By: Clay Ferguson, May 14, 2023`

# Nostr Merkel+Modulo Balanced Query (MMBQ)

`Caveat: There will be a new version of this doc that uses MurmurHash instead Modulo for generating buckets, but that's a trivial alteration of the algo.`

The following is an explanation of two ways to deal with retrieval of Nostr Events from multiple relays, designed to get all information from all relays, and ensure all information is gotten, and to ensure no duplicate data is transferred from multiple relays.

In other words we want to avoid getting the same data from multiple relays, in cases where all relays are in sync relative to the results of a given query.

I'm not claiming to have invented the concept of using Merkle Trees for syncing, I'm just attempting to lay out the precise and simplest possible way I can see this technique of Merkle Sync being applied to Nostr Relays. No one in the Nostr community is going to want to jump to a big merkle tree for all data, *but* applying the optimization I describe below seems like a great way to distribute load (load balance) across Relays *and* check for "in sync" or "not in sync" across relays too.

https://quanta.wiki/mobile/api/bin/6461649f07725530e5c83cc2?nodeId=646154a307725530e5c8394e

`By: Clay Ferguson, May 14, 2023`

# Nostr Merkel+Modulo Balanced Query (MMBQ)

`There will be a new version of this doc that uses MurmurHash instead Modulo for generating buckets`

The following is an explanation of two ways to deal with retrieval of Nostr Events from multiple relays, designed to get all information from all relays, and ensure all information is gotten, and to ensure no duplicate data is transferred from multiple relays.

In other words we want to avoid getting the same data from multiple relays, in cases where all relays are in sync relative to the results of a given query.

I'm not claiming to have invented the concept of using Merkle Trees for syncing, I'm just attempting to lay out the precise and simplest possible way I can see this technique of Merkle Sync being applied to Nostr Relays. No one in the Nostr community is going to want to jump to a big merkle tree for all data, *but* applying the optimization I describe below seems like a great way to distribute load (load balance) across Relays *and* check for "in sync" or "not in sync" across relays too.

https://quanta.wiki/mobile/api/bin/6461649f07725530e5c83cc2?nodeId=646154a307725530e5c8394e

`By: Clay Ferguson, May 14, 2023`

# Nostr Merkel+Modulo Balanced Query (MMBQ)

The following is an explanation of two ways to deal with retrieval of Nostr Events from multiple relays, designed to get all information from all relays, and ensure all information is gotten, and to ensure no duplicate data is transferred from multiple relays.

In other words we want to avoid getting the same data from multiple relays, in cases where all relays are in sync relative to the results of a given query.

I'm not claiming to have invented the concept of using Merkle Trees for syncing, I'm just attempting to lay out the precise and simplest possible way I can see this technique of Merkle Sync being applied to Nostr Relays. No one in the Nostr community is going to want to jump to a big merkle tree for all data, *but* applying the optimization I describe below seems like a great way to distribute load (load balance) across Relays *and* check for "in sync" or "not in sync" across relays too.

https://quanta.wiki/mobile/api/bin/6461649f07725530e5c83cc2?nodeId=646154a307725530e5c8394e

`By: Clay Ferguson, May 14, 2023`

# Nostr Merkel+Modulo Balanced Query (MMBQ)

The following is an explanation of two ways to deal with retrieval of Nostr Events from multiple relays, designed to get all information from all relays, and ensure all information is gotten, and to ensure no duplicate data is transferred from multiple relays.

In other words we want to avoid getting the same data from multiple relays, in cases where all relays are in sync relative to the results of a given query.

I'm not claiming to have invented the concept of using Merkle Trees for syncing, I'm just attempting to lay out the precise and simplest possible way I can see this technique of Merkle Sync being applied to Nostr Relays. No one in the Nostr community is going to want to jump to a big merkle tree for all data, *but* applying the optimization I describe below seems like a great way to distribute load (load balance) across Relays *and* check for "in sync" or "not in sync" across relays too.

https://quanta.wiki/mobile/api/bin/6461649f07725530e5c83cc2?nodeId=646154a307725530e5c8394e

##### Clay Ferguson

----

**About Me:**

Web developer working in Java/TypeScript/React. Creator of Quanta.wiki.

Fediverse: clay@quanta.wiki

https://quanta.wiki/mobile/api/bin/635343c06226e97165be9b23?nodeId=635317206226e97165be8cab

Well it's definitely "mostly working"! :)

Sending this test at 7:36 using message button on user profile.

Yep got it! It's working great.

sending you this now after you're following me.

This is a test from message button on profile dialog.

this is a test 7:20pm

hello world. This is a nostr test.

#[0]

Second nostr test. 5/2/23

#[0] #[1]

Hi guys. This is a test from Quanta!

#[0] #[1]

Hey Melvin! I just deployed a Quanta version that does some Nostr. It has a few bugs and isn't ready for prime time, but I'm sending you this message via my Quanta app!

Hello World. This is my first Nostr post from Quanta.