Skip to main content

πŸ”’ Upload Encrypted Data

Lighthouse Walrus uses SEAL to perform client-side encryption and decryption. Files are encrypted on your device before they leave it, so only encrypted data is transmitted and stored.

Uploading an Encrypted File​

Follow these steps from the Lighthouse Files Dapp:


Step 1: Turn On Encryption​

Before uploading, toggle Encryption to ON. This activates SEAL's client-side encryption pipeline for your upload session.

Enable Encryption

When encryption is enabled, a lock icon will appear on the toggle button, confirming that your next upload will be encrypted end-to-end.


Step 2: Click Upload File​

Click the Upload button in the dashboard and choose Upload File. With encryption enabled, this will trigger the encrypted upload flow instead of a plain upload.

Upload File Button


Step 3: Select Your File​

Choose the file you want to upload from your local filesystem. The Dapp will display the file name and size. There are no file type restrictions β€” SEAL encrypts any binary data.

Lighthouse calculates the file size to determine the Walrus storage cost, and the on-chain Sui transaction fee for creating your access control object.


Step 4: Sign the On-Chain Transaction​

Once you confirm the upload, your Sui wallet will prompt you to sign a transaction. This transaction:

  • Creates a Sui on-chain object that serves as the encryption identity for SEAL's Identity-Based Encryption (IBE) scheme
  • The object defines the file's access control, determining who can decrypt it

Sign Transaction


Step 5: Client-Side Encryption & Upload​

After you sign the transaction:

  1. A random symmetric encryption key is generated on your device.
  2. Your file is encrypted entirely on the client side using this key.
  3. The symmetric key is encrypted (encapsulated) using SEAL's Identity-Based Encryption (IBE), with the on-chain object serving as the encryption identity.
  4. The encrypted file is then uploaded to Walrus. Lighthouse never sees your file in plaintextβ€”only encrypted data is transmitted and stored.

Upload

Once complete, Lighthouse returns the IPFS CID for your encrypted file. You'll see it listed in your files dashboard with a lock icon indicating it's encrypted.


Decrypting an Encrypted File​

To access your encrypted file:

Step 1: Click the File​

From your files list, click on the encrypted file you want to decrypt. Files with a lock icon are encrypted and require proof of ownership to access.


Step 2: Prove Ownership via Signature​

A signature request will appear in your Sui wallet. By signing this message, you:

  • Prove ownership of the wallet address that has permission to decrypt the file's on-chain encryption object.
  • Authorize your client to establish a temporary authenticated session with SEAL, allowing it to request the decryption key material from SEAL key servers for a limited time.

Sign for Decryption

Session Keys

Session keys are short-lived credentials issued after you prove ownership of your wallet. They allow your client to authenticate with SEAL key servers without requiring you to sign every key request.


Step 3: Retrieve Key Shares & Decrypt the File​

Once your authenticated session is established:

  1. Your client requests the IBE decryption key material from the SEAL key servers.
  2. Each key server verifies that your wallet has permission to decrypt the file before returning its key share.
  3. The key shares are combined locally on your device to reconstruct the IBE decryption key.
  4. The IBE decryption key is used to decrypt the encrypted symmetric key.
  5. The encrypted file is fetched from Walrus and decrypted entirely on the client side using the recovered symmetric key.

Decrypted File

At no point do Lighthouse or the SEAL key servers have access to:

  • Your plaintext file
  • The recovered symmetric encryption key
  • The decrypted file contents

All encryption and decryption operations are performed locally on your device.