Viewing a single comment thread. View all comments

go1dfish OP wrote


The core of nab is the gun database system:

It's a distributed p2p graph database in javascript.

It handles real time replication of data and changes.

Nab is built by defining additional validation rules for the incoming gun data to define a schema for the data that clients/peers enforce on each other.

Part of this schema is that the identifier for post data is based on a cryptographic hash of the post data, this and the validation makes post content effectively immutable. (For legal or other takedowns peers can replace their local data, but other peers can recognize the tampering since the hash wont match)

Voting is accomplished by a proof of work problem on those identifiers + "ups" or "downs" or whatever type of vote you want to track (nsfw marking will likely work similarly)

The most interesting code is here:

All the details of the networking and replication are handled by gun, which is what made this so simple to develop.

Currently gun has some pretty major performance issues serverside, but the dev behind it is working hard to address.