Synchronizing data between San Francisco and Berkeley
nix run github:nicolaschan/baybridge
# Start a local server
baybridge serve
# In another shell
baybridge list
baybridge set foo bar
baybridge get "$(baybridge whoami)" foo # returns bar
baybridge namespace foo # shows a mapping: $(baybridge whoami) -> bar
Each writer is identified by a keypair (S, V) where S is the private signing key and V is the public verifying key. The verifying key V corresponds to a keyspace K, the collection of names writable by V. Each value in the store is addressed by a tuple (V, k), a verifying key V and a name k. A namespace N for k is the set of addresses where the name is k over all verifying keys.
To write to a name in K, the write command must be signed by the signing key S.
This way, nodes do not need to trust each other. Nodes share the signed write commands and apply the changes according to a conflict resolution strategy. Readers can ask any node for the data and audit log of the events to derive the current state.
Values can be queried in two ways:
This is a work in progress!