A custom signed type that respects ACL and identity for y.js #15
Description
I'm starting a new y.js data-type to serve an eventual Blog Platform DApp. The original idea was to make a y.js type that had built in ACL and signing. For the past few days, I've been experimenting with this.
The only documentation for doing this is very out-of-date, so I've been pouring through code. It now looks like the easiest thing might be to modify the map type.
The needs:
- signed data to ensure authority
- respect of ACL
- easy and fast API for developers
y-signed-table would be a modification of the Map type with a few additions:
- require a signature on all map changes
- refer to an ACL map (or signed-table) for authorizations for how a user (given their signature) could change things
- only allow a depth of 2 (and no other types)
- no-op on any operation violating ACL, signatures, type definition, etc
- storage of extra indexes for filtering/sorting beyond primary id
- query helper functions
The ACL table can be another y-signed-table that only accepts admin flagged users.
There may be a need for a special type for managing the user identities and all of their public keys, but we can cross that bridge later
Later on, it'd be nice if y.js supported ways to maintain and prune the CRDT log -- snapshotting, pruning no-op, pruning logs about objects that have since been deleted, etc.
OR, I could use https://github.com/ipfs-shipyard/peer-crdt. It'd take me awhile to build something on top of it that exposed something nice to front-end developers, I think. In the meantime, I've been working on the y.js custom type.