If you want this to scale you'd need a scheme to deal with limited cache per device. Something like having each device assign a random priority to each message it has in transit. That way everyone culls a different set when things fill up.
> would need a ttl, say 24 hours
Probably better off scaling priority by age. That way you deliver if at all possible, until it eventually falls out of cache. Some people will be able to dedicate much more storage than others.
- Regular travelers between cities (e.g. flight attendants) might be the only reliable links between those hives. Travel patterns change, war breaks out, etc and the hive suddenly splits into two (or more). - A lot of people probably move around too much, and too unpredictable, to participate in a hive that's stable on scales necessary to maintain a TTL of <24h and a reasonable amount of cache for storing others’ undelivered messages.
Maybe I'm being too pessimistic here… I do think it'd be fascinating and instructive to try to build and use a hive/mesh messaging system like this at scale.
The Galapagos Island "post office" is an interesting real world example of serverless/decentralized message delivery: https://www.nationalgeographic.com/travel/article/galapagos-...
Basically, if you visit the Galapagos and you're so inclined… you leave a letter for someone else, and you sift through the letters that have been left there, and try to find one or two that you could conceivably hand-deliver when you return home.
The latency is 100~1000x longer than "normal" snail mail. This is basically with one "hive" constructed around tourists and researchers in an unusual location. But it basically works.