Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Ask HN: Is there a descentralized DB with a simple social conflict resolution?
8 points by madacol on May 17, 2022 | hide | past | favorite | 10 comments
I've been thinking it might be practical to build a simple decentralized database, where agents just know each other, so conflict resolution does not need to be so complicated and rely more on the social layer.

I think this applies to most databases, but I'm particularly thinking of internal enterprise databases, some social networks, any federated database system, and different devices of a single user

I'm thinking of this features:

1- Append-only?, full history of operations. Deletes / edits do not remove data, they only modify the "active state"

2- Agents are public keys or similar (DIDs?)

3- Operations are signed, and receivers verify if operation is valid, and sender is allowed

4- Operations form a Merkel-DAG (similar to git, they link to the tips of current "active state", like a commit/merge in git)

So far I think I've basically described [OrbitDB](https://github.com/orbitdb/orbit-db)

Consensus is where things get real hard, [OrbitDb seems to use a last-write-wins CRDT](https://news.ycombinator.com/item?id=22920204), and although I don't know the details of orbitDb, I think for many simple use-cases, conflicts can just be resolved on the social layer. But I think we need to provide agents with good tools to resolve conflicts

I'll try my best here with some ideas:

When merging, we can order operations by their timestamp, if operations enter conflict, raise it to the conflicting agents, or someone with permission to solve them.

If an agent makes public an operation that forks its own history, mark agent as malicious or compromised, alert other agents, this needs resolution on the social layer, you have proof of misconduct, an agent has signed diverging operations

Any operation becomes fully settled if you have proof that all agents of your system have referenced it directly or indirectly through newer operations.

Timestamps can be upgraded by using opentimestamps.org to get proof that an operation existed at time X (prevents creation of operations in hindsight). Though this does not prove operation has been made public



It's not possible to efficiently assert anything among "all agents of your system" if "your system" permits open membership.

In particular, distributed systems cannot efficiently assert objective/wallclock timestamps by definition.

opentimestamps.org is comically naïve.


Yes, I'm definitely talking about databases with close memberships, but keep in mind that some seemingly "open membership" apps can still be implemented, some social networks come to mind, like chat apps, where each chat is a database, and all its participants are the agents. Maybe more sophisticated social networks like twitter could be implemented too, something like each post may be a database with it's own permissions and encrypted to for a group of accounts


Regarding the timestamps, I didn't give it much thought, I think there's room to complicate and solve some edge cases, but my main point was that it's ok to allow agents to manually solve conflicts.

> opentimestamps.org is comically naïve.

Can you elaborate?, I'm very interested, I have high regards with the idea of the project


> Every Bitcoin block header has a field in it called nTime. For a Bitcoin block to be accepted by the network the Bitcoin protocol requires that field to be set to approximately the time the block was created. Exactly how accurate that field must be for a block to be valid is a complex topic, but for our purposes it’s fair to say it’ll very likely be accurate to within two or three hours - even if a sizable minority of Bitcoin miners are trying to create invalid timestamps - and almost certainly within a day.

Distributed systems cannot make reliable assertions about wall-clock timestamps of operations by definition. Even BFT consensus on a given timestamp does not change this fact. This is the whole rationale behind things like Lamport and vector clocks! Anything building on the assertion quoted above is invalid.

> Thus we can say Bitcoin is a notary, and we can use Bitcoin block headers as time attestations: proof that a notary that we trust attested to the fact that some data existed at some point in time.

You can use headers as evidence that supports a time attestation, yes. But that evidence does not in any sense _prove_ the time is accurate! It's easy to construct a pathological condition -- not necessarily malicious, either! -- which breaks these assumptions.

In a distributed system there is no notion of "a point in [wall clock] time" by definition. Timestamps can be attached to events but they cannot be taken as authoritative.


Yeah agree, time is far from precise, and maybe not much useful for the use-case I mentioned

Tough I still think it is a really cool project, to me is the coolest use-case of blockchains beyond money (maybe the only one?)

If you don't want to trust anybody, you can ignore all time references, and just look at the proof of work on top of the attestation.

If you estimate the world's ability to generate proof of work, you can get a lower bound of how much time must have been passed in order to produce that proof, or estimate how much it cost, and you can be as conservative as you'd like, you'll still get a meaningful lower bound of time. Your only assumption is your own estimate

And from the proof of work point of view, it scales infinitely, you can put as many attestation as you can fit in a merkel tree into a single bitcoin transaction


> If you estimate the world's ability to generate proof of work, you can get a lower bound of how much time must have been passed in order to produce that proof, or estimate how much it cost, and you can be as conservative as you'd like, you'll still get a meaningful lower bound of time. Your only assumption is your own estimate

You literally can't! All you can get from this is a lower bound on the _reported_ amount of time. But there's no way, definitionally, to assert any constraint on the _actual_ time. This is my point.


I don't follow, why do you say "reported amount of time"?

You can ignore any time anybody ever reported, the only thing you need reported from others are the proof of work accumulated from the attestation block to the latest block


I think terminology might have gotten mixed up. Maybe my mistake. You can approximate duration, but wall-clock time is unknowable, is my point.


Is there a simple anything with distributed systems?

Only sometimes, and databases are notoriously picky because when something unexpected happens it can cause innumerable problems and pain.


Well, If you try to almost completely solve the consensus problem in the most intuitive way, you arrive to a blockchain level of complexity fast. So I think in this context "simple" seems reasonable




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: