Transfer

Sending the files to anyone on blockchain

This feature is designed to send encrypted (or unencrypted but tied to NFT) files using asymmetric encryption, you encrypt with receiver's public key, they decrypt with their private key, no re-upload needed. To transfer the file, the recipient must either have at least one outgoing transaction or to provide a public key to the sender.

Public keys on Ethereum are not wallet addresses, they are last 20 bytes of hashed public keys over Keccak256 with 0x prefix. Aetrna automatically reconstructs the public keys where possible, however, if the receiver has no outgoing transactions, he or she then must provide the public key to the sender through other means. There is special cryptography that has a workaround for this (IBE / ABE) but it has centralization risks that we want to avoid.

Transfer flow

  1. User A uploads a file with encryption enabled (ECIES / MLKEM) or just an NFT.

  2. User A is given a Download Key for that specific file.

  3. User A goes to Transfer page and pastes the Download Key he got. In case if the file was not encrypted and does not have an NFT attached to it, the users gets an error.

  4. User A selects the User B's (the receiver) Ethereum address. The system then tries to fetch the receiver's signature from the transaction, then constructs the unsigned transaction RLP payload and recovers the public key using the signature.

    1. Aetrna provides prompts for public key in a scenario where the receiver does not have the outgoing transactions yet for both ECIES and MLKEM routes.

  5. User A needs to decrypt the symmetric key:

    1. In broswer by inserting the private key. No data is sent to the server, for cryptography Noble library is used

    2. Offline by using the portable tool provided. User A needs to copy the symmetric key, then run the cool and decrypt that key in terminal offline. This is safer in regards to memory leaks or clipboard sniffers. User A then inputs the plaintext symmetric key that will be checked against aes_key_hash for correctness in case if the User A is malicious or incorrectly pasted the symmetric key.

  6. After re-encryption is done, User A gets a metamask pop-up to send a transaction which updates the storage_contract state with a new encryptedKey that the receiver can now decrypt using his Ethereum private key

  7. User B then opens the Library page on Aetrna website and gets the download key which then is used to download the file from blockchain on Download pge.

  8. User B download a file and decrypts it with his private_key either in browser or offline using the portable tool.

The portable tool for offline decryption:

Last updated