What is Nostr?
ev / Ev
npub13vn…eddx
2023-06-01 16:53:06

ev on Nostr: # Bogbits spec v0.2 Copy and paste from https://nips.zulipchat.com/ --- I have an ...

# Bogbits spec v0.2

Copy and paste from https://nips.zulipchat.com/

---

I have an idea for blob distribution that I think is pretty simple, and I'm not sure if anyone has ever done this before. It'd be good to use an existing thing if it already exists.

Imagine you create a hash of a file.

Next you chop the file up in to tiny chunks, like 1024 bytes or whatever. You hash all of the chunks and create an array that is like:

<thishash><nexthash>

You distribute the hash of the file to your peers, and a hash of the stringified array. You can request the array via the array hash.

Then you iterate over this array broadcasting nexthash until you have all of it from your peers. You push all of the content into a file as it comes in, since you're only requesting one hash at a time and then concatenating it when it arrives.

Eventually you have the entire file, but you might randomly select relays to request it from.

Does anything do this already? I imagine Bittorrent is similar, but probably uses a more complicated algorithm. Maybe IPFS comes close to this, but I don't think it includes the hash of the original file.

Critiques welcome.

---

I guess you could just iterate over the entire thing blasting out nexthash very fast, then store everything that comes back to you that is unique, and then try to put it together over and over until you have everything, broadcasting what never came in.

Eventually the program could fail or timeout if you never get all of the parts back from the network.
Author Public Key
npub13vnc4krt76jp3kafgtlsf75w6derqw43khjzs6mctaa9ehq8kfmsgxeddx