All data requests in a DWN are made in Message JSON objects. These messages contain all data required to process a request in a DWN network including execution parameters, signing/encryption information, signatures, and authorization material. Messages can be modified or changed to fit the needs of a developer provided the data stored follows the Message Object’s format and has an accompanied Schema to store the data.
Basic Message Object(Without Signing or Authorization)
In order to enable data replication features for a DWN, all data listed above must be included in a Message Object. More information on the specific formatting of Message Objects can be found here.
Signed Data
If the Message is to be attested by the signer(the owner of the Node) then it must be formatting as the following:
This object must include an attestation property that contains a signature and payload. More information on this object’s formatting can be found here
Authorization
Messages may require authorization if the DWN owner set permissions to require it. A message must include an authorization property that is a JSON Web Signature(JWS) if it requires authorization. It's format is as follows:
Unlike the basic Message Object, the authorization property includes payload and signature data in order to properly process a Message. More information on this object’s formatting can be found here.
Encrypted Data
All encrypted Messages must include the following:
The additional information under "data" is used for message encryption and utilizes JSON Web Encryption. More information on message encryption can be found here