[[ Website ]] • [[ Docs ]] • [[ X/Twitter ]]
zkλ is a decentralized multıchaın file sharing application that combines several advanced cryptographic primitives and blockchain technologies to provide Fully secure, private, and verifiable file transfers. The application leverages a multi-layered architecture comprising:
-
InterPlanetary File System (IPFS) - Distributed content-addressable storage
-
Celestia Data Availability (DA) Layer - Guaranteeing blockchain-level data persistence
-
Zero Knowledge Proofs (succınct) - Privacy-preserving verification mechanisms
-
Frontend (Svelte) - Reactive and efficient user interface
Celestia is used as a Data Availability (DA) layer within zkλ for the following reasons:
- Data Persistence: Celestia provides a blockchain-based guarantee that IPFS Content Identifiers (CIDs) will remain available even if IPFS nodes go offline, solving the persistence problem of pure P2P storage systems.
- Verifiable Namespaces: zkλ utilizes Celestia's namespace system (
0x7a6b6c2d69706673
and custom namespaces) to organize and categorize different file transfers while ensuring they can be cryptographically verified. - Light Client Compatibility: The application connects to a Celestia light node, making it possible to interact with the blockchain without maintaining a full node, significantly reducing resource requirements.
- Payload Blob Submission: When a file is uploaded to IPFS, its CID is submitted as a Celestia blob with associated metadata, creating an immutable record of the transfer that can be later verified.
Implementation details:
- Communication with Celestia occurs through a dedicated API proxy server (
celestia-api.cjs
) - The system uses the
blob.Submit
andblob.GetAll
methods of the Celestia API - Celestia transactions are viewable through the integrated explorer at
https://explorer.consensus-celestia.app/
zkλ uses Succinct's SP1 zkVM for Zero Knowledge proof generation, providing several critical advantages:
- Privacy-Preserving Verification: Allows proving the integrity and existence of a file without revealing its contents
- Selective Disclosure: Enables users to prove specific properties about files without revealing all data
- Mathematical Certainty: Provides cryptographic guarantees rather than trust-based assurances
- Performance and Scalability: Leverages the distributed Succinct Prover Network for efficient proof generation
Technical implementation:
- Uses Succinct SP1 zkVM for efficient Zero Knowledge proof generation
- Implements a custom Rust program compiled to SP1's target architecture
- Proof generation is distributed across the Succinct Prover Network
- API proxy provides seamless integration with the zkVM's proof system
The ZK proving process follows these steps:
- Calculate a numerical representation of the IPFS CID
- Generate a commitment using the file hash and a secret
- Submit the proof generation task to Succinct Prover Network
- Retrieve and verify the proof
- Store verification data alongside the file reference
Succinct SP1 is a zero-knowledge virtual machine (zkVM) that enables proving arbitrary computations with high efficiency. In our implementation:
-
Custom Rust Circuit: We've implemented a specialized circuit in Rust that runs on SP1's zkVM architecture, specifically designed to verify IPFS file hashes while preserving privacy.
-
Distributed Proof Generation: Rather than computing proofs locally (which can be resource-intensive), we leverage the Succinct Prover Network, distributing the cryptographic workload across specialized provers.
-
Verifiable Proofs: The system generates cryptographic proofs that can be verified by anyone without revealing the underlying data, enabling trustless verification of file integrity.
-
Integration Architecture: Our integration uses a modular approach:
- The custom SP1 program in the
sp1-programs/zkl-file-verify
directory - A frontend service layer that interfaces with the Succinct Prover Network
- A verification system that validates returned proofs
- The custom SP1 program in the
Succinct SP1 addresses several fundamental challenges in decentralized file sharing:
Challenge | Traditional Solution | Succinct SP1 Solution |
---|---|---|
Privacy | Hash verification reveals file existence | Zero-knowledge proofs verify without revealing data |
Verification Cost | Full data download required for verification | Proof verification is lightweight and data-independent |
Trust Minimization | Reliance on trusted third parties | Mathematical verification without trusted intermediaries |
Scalability | Computation bound by local resources | Distributed proving across specialized network |
Programmability | Limited verification capabilities | Custom verification logic in Rust |
Integration | Complex cryptographic implementation | Developer-friendly Rust API |
The Succinct SP1 integration enables zkλ to offer several unique capabilities:
- Selective Attribute Verification: Prove file properties (size, type, creation date) without revealing the file
- Owner Authentication: Verify a user knows the file secret without revealing the secret itself
- Tamper Evidence: Mathematical proof that a file hasn't been modified since upload
- Efficient Verification: Proofs can be verified on-chain or in browser with minimal resources
Feature | Hash-Based Verification | Centralized Authority | Succinct SP1 ZK Proofs |
---|---|---|---|
Privacy | ❌ Reveals existence | ✅ Full privacy preservation | |
Decentralization | ✅ Fully decentralized | ❌ Centralized trust point | ✅ Decentralized verification |
Resource Requirements | ✅ Low | ✅ Low for verification | |
Tamper Evidence | ✅ Strong | ✅ Cryptographic guarantee | |
Selective Disclosure | ❌ Not possible | ✅ Programmable disclosure | |
On-chain Compatibility | ❌ Poor | ✅ Optimized for blockchain | |
User Experience | ✅ Simple | ✅ Abstracted complexity |
The zkλ architecture consists of several interconnected components organized in a multi-layered approach that integrates various blockchain technologies:
┌─────────────────────────────────────────────────────────────────────────────────┐
│ │
│ CLIENT LAYER │
│ │
│ ┌───────────────────┐ ┌─────────────────────┐ ┌─────────────────────┐ │
│ │ │ │ │ │ │ │
│ │ Svelte Frontend │◄───►│ zkλ Core Services │◄───►│ Theme & UI State │ │
│ │ (User Interface) │ │ (Business Logic) │ │ Management │ │
│ │ │ │ │ │ │ │
│ └────────┬──────────┘ └─────────┬───────────┘ └─────────┬───────────┘ │
│ │ │ │ │
│ │ │ │ │
│ ▼ ▼ ▼ │
│ ┌────────────────────┐ ┌──────────────────────┐ ┌──────────────────────┐ │
│ │ │ │ │ │ │ │
│ │ User Components │ │ Store Management │ │ Service Interfaces │ │
│ │ ┌────────────────┐ │ │ ┌────────────────┐ │ │ ┌────────────────┐ │ │
│ │ │ WalletConnect │ │ │ │ fileStore │ │ │ │ ipfs.js │ │ │
│ │ │ Upload UI │ │ │ │ inboxStore │ │ │ │ celestia.js │ │ │
│ │ │ Inbox │◄┼────┼─┤ walletStore │◄──┼────┼─┤ solana.js │ │ │
│ │ │ PayloadPreview │ │ │ │ userDatabase │ │ │ │ zk.js │ │ │
│ │ │ Status Display │ │ │ └────────────────┘ │ │ └────────────────┘ │ │
│ │ └────────────────┘ │ │ │ │ │ │
│ └────────┬───────────┘ └──────────┬───────────┘ └──────────┬───────────┘ │
│ │ │ │ │
└───────────┼───────────────────────────┼───────────────────────────┼─────────────┘
│ │ │
│ │ │
▼ ▼ ▼
┌───────────────────────────────────────────────────────────────────────────────────┐
│ │
│ BACKEND API LAYER │
│ │
│ ┌────────────────────┐ ┌─────────────────────┐ ┌─────────────────────┐ │
│ │ │ │ │ │ │ │
│ │ Celestia API │ │ Solana RPC API │ │ IPFS API │ │
│ │ Proxy Server │ │ Services │ │ Gateway │ │
│ │ (celestia-api.cjs)│ │ │ │ │ │
│ └─────────┬──────────┘ └──────────┬──────────┘ └──────────┬──────────┘ │
│ │ │ │ │
└────────────┼───────────────────────────┼───────────────────────────┼──────────────┘
│ │ │
│ │ │
▼ ▼ ▼
┌────────────────────────────────────────────────────────────────────────────────────┐
│ │
│ BLOCKCHAIN & STORAGE INFRASTRUCTURE │
│ │
├─────────────────────┬────────────────────────┬─────────────────────┬──────────────┐│
│ │ │ │ ││
│ IPFS Network │ Celestia Network │ Solana Network │ Succinct ││
│ (Storage Layer) │ (Data Availability) │ (Transaction Layer)│ zkVM Net ││
│ ┌───────────────┐ │ ┌──────────────────┐ │ ┌───────────────┐ │ ┌─────────┐ ││
│ │ IPFS Node │ │ │ Celestia Light │ │ │ Solana Node │ │ │ Prover │ ││
│ │ Content Hash │ │ │ Node │ │ │ (Devnet) │ │ │ Network │ ││
│ │ P2P Storage │ │ │ Blob Namespace │ │ │ Transaction │ │ │ ZK Proof│ ││
│ │ CID Generation│ │ │ Data Attestation │ │ │ Memo Storage │ │ │ Verify │ ││
│ └───────────────┘ │ └──────────────────┘ │ └───────────────┘ │ └─────────┘ ││
│ │ │ │ ││
├─────────────────────┴────────────────────────┴─────────────────────┴──────────────┤│
│ │
│ ┌─────────────────────────────────┐ ┌────────────────────────────────┐ │
│ │ │ │ │ │
│ │ Wallet Integration │ │ Blockchain Explorers │ │
│ │ ┌───────────────┐ ┌───────────┐│ │ ┌────────────┐ ┌─────────────┐ │ │
│ │ │ Solflare │ │ Transaction││ │ │ Solana │ │ Celestia │ │ │
│ │ │ Wallet │ │ Signing ││ │ │ Explorer │ │ Explorer │ │ │
│ │ └───────────────┘ └───────────┘│ │ └────────────┘ └─────────────┘ │ │
│ └─────────────────────────────────┘ └────────────────────────────────┘ │
│ │
└────────────────────────────────────────────────────────────────────────────────────┘
-
Client Layer
-
User Interface Components (
/src/lib/
)UploadInterface.svelte
- File upload and transfer UIInbox.svelte
- Received files management interfaceWalletConnection.svelte
- Solana wallet connection componentPayloadPreview.svelte
- File and transaction information displayCelestiaStatus.svelte
- Celestia network connection statusZkStatus.svelte
- ZK circuit availability indicator
-
Store Management (
/src/lib/stores/
)fileStore.js
- Manages file upload/download state and operationsinboxStore.js
- Maintains the user's inbox of received fileswalletStore.js
- Handles Solana wallet connectivity and user authenticationuserDatabase.js
- User profile and authentication logicthemeStore.js
- Controls application theming
-
Service Interfaces (
/src/lib/services/
)solana.js
- Solana blockchain integration for transactions and memoscelestia.js
- Celestia Data Availability (DA) layer integrationipfs.js
- Manages file uploads and downloads through IPFSzk.js
- Implements Zero Knowledge Proof generation and verification
-
-
Backend API Layer
- Celestia API Proxy (
/src/server/
)celestia-api.cjs
- Backend proxy for Celestia node communication
- Solana API Services
- Devnet RPC endpoints for transaction submission
- Memo program integration for storing references on-chain
- IPFS Gateway
- Connection to IPFS network for file storage and retrieval
- Celestia API Proxy (
-
Blockchain & Storage Infrastructure
- IPFS Network - Distributed content-addressable storage system
- Celestia Network - Data availability layer for blockchain attestation
- Solana Network - High-performance blockchain for transactions and memos
- Uses devnet for testing and development
- Implements SPL-Memo program for on-chain data references
- Platform fee collection mechanism
- Succinct Prover Network - Zero Knowledge verification services
- Wallet Components
- Solflare wallet integration for Solana transactions
- Transaction signing and verification
- Blockchain Explorers
- Solana Explorer for transaction verification
- Celestia Explorer for DA verification
-
File Upload
- User connects Solana wallet via Solflare
- File is uploaded to IPFS and CID is generated
- IPFS CID is submitted to Celestia DA layer
- Transaction reference is stored on Solana blockchain using SPL-Memo
- Zero Knowledge proof is generated via Succinct zkVM
-
Transaction Verification
- Solana transaction creates permanent record with platform fee
- Celestia blob storage ensures data availability
- IPFS ensures content addressing and retrieval
- Zero Knowledge proofs provide privacy-preserving verification
-
File Retrieval
- Inbox queries Solana and Celestia for user's received files
- IPFS CIDs are used to retrieve file content
- Verification status displayed from all blockchain sources
To run zkλ, you need the following components:
- Node.js (v16+)
- IPFS Daemon (local or remote)
- Celestia Light Node (running on local machine or accessible endpoint)
- Modern Web Browser (Chrome, Firefox, Edge, or Safari)
git clone https://github.com/yourusername/zkl.git
cd zkl
npm install
Ensure your IPFS daemon is running and accessible. Default configuration in ipfs.js
points to:
const IPFS_API_ENDPOINT = 'http://localhost:5001/api/v0';
You need a running Celestia light node. Set up your Celestia light node:
# Install Celestia (see full instructions in CELESTIA-SETUP.md)
# Initialize light node
celestia light init --p2p.network mocha
# Get authorization token
celestia light auth admin --p2p.network mocha
# Start the light node
celestia light start --p2p.network mocha --core.ip rpc-mocha.pops.one --gateway --gateway.addr 127.0.0.1 --gateway.port 26659 --rpc.addr 127.0.0.1
Update the configuration in src/server/celestia-api.cjs
:
const CELESTIA_NODE_URL = 'http://localhost:26658';
const CELESTIA_AUTH_TOKEN = 'your-auth-token-here';
To enable Zero Knowledge proofs functionality, you need to:
-
Install SP1 toolchain:
curl -L https://sp1up.succinct.xyz | bash sp1up
-
Set up your Succinct Prover Network API key in
.env
:SUCCINCT_API_KEY=your-testnet-api-key
-
Configure the program ID in
src/lib/services/zk.js
:const FILE_VERIFY_PROGRAM_ID = 'your-uploaded-program-id';
-
For development and testing, you can use the provided default program ID, which is already uploaded to the Succinct Prover Network.
npm run api
This starts the Celestia API proxy server on port 3080.
npm run dev
The application will be available at http://localhost:5173/
by default.
By default, zkλ connects to the Mocha testnet. To use a different network:
-
Update the light node startup parameters:
celestia light start --p2p.network <network-name>
-
Update Celestia authentication token in
celestia-api.cjs
To modify the Zero Knowledge proving system:
-
Replace the circuit files in
/public/circuits/
:hash_check.wasm
- WebAssembly compiled circuithash_check_final.zkey
- Proving keyverification_key.json
- Verification key
-
Update the circuit parameters in
src/lib/services/zk.js
A Docker Compose file is provided for containerized deployment:
version: '3'
services:
zkl-app:
build: .
ports:
- "5173:5173"
depends_on:
- celestia-light-node
environment:
- CELESTIA_NODE_URL=http://celestia-light-node:26659
- CELESTIA_AUTH_TOKEN=your-auth-token
celestia-light-node:
image: ghcr.io/celestiaorg/celestia-node:v0.21.5-mocha
restart: unless-stopped
user: "10001:10001"
volumes:
- ./celestia-light-data:/home/celestia
ports:
- "26659:26659"
command: >
/bin/bash -c "
if [ ! -f /home/celestia/.celestia-light-mocha/config.toml ]; then
celestia light init --p2p.network mocha;
fi;
celestia light start --core.ip consensus-validator.celestia-mocha.com --core.port 26657 --p2p.network mocha --gateway --gateway.addr 0.0.0.0 --gateway.port 26659 --rpc.addr 0.0.0.0
"
- CPU: Dual-core processor (2+ GHz)
- RAM: 4 GB
- Disk: 10 GB free space
- Network: Broadband connection (5+ Mbps)
- CPU: Quad-core processor (3+ GHz)
- RAM: 8 GB
- Disk: 50 GB free space (SSD preferred)
- Network: High-speed connection (20+ Mbps)
When a file is uploaded and sent through zkλ, the following technical process occurs:
-
File Upload to IPFS
const { cid, url } = await ipfsUpload(selectedFile);
-
ZK Proof Generation
const secret = `${selectedFile.name}-${selectedFile.size}-${nanoid()}`; const verificationResult = await createFileVerification(cid.toString(), secret);
-
Celestia DA Submission
const celestiaData = await submitToCelestia(cid.toString());
-
Transfer Record Creation
const transferRecord = { id: transferId, file: { name, size, type }, ipfs: { cid }, ipfsHash: cid.toString(), celestia: celestiaData, zkProof: zkProofData, recipient, sender, message, timestamp: currentTime };
-
Inbox Message Creation
inboxStore.addMessage(recipient, inboxMessage);
The application interacts with Celestia through JSON-RPC calls:
// Example of blob submission
const rpcRequest = {
jsonrpc: "2.0",
id: 1,
method: "blob.Submit",
params: [
[
{
namespace: namespaceHex,
data: ipfsHash,
share_version: 0
}
],
0.002 // Gas price
]
};
const response = await axios.post(
CELESTIA_API_ENDPOINT,
rpcRequest,
{
headers: {
'Authorization': `Bearer ${CELESTIA_AUTH_TOKEN}`,
'Content-Type': 'application/json'
}
}
);
The ZK proving system works by:
-
Loading the circuit from WebAssembly:
const wasmBuffer = await fetch(CIRCUIT_WASM_URL).then(r => r.arrayBuffer()); const zkeyBuffer = await fetch(CIRCUIT_ZKEY_URL).then(r => r.arrayBuffer());
-
Creating inputs from the file hash:
const hashValue = calculateHashValue(ipfsHash); const input = { hash: hashValue.toString(), secret: secretValue.toString() };
-
Generating the proof:
const proof = await snarkjs.groth16.fullProve(input, circuit.wasm, circuit.zkey);
-
Verifying the proof:
const vKey = await loadVerificationKey(); const isValid = await snarkjs.groth16.verify(vKey, publicSignals, proof);
Problem: Unable to connect to Celestia node
Solution:
- Check if your Celestia light node is running:
ps aux | grep celestia
- Verify the node is listening on the correct port:
lsof -i :26658
- Ensure your authorization token is correct
- Restart the node and API proxy server
Problem: Files not uploading to IPFS
Solution:
- Verify your IPFS daemon is running:
ipfs id
- Check IPFS API accessibility:
curl -X POST http://localhost:5001/api/v0/id
- Ensure proper CORS configuration:
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["*"]'
Problem: ZK circuit files not loading properly
Solution:
- Confirm circuit files exist in
/public/circuits/
- Check browser console for specific loading errors
- Try using the browser on a device with more RAM
- Clear browser cache and refresh
Method | Description |
---|---|
checkCelestiaConnection() |
Tests connection to Celestia node |
submitToCelestia(ipfsHash, namespace) |
Submits data to Celestia |
getDataFromCelestia(height, namespace) |
Retrieves data from specified block |
verifyCelestiaData(height, expectedIpfsHash, namespace) |
Verifies stored data |
generateUniqueNamespace(seed) |
Creates unique namespace identifier |
Method | Description |
---|---|
generateProof(ipfsHash, secret) |
Creates ZK proof for file |
verifyProof(proof, publicSignals, expectedIpfsHash) |
Verifies ZK proof |
createFileVerification(ipfsHash, secret) |
Complete verification process |
checkZkCircuitAvailability() |
Checks if ZK circuits are available |
Method | Description |
---|---|
checkIPFSConnection() |
Tests connection to IPFS node |
ipfsUpload(file) |
Uploads file to IPFS |
ipfsDownload(cid, filename) |
Downloads file from IPFS |
ipfsGet(cid) |
Gets data from IPFS (small files) |
ipfsGetMetadata(cid) |
Gets file metadata from IPFS |
zkλ implements several security measures:
-
Data Integrity
- IPFS content-addressing ensures data has not been tampered with
- Celestia DA layer provides blockchain-level integrity guarantees
-
Cryptographic Verification
- ZK proofs verify file properties without revealing content
- Celestia namespaces provide cryptographic isolation of data
-
Authentication
- Wallet-based authentication for sender verification
- Celestia authorization tokens for node access
-
Privacy Protection
- Zero Knowledge Proofs allow verification without data exposure
- Selective disclosure of file metadata
Planned technical improvements for zkλ:
-
Celestia Mainnet Support
- Production deployment on Celestia mainnet
- Network parameter optimization for cost efficiency
-
Enhanced ZK Circuit Capabilities
- Implement more complex ZK proving statements
- Add selective disclosure of file properties (size, type, creation date)
-
Cross-Chain Integration
- Support for multiple blockchain backends beyond Celestia
- Bridge to Ethereum and other EVM-compatible chains
-
Performance Optimization
- WebAssembly optimizations for ZK proof generation
- Parallel processing for large file uploads
This project is licensed under the MIT License - see the LICENSE file for details.
- Celestia team for their data availability layer implementation
- SnarkJS and circom for ZK circuit development tools
- IPFS project for decentralized storage capabilities
- Svelte framework for reactive UI components
- There are places that are simulated to remain stable during certain phases of the demo. To contribute to the development of zkλ:
# Fork and clone the repository
git clone https://github.com/yourusername/zkl.git
# Create a feature branch
git checkout -b feature/your-feature-name
# Make changes and test
npm run dev
# Submit a pull request
git push origin feature/your-feature-name