Five on Nostr: Dev story time: How SatShoot ended up using partial #outbox model: Using NIP65 relay ...
Dev story time: How SatShoot ended up using partial #outbox model:
Using NIP65 relay lists to decentralize discovery looks like a fantastic concept at first...
And then you realize that most things taken to extremes ends up in the complete opposite way you intended.
This is true for the outbox model. You want decentralization. Maybe you convinced a lot of people to publish outbox relay lists (BIG maybe), so far so good. Still, you ended up with an app that connects to hundreds of relays **and keeps those connections alive**.
Problems: - app uses a lot of data - app will make your phone run flat in no time - app likely gets heavily resource constrained by the OS when user switches away, relay conns are killed - app code has tremendous added complexity (perhaps the worst of all!)
So what this effectively ends up doing is: - only native apps will be able to handle this kind of load, maybe only desktop apps - only people with close-to unlimited data plans will be able to use your app - very few people will be able to understand your code, if any (including you)
So you ended up introducing all these centralizing dynamics, while users don't even understand or appreciate why you did it. And of course it all still relies on purplepages to fetch the initial lists, right? ;)
I had a better idea (communities are even better but until they come online this is my approach):
1. Use explicit relays by default, let normal users set explicit relays, and superusers set outbox too
2. Publishing is simple since it is targeted: you just publish to explicit relays + outbox (or inbox of target if it's a reaction to sth or mentioning someone)
3. You calculate optimal relays and fetch all relevant events ONE time, on a user-triggered "Decentralized Discovery". This should explain what's happening and why it's super cool.
4. Show the progress and at the end, add top relays to the pool for that session
5. User thinks "This is cool, I'm doing the Decentralized Discovery, Nostr Rocks!" and you did not have to keep all those connections and constantly keep score and all that. Just do it once.
{
"id":"e710d9e927a96246fda3bf5ac4e959521d8b4bb92eebcbe8559197203aafca2d",
"pubkey":"d04ecf33a303a59852fdb681ed8b412201ba85d8d2199aec73cb62681d62aa90",
"created_at":1760977834,
"kind":1,
"tags": [
[
"t",
"outbox"
],
[
"r",
"https://v.nostr.build/8bZAOIjVjsCf41pm.mp4"
],
[
"imeta",
"url https://v.nostr.build/8bZAOIjVjsCf41pm.mp4",
"x bd70b14d51d72915fb8444147f0b0ab7a526cc4cdcf005cc33e02845a2239fce",
"size 12653338",
"m video/mp4",
"dim 720x1600",
"blurhash [74VI2ofV?j[.Aj[WAj[t7j[jsj[RNfPogj[RNf6kDj[oHayj^j]oHayj]j[V?ayofj[RPayofj@",
"ox bd70b14d51d72915fb8444147f0b0ab7a526cc4cdcf005cc33e02845a2239fce",
"alt "
]
],
"content":"Dev story time: How SatShoot ended up using partial #outbox model:\n\nUsing NIP65 relay lists to decentralize discovery looks like a fantastic concept at first...\n\nAnd then you realize that most things taken to extremes ends up in the complete opposite way you intended.\n\nThis is true for the outbox model. You want decentralization. Maybe you convinced a lot of people to publish outbox relay lists (BIG maybe), so far so good. Still, you ended up with an app that connects to hundreds of relays **and keeps those connections alive**.\n\nProblems:\n- app uses a lot of data\n- app will make your phone run flat in no time\n- app likely gets heavily resource constrained by the OS when user switches away, relay conns are killed\n- app code has tremendous added complexity (perhaps the worst of all!)\n\nSo what this effectively ends up doing is:\n- only native apps will be able to handle this kind of load, maybe only desktop apps\n- only people with close-to unlimited data plans will be able to use your app\n- very few people will be able to understand your code, if any (including you)\n\nSo you ended up introducing all these centralizing dynamics, while users don't even understand or appreciate why you did it. And of course it all still relies on purplepages to fetch the initial lists, right? ;)\n\nI had a better idea (communities are even better but until they come online this is my approach):\n\n1. Use explicit relays by default, let normal users set explicit relays, and superusers set outbox too\n\n2. Publishing is simple since it is targeted: you just publish to explicit relays + outbox (or inbox of target if it's a reaction to sth or mentioning someone)\n\n3. You calculate optimal relays and fetch all relevant events ONE time, on a user-triggered \"Decentralized Discovery\". This should explain what's happening and why it's super cool.\n\n4. Show the progress and at the end, add top relays to the pool for that session\n\n5. User thinks \"This is cool, I'm doing the Decentralized Discovery, Nostr Rocks!\" and you did not have to keep all those connections and constantly keep score and all that. Just do it once.\n\nThis is now implemented in SatShoot:\nhttps://v.nostr.build/8bZAOIjVjsCf41pm.mp4\n\nOpinions? ",
"sig":"e51d88e85076a691a966423d24c2e96f790321830e299b39cd3509ca8ea5899b0327b830236500dacec4c35fe157300c12c2139423bf3fec0774f7252c1affcc"
}