Skip to main content

Integration Guide

Pakit is the storage layer under several BelizeChain services. This guide covers the common integration patterns.

Who Uses Pakit

ConsumerWhat it stores
Nawal AIModel checkpoints, training datasets
Kinich QuantumQuantum computation results
LandLedgerProperty documents and proofs
BNSWebsite content for .bz domains
Maya WalletUser 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:

  1. Upload the site bundle to Pakit → receive the content ID
  2. Set the domain's resolution record to that content ID
  3. Requests resolve through the gateway to the DAG content

See BNS.

Configuration Reference

VariablePurpose
PAKIT_API_PORTREST API port (default 8001)
STORAGE_DIRDAG data directory
DAG_BACKEND_ENABLEDEnable the MerkleDAG backend
DAG_REPLICATION_FACTORReplicas per block
BLOCKCHAIN_RPCSubstrate RPC for proof anchoring
IPFS_ENABLEDOptional legacy IPFS backend

Related