> For the complete documentation index, see [llms.txt](https://docs.aeterna.works/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aeterna.works/features/upload.md).

# Upload

Uploading files via Aeterna

Allows you to efficiently store any type of files inside EVM (and Arweave for big files).

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyZ5q78fKbNzI8DhXbgqt%2Fuploads%2FjP94RSZw0lzB42eY9LDo%2Fupload_demo.mp4?alt=media&token=09f374e5-b0e3-45a1-9edf-1c53a375e2bb>" %}

The simplified idea is this:

<figure><img src="https://1590131134-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FU16T4AqVkNnmxdWlVSYr%2Fuploads%2FPoHTqzoZR5v1C5bAHPi8%2Fimage.png?alt=media&amp;token=a6fe7745-d389-44c8-bb6b-a3bc4390aac4" alt=""><figcaption></figcaption></figure>

Options available:

1. Encryption — symmetrical (password) and asymmetrical (ECIES / MLKEM):&#x20;
   1. Implemented [ECIES](https://cryptobook.nakov.com/asymmetric-key-ciphers/ecies-public-key-encryption) with post-quantum option of MLKEM (Kyber-1024 per [FIPS-203](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.203.pdf)). For encryption, the elegancy of implementation allows the user to establish a shared secret without private key.
   2. To avoid the exposure of private keys during decryption, MLKEM is a safer alternative -- allows you to generate a separate keypair and declare it on-chain for future use (effectively binding your Ethereum address with MLKEM keypair). We also provide a [standalone open source tool for offline decryption](https://github.com/0x02937/aetrna_portable/tree/alpha-1).
   3. Password (Argon2id -> AES-256) encryption is also implemented, will require to share the decryption keys off-chain.
2. Shortcut mint — adds an NFT to the web3 wallet, this will contain the permanent access key in the metadata, so you can reconstruct / access the files even if the app goes offline.
3. Relayer ([EIP-2771](https://eips.ethereum.org/EIPS/eip-2771)) — upload files by backend, so you dont have to accept dozens of Metamask popups and potentially break the wallet extension (see known bugs below).
4. Simulation — allows to simulate the upland for a specific file with specific options to get a near-perfect estimation for the gas costs. It is done via [Tenderly](https://tenderly.co/).
5. Redact name — changes the name of the file to "Redacted" on-chain. On download, the original name is getting restored.
6. Data avalibility — transactions, blobs (EIP-[4844](https://eips.ethereum.org/EIPS/eip-4844) / [7594](https://eips.ethereum.org/EIPS/eip-7594)) or Arweave storage

After upload, the user can access their files in [Library](/features/library.md) and share the access keys with others.

### Steps

On high level (as of late 2025), the system does the following:

1. Compression via `zlib` per [RFC 1950](https://www.rfc-editor.org/info/rfc1950) / [RFC 1951](https://www.rfc-editor.org/info/rfc1951) (DEFLATE algo with 32k sliding window)
2. Metadata addition in format:`file_name` + separator `::` + `file_content`
3. (If enabled) Encryption with Password, ECIES or MLKEM (this will have a separate page due to complexity).
4. Data is split into chunks of 3900 x 32-bytes on L1, 1800 x 32-byte on L2 and is not split on Arweave DA.
5. Upload routes:
   1. Relayer route — asks for initialization signature via Metamask and then does the meta-transactions (per [EIP-2771](https://eips.ethereum.org/EIPS/eip-2771)) on behalf of the user via Forwarder -> Manager -> Storage contracts. The user's address is mapped to the balance in Forwarder, which pays for internal calls. The backend is orchestrating the transactions.
   2. Metamask route (deprecated due to Metamask freezing itself).
6. After the process is done, the system collects an access key which could be minted in ERC-1155 token aka NFT, but also is accessible in the contract storage for later use

The explanation of the NFT is in  [File Shortcuts](/features/file-shortcuts.md) page.
