Documentation Index
Fetch the complete documentation index at: https://docs.zkterm.io/llms.txt
Use this file to discover all available pages before exploring further.
Upload File
Upload an encrypted file to IPFS via Pinata with Groth16 ZK proof.
POST /api/storage/upload
Content-Type: multipart/form-data
Form Data:
file: File to upload (max 100MB)
proof: Groth16 proof JSON
publicSignals: Public signals array
commitment: Password commitment hash
checksum: SHA-256 file checksum
Response:
{
"success": true,
"id": "file_uuid",
"cid": "QmXyz123abc456def789...",
"filename": "document.pdf",
"size": 1234567,
"checksum": "sha256:abc123..."
}
List Files
Get list of uploaded files for current user.
Response:
{
"success": true,
"files": [
{
"id": "file_uuid",
"cid": "QmXyz123...",
"filename": "document.pdf",
"size": 1234567,
"createdAt": "2025-12-01T10:00:00Z",
"checksum": "sha256:abc123..."
}
]
}
Download File
Download a file from IPFS.
GET /api/storage/download/:cid
Response: Binary file data with headers:
Content-Type: application/octet-stream
Content-Disposition: attachment; filename="document.pdf"
Delete File
Unpin a file from IPFS (removes from Pinata).
Response:
{
"success": true,
"deleted": true
}
Create Share Link
Generate a shareable link for a file.
Request:
{
"fileId": "file_uuid",
"expiresIn": 48
}
Response:
{
"success": true,
"shareToken": "abc123token",
"shareUrl": "https://zkterm.io/share/abc123token",
"expiresAt": "2025-12-03T10:00:00Z"
}
Access Shared File
Access a file via share link.
GET /api/storage/shared/:token
Response:
{
"success": true,
"file": {
"cid": "QmXyz123...",
"filename": "document.pdf",
"size": 1234567
}
}
Verify ZK Proof
Verify Groth16 proof for a file.
Request:
{
"proof": {
"pi_a": [...],
"pi_b": [...],
"pi_c": [...]
},
"publicSignals": ["commitment_hash"],
"commitment": "expected_commitment"
}
Response:
{
"success": true,
"valid": true
}
Error Codes
| 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 |