Willow Drop Format
Status: Proposal
You really could transport Willow data using any of the means above.The Confidential Sync protocol presents a way for two peers with an established connection to efficiently exchange data. But running the necessary infrastructure to establish such connections (e.g. a STUN server, distributed hash table, or relay servers) is a non-trivial task, limiting who can operate them.
The Willow Drop Format presents a way for peers to transmit data to each other asynchronously and via completely user-improvised channels.
Instead of statefully coordinating which data to exchange, the Drop Format encodes drops, arbitrary sets of Entries and Payloads compiled into a single bytestring. A drop can then be treated as a kind of static store which can be joined with any other store as per the Willow Data Model.
An example flow of Willow data travelling from device to device, first via USB key, then email, then a messaging app, then local wireless.Drops are then shared via informal ad-hoc infrastructure:
- USB keys
- SD cards
- CDs
- Email attachments
- Instant messages
- Torrents
- Or whatever means users have at hand.
Drops will often undoubtedly contain stale data that users are already aware of or no longer need. But what the Drop Format gives up in efficiency it more than makes up for in simplicity and flexibility. It is simple to implement, and works with the infrastructure users already have.
Finally, given that this protocol cannot interactively authorise users (e.g. via private interest intersection), drops are always fully encrypted.
Parameters
See Willow’25 for a default recommendation of parameters.In order to use the drop format, one must first specify a full suite of instantiations of the parameters of the core Willow data model. In addition to this, the drop format requires the following:
- An encoding function encode_namespace_id for NamespaceId,
- An encoding function encode_subspace_id for SubspaceId,
- An encoding function encode_payload_digest for PayloadDigest,
- When using MeadowcapAuthorisationToken as the type of AuthorisationTokens, you can use EncodeMeadowcapAuthorisationTokenRelative.A relative encoding relation EncodeAuthorisationToken encoding AuthorisationTokens relative to pairs of an AuthorisedEntry (the previously encoded AuthorisedEntry) and an Entry (the Entry currently being encoded),
- a NamespaceId default_namespace_id,
- a SubspaceId default_subspace_id,
- a PayloadDigest default_payload_digest,
- an AuthorisationToken default_authorisation_token which authorises
default_entry(default_namespace_id, default_subspace_id, default_payload_digest), and - a function encrypt which encrypts the final compiled encoding.
Format
Let entries a sequence of pairs of a PossiblyAuthorisedEntries and either a full corresponding Payload11That is, a Payload whose length is the payload_length of the Entry, and which hashes to the payload_digest of the Entry. or the marker value none, all from a single namespace with NamespaceId namespace. The Sideloading Protocol then defines how to encode this sequence as a single bytestring (the corresponding drop).
Let be the result of default_entry(default_namespace_id, default_subspace_id, default_payload_digest), and let be default_authorisation_token.
Then, contents is the concatenation of the following:
| A tag of width for the length (number) of entries, followed by the corresponding compact U64 encoding. | |||||||||||||||||||||||||||||
| The code in encode_namespace_id for namespace. | |||||||||||||||||||||||||||||
For every -th pair ((, ), ) of entries , a concatenation of the following form:
| |||||||||||||||||||||||||||||
The the drop corresponding to the sequence entries is the result of applying encrypt to contents.
Transport
Once created, a drop" can be transported by whatever means a single bytestring can be transferred, to be decrypted and the recovered entries ingested by its intended recipient.
