Memo Block Encryption
Used to encrypt accounts, notes and shared keys
Last updated
Used to encrypt accounts, notes and shared keys
Last updated
The main purpose of the memo block is to publish transaction details. Due to the secret nature of a transaction, the list of admitted users able to access data is strictly restricted. There are two critical data components encrypted in the memo block: an output account and output notes.
Only the transaction sender can access the output account and notes. The output account is used by the sender to maintain the wallet state, and notes are used to retrieve the outgoing history of transactions. The output account should not be available to the transaction receiver. Shared secrets are used to implement this feature.
There are three encrypted entities in the memo block.
Account Encryption
Notes Encryption
Shared Secrets Encryption
An output account in the memo block is encrypted with the random key by the symmetric algorithm ChaCha20Poly1305:
Generate a random symmetric 256-bit key:
Encrypt output account:
Nonce for is a fixed value. It's the first 12 bytes of the : 0x5bbdffc6fe73c460f1b2b85d
To decrypt output account user should obtain from the memo block. The transaction sender only can access this key.
Output notes are encrypted with the ephemeral keys. Steps to encrypt a :
Generate a random 256-bit ephemeral secret key:
Calculate an ephemeral public key for the :
Derive a symmetric encryption key for the note:
Encrypt note:
There are two public values for the each note in the memo block: and
To decrypt a note the user obtains the corresponding . There are two ways to get it:
to obtain from the shared secrets (a sender case)
to derive from the and account's key (a receiver case):
Shared secrets block contains symmetric keys for account and notes encryption: . The following actions are used to encrypt these keys:
Generate a random 192-bit nonce:
Encrypt :
Put in the shared secrets block
could be decrypted with the key only.