Integration Guide
Pakit is the storage layer under several BelizeChain services. This guide covers the common integration patterns.
Who Uses Pakit
| Consumer | What it stores |
|---|---|
| Nawal AI | Model checkpoints, training datasets |
| Kinich Quantum | Quantum computation results |
| LandLedger | Property documents and proofs |
| BNS | Website content for .bz domains |
| Maya Wallet | User file uploads/downloads |
Integration 1 — On-Chain Proofs
Anchor documents on-chain through the StorageProofConnector, which submits Merkle proofs to the StorageProof pallet:
from pakit.blockchain import StorageProofConnector
from pakit.core import PakitStorageEngine
connector = StorageProofConnector(
node_url="ws://localhost:9944",
keypair=keypair,
mock_mode=False, # True for development
)
await connector.connect()
engine = PakitStorageEngine()
content_id = engine.store(
data=document_bytes,
metadata={
"property_id": 12345,
"document_type": "title_deed",
"mime_type": "application/pdf",
},
)
await connector.submit_proof(content_id)
See Storage Proofs for what is verifiable today (Merkle only).
Integration 2 — HTTP API
All services talk to Pakit over its REST API (port 8001 locally; /api/pakit/ behind the Ceiba reverse proxy):
# Store content
curl -X POST http://localhost:8001/store \
-F "file=@document.pdf"
# Retrieve by content ID
curl http://localhost:8001/content/<content_id>
Integration 3 — BNS Website Hosting
Domains registered in BNS point at Pakit content. The flow is:
- Upload the site bundle to Pakit → receive the content ID
- Set the domain's resolution record to that content ID
- Requests resolve through the gateway to the DAG content
See BNS.
Configuration Reference
| Variable | Purpose |
|---|---|
PAKIT_API_PORT | REST API port (default 8001) |
STORAGE_DIR | DAG data directory |
DAG_BACKEND_ENABLED | Enable the MerkleDAG backend |
DAG_REPLICATION_FACTOR | Replicas per block |
BLOCKCHAIN_RPC | Substrate RPC for proof anchoring |
IPFS_ENABLED | Optional legacy IPFS backend |