← Protocols
Lighthouse
Storage·Filecoin · Ethereum · Multi-chain

Lighthouse

01Description

Perpetual storage on IPFS + Filecoin with first-class encryption (Kavach threshold cryptography) and token-gated access control. Pay-once, store-forever billing model with built-in deal renewal and PoDSI proofs.

02Best for
  • 01permanent storage with deal auto-renewal
  • 02encrypted + token-gated files
  • 03NFT metadata and media on Filecoin
  • 04client-side E2E encrypted uploads
  • 05perpetual storage with verifiable PoDSI
03Install
  • pnpm add @lighthouse-web3/sdk @lighthouse-web3/kavach
04Environment variables
VariableScopeDescription
LIGHTHOUSE_API_KEYServerAPI key from the Lighthouse dashboard. Server-side only.
LIGHTHOUSE_SIGNER_PRIVATE_KEYServerPrivate key (hex) used to sign access-control / encryption auth messages on the server. Optional — only needed for encrypted uploads + token-gated access. Server-side only.
05Prompt snippet
Use `@lighthouse-web3/sdk`. For a public upload, `const response = await lighthouse.upload(filePath, process.env.LIGHTHOUSE_API_KEY)` returns `{ data: { Hash, Name, Size } }` where `Hash` is the IPFS CID — read via `https://gateway.lighthouse.storage/ipfs/${cid}`. For browser uploads from a `<input type=file>`, use `lighthouse.uploadBuffer` or generate a temporary upload key server-side via `lighthouse.getApiKey()` so you never ship the master key. For encrypted, token-gated content: sign an auth message with Kavach (`kavach.getAuthMessage` → `signer.signMessage`), call `lighthouse.uploadEncrypted(file, apiKey, publicKey, signedMessage)`, then `lighthouse.accessControl.applyAccessCondition(...)` to gate by ERC20/ERC721 ownership or chain conditions. Decrypt with `lighthouse.fetchEncryptionKey(cid, publicKey, signedMessage)` + `lighthouse.decryptFile`. PoDSI proof of Filecoin deal can be queried with `lighthouse.getProofs(cid)`.
06Gotchas
  • Pay-once model means storage cost is locked at upload time but Lighthouse handles deal renewal — the renewal threshold and replication factor are configurable per upload, defaults may not match your durability needs.
  • Encryption uses Kavach threshold cryptography; key shards are distributed across nodes. Losing your signer (the wallet that signed the auth message) effectively means losing decryption authority.
  • Token-gating is evaluated at fetch time against onchain state — chain RPC outages or token contract changes can intermittently lock users out.
  • API key is full-power for the account — never embed in the browser. Use `lighthouse.getApiKey(publicKey, signedMessage)` to mint scoped temporary keys for client-side uploads.
  • Free tier has storage and bandwidth caps; perpetual storage bills are paid in fiat or crypto and prepaid bytes are non-refundable.
  • Public uploads land on IPFS immediately but Filecoin deal confirmation (PoDSI) takes hours — don't surface 'permanently stored' UI until `getProofs` returns a deal.
07Alternatives