Building a BFT JSON CRDT
It&#x27;s the Byzantine Fault Tolerant part of this that is particularly innovative and based on Kleppmanns most recent work. I believe it solves the issue of either malicious actors in the networks modifying others transactions, spoofing them, or the messages being modified by third parties (&quot;outside&quot; the network) who have MITM the connection. These are really great problems to solve.<p>However, when I was experimenting with CRDTs a while back, it seemed to me the other big issue is where multiple transactions from different users combine to create an invalid state. Most CRDT toolkits are aiming for a combination of a JSON like type structure, with the addition on specific structures for rich text. The JSON structures for general purpose data, and those for rich text as that is the most common current use case. These sort of general purpose CRDTs don&#x27;t have a way to handle, say, the maximum length of an array&#x2F;string, or minimum and maximum values for a number. They leave this to the application using the toolkit.<p>For the Yjs + ProseMirror system, effectively the CRDTs are resolved outside of ProseMirror. Thats useful as they can be combined&#x2F;resolved on the server without a ProseMirror instance running. However there is a strong possibility that the resulting structure is no longer valid for your ProseMirror Schema, this is currently handled by ProseMirror throwing away the invalid parts of the document when it loads.<p>What I think is needed is a Schema system that is a layer either on top of these toolkits, or as part of them, that provides rules and conflict resolution. So there is a way to specify the maximum length of an array&#x2F;string, or what the maximum value of a number is. Effectively generic CRDTs that have an understanding of developer supplied rules and bounds.<p>The &quot;maximum length&quot; is an interesting one, as depending on the order of transactions you could end up with a different result.