Cryptographic signing of a transaction?

Has anyone tried cryptographically signing a yjs transaction? How do you pass the signature along with the data?

In particular, I’m thinking about a p2p system in which anyone can “collaborate” on a yjs doc, but on the receiving side, a peer would only accept and apply the transaction if the signature matches a known identity. (Let’s wave our hands a bit on how identities would work, since it’s a complex problem, but some kind of standard public/private keypair arrangement is what I have in mind).

Just brainstorming at this stage. I’m curious if anyone has actually attempted or built this already.