Core Concepts
Understanding these core concepts will help you effectively use the Keypo Synapse Storage SDK for decentralized file storage.
File Identifiers
- Each uploaded file has a unique piece CID (Content Identifier), which is used for file retrieval, and data identifier which is used for decryption.
- Human-readable file names are stored in metadata and are not required to be unique.
- Use
sdk.list()to retrieve all your files and metadata.
Access Control Models
Public Files
- Encrypted but publicly accessible: Anyone can decrypt these files
- Great for content distribution where you want encryption in transit but open access
- Set
isPublic: trueduring upload
Private Files
- NFT-based access control: Only NFT holders can decrypt
- File owner automatically receives an NFT upon upload and can share access with specific wallet addresses using
share - Set
isPublic: falseduring upload
File Operations
Upload
- Encrypts files using Lit Protocol before storing on Filecoin
- Automatically handles Filecoin storage provider payment in USDFC tokens
- Returns piece CID for later retrieval
- Supports progress tracking and custom metadata
Download
- Retrieves files from Filecoin via CDN or direct access
- Automatically decrypts if you have proper permissions
- Supports progress tracking and local file saving
Share
- Grants access to private files by minting NFTs
- Access control enforced by smart contracts
Delete
- Removes file from permissions registry
- Revokes all access permissions
- File data remains on Filecoin (future versions will support data deletion)
- Only file owner can delete
Storage Architecture
Multi-Network Design
- Filecoin Calibration: Decentralized file storage
- Base Sepolia: Smart contracts for access control
- Lit Protocol: Distributed key management and encryption
Payment System
- USDFC Tokens: Used to pay for Filecoin storage
- All smart contract operations (upload, share and delete) are sponsored using Zerodev paymaster
- Encryption/decryption operations are curently free because Keypo uses Lit’s testnet. Once it is deployed to mainnet, users will need $LITKEY for these operations.