Upload File
Upload an encrypted file to IPFS via Pinata with Groth16 ZK proof.file: File to upload (max 100MB)proof: Groth16 proof JSONpublicSignals: Public signals arraycommitment: Password commitment hashchecksum: SHA-256 file checksum
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
API reference for encrypted file storage with ZK proofs
POST /api/storage/upload
Content-Type: multipart/form-data
file: File to upload (max 100MB)proof: Groth16 proof JSONpublicSignals: Public signals arraycommitment: Password commitment hashchecksum: SHA-256 file checksum{
"success": true,
"id": "file_uuid",
"cid": "QmXyz123abc456def789...",
"filename": "document.pdf",
"size": 1234567,
"checksum": "sha256:abc123..."
}
GET /api/storage/list
{
"success": true,
"files": [
{
"id": "file_uuid",
"cid": "QmXyz123...",
"filename": "document.pdf",
"size": 1234567,
"createdAt": "2025-12-01T10:00:00Z",
"checksum": "sha256:abc123..."
}
]
}
GET /api/storage/download/:cid
Content-Type: application/octet-stream
Content-Disposition: attachment; filename="document.pdf"
DELETE /api/storage/:id
{
"success": true,
"deleted": true
}
POST /api/storage/share
{
"fileId": "file_uuid",
"expiresIn": 48
}
{
"success": true,
"shareToken": "abc123token",
"shareUrl": "https://zkterm.io/share/abc123token",
"expiresAt": "2025-12-03T10:00:00Z"
}
GET /api/storage/shared/:token
{
"success": true,
"file": {
"cid": "QmXyz123...",
"filename": "document.pdf",
"size": 1234567
}
}
POST /api/storage/verify
{
"proof": {
"pi_a": [...],
"pi_b": [...],
"pi_c": [...]
},
"publicSignals": ["commitment_hash"],
"commitment": "expected_commitment"
}
{
"success": true,
"valid": true
}
| Code | Description |
|---|---|
FILE_TOO_LARGE | File exceeds max size (100MB) |
INVALID_PROOF | ZK proof verification failed |
CID_NOT_FOUND | File not found on IPFS |
CHECKSUM_MISMATCH | File integrity check failed |
SHARE_EXPIRED | Share link has expired |
PINATA_ERROR | Pinata API error |