cabal-club / cable

A lightweight peer-to-peer chat protocol.
https://cabal.chat
74 stars 4 forks source link

Time? Whose? #2

Closed garbados closed 2 years ago

garbados commented 3 years ago

Regarding time range queries, should peers just optimistically trust each other's clocks (bad idea) or is there another approach implied?

serapath commented 3 years ago

I wonder too.

I think the hash link field to reference older messages. Maybe it should allow multiple "links" to enable merge messages. The post/delete already has two, a link and a hash too

But anyway - that's already some sort of topological time sort, right?

=> So, if many messages happened, then depending on which peers you choose to trust or not, you could check messages which according to their "topological sorting" happened at a similar time and then compare the timestamps (e.g. take the mean time stamp?)

serapath commented 3 years ago

Also, at least in post messages (the ones that represent writes and matter), the public_key could represent a hypercore too. If messages need a nonce, those could then be hypercore chunk indexes, because combined with the pubkey, they are unique

okdistribute commented 3 years ago

Typically you could record a time sent and time received, but with the links we are creating a directed graph, so these records aren't used for ordering messages, the graph is. the timestamps then are simply for user convenience

garbados commented 2 years ago

Fair enough. Closing this issue...