Skip to main content

Mailboxes and the Blobchain

A mailbox can be seen as a directory containing a number of content addressed files, each of which represent an individual unit of mail. In other words, the filename of each mail file is the SHA256 hash of its content which is to contain a timestamp at the very beginning, followed by two newlines and the mail body.

A mail unit is to be treated as an immutable envelope containing metadata followed by the mail contents.  To reduce filesystem pressure, each mail unit lives within a directory named after the first two bytes of the hash (xx/xxxxx...).

To prevent tampering of the mailbox, aeach blobchainmail isunit tocontains be present as an "INDEX" file within the same directory. Blobchains are a form of blockchains that have been serialized to disk. A blobchain barley differs from a typical blockchain other than that its usage is meant to make files tamper proof. Each block is to be referred to as a "blob". A blob is to contain the data contents, the SHA256 hash of its contents, and referencereferences to the next and previous blobs.mail Tamperingunit in the form of thea mailbox wouldname, delimited by a ':' and followed by the mail unit's content addressed hash:

All mail units are to follow the given format:

<ASCII TIMESTAMP>
<MAILBOX>:<PREVIOUS HASH IN BINARY>
<MAILBOX>:<NEXT HASH IN BINARY>
\n\n
<CONTENT>   

Attempting to alter the contents of any mail unit may result in data loss and cause affected units to be rejected by the chainmail-server beingand/or broken in a detectable way.client.