You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(note: this is currently inconsistent with what Mastodon applies. This is a suggestion, for now at least)
Currently, JSON-LD Signatures are defined to apply to an entire document. However, this will not work when stored in a database, as you'd have to exactly unflatten everything back from how it was. This might be difficult, or even impossible. So, my suggestion:
Define items as an empty set, and toProcess as a queue containing the root object.
While toProcess has an item:
Remove an item from the queue, and iterate over every predicate containing it
If the predicate contains a sub object, add it to toProcess.
If the sub object also has an @id predicate, add it to items
For each item in items:
Clone the object, and replace all predicates that contain a sub object with an @id predicate with just its @id
Sign this cloned object, and add this signature to the original object.
To validate the signatures, you can basically do the same, but instead of signing you validate the signature.