Message flows
Step-by-step flows for sending and reading a BlockMail and a BlockChat message on OCC v1.
BlockMail: send and read
A mail is data-heavy, so only a link and a checksum go on chain.
Figure: BlockMail stores encrypted content off chain and records its link and checksum on chain.
The sender's app stores attachments (encrypted, if encryption is on), then the envelope.
The app sends the link and checksum to the Mail contract. If the receiver uses a whitelist, the sender must be on it.
The receiver's app sees the new-mail event, fetches the envelope, checks the checksum and decrypts.
BlockChat: send a message
A chat message is short, so the encrypted message goes on chain directly.
Figure: BlockChat records the encrypted message on chain; the recipient decrypts it with the shared secret (one-to-one) or their copy of the conversation key (group).
One-to-one: the message is encrypted with the shared secret of the two accounts (AES with ECDH). Group: the creator creates the conversation, and each member gets an encrypted copy of the conversation key.
Messages are encrypted with that key (if encryption is on) and recorded on chain.
In a group, the creator can add members, which adds a key copy for them.
See Encryption options for how keys are derived and Storage for where content lives.
Last updated
