KGKasGraphGitHub
Kaspa-native indexing and query infrastructure

Structured indexing for Kaspa applications.

KasGraph turns Kaspa blocks, UTXOs, Covenant IDs, KRC assets, and BlockDAG activity into queryable data for wallets, explorers, dashboards, dApps, and AI agents.

GraphQL·MCP·WebSockets·KasStream·Postgres·Proof of Indexing·BlockDAG-aware reorg handling

query demo

Query Kaspa state like application data.

Ask for covenant activity, token balances, indexed entities, or BlockDAG-aware history without parsing raw blocks and UTXO responses in every app.

graphql
query CovenantActivity($covenantId: String!) {
  covenant(id: $covenantId) {
    id
    transactions {
      hash
      daaScore
      acceptedAt
      inputs
      outputs
    }
  }
}
Covenant IDs
KRC assets
DAA-aware history

what it solves

Kaspa apps need indexed state, not another raw RPC wrapper.

KasGraph gives developers a shared indexing layer for blocks, UTXOs, Covenant IDs, KRC assets, reorg-aware history, and application-specific entities. Wallets, explorers, dashboards, covenant apps, analytics systems, and AI agents can query the same data plane instead of each rebuilding parsers, storage, reconciliation, and RPC failover.

demo preview

PreviewLocal-first

See KasGraph query indexed Kaspa state.

No public hosted endpoint is advertised yet. This is a static preview of the intended GraphQL shape until the hosted node, playground, and testnet soak are validated.

endpoint statePreview

Network

preview

Indexed DAA

unavailable

POI

unavailable

GraphQL

not configured

graphql preview
query CovenantLineage($covenantId: String!) {
  covenant(id: $covenantId) {
    id
    createdAtDaaScore
    transactions {
      hash
      daaScore
      acceptedAt
      spendPath
    }
    currentUtxos {
      txid
      index
      amount
      address
    }
  }
}
json preview output
{
  "data": {
    "covenant": {
      "id": "cov_8fa4b21...",
      "createdAtDaaScore": 467579632,
      "transactions": [
        {
          "hash": "3b2f9c...",
          "daaScore": 467579812,
          "acceptedAt": "2026-05-18T16:04:22Z",
          "spendPath": "verifier_release"
        }
      ],
      "currentUtxos": [
        {
          "txid": "9ac41e...",
          "index": 0,
          "amount": "1250000000",
          "address": "kaspatest:q..."
        }
      ]
    }
  }
}

proof of life

Proof of life.

The latest checked-in testnet soak artifact is published with public-safe health, POI, logs, and restart-note references.

Soak artifact - published
{
  "status": "completed",
  "runDate": "2026-06-01",
  "duration": "24.0 hours",
  "network": "kaspa-testnet-10",
  "verdict": "Success: 24-hour testnet soak target reached."
}
Public log artifact - published
{
  "artifact": "/docs/artifacts/testnet-soak/2026-06-01/public-log-tail.jsonl",
  "indexedDaa": "479501516",
  "blocksIndexed": "236759",
  "note": "Sanitized public log tail is checked in with the soak artifact."
}
POI checkpoint artifact - published
{
  "artifact": "/docs/artifacts/testnet-soak/2026-06-01/public-poi-checkpoints.jsonl",
  "poiCheckpoints": "236759",
  "latestPoiCheckpoint": "0x527695bea514e26112a755f48c18a4dbb581d25302a45cefab66a605e9506c93"
}
Metrics and restart artifacts
DB stats: /docs/artifacts/testnet-soak/2026-06-01/public-db-stats.jsonl
Resource metrics: /docs/artifacts/testnet-soak/2026-06-01/public-resource-metrics.jsonl
Restart notes: /docs/artifacts/testnet-soak/2026-06-01/restart-recovery-notes.md
Restart recovery: Not measured
Known issues: KasGraph soak API ran on 127.0.0.1:4002 because 127.0.0.1:4000 was occupied by LiteLLM.; Root cause fixed before completion: local TN10 was stale kaspad v1.1.0 and root disk was too full for the Toccata pruning-point UTXO import; the completed run used kaspad v1.2.1-toc.3 with sufficient disk.; At the 24-hour completion point, kaspad still reported phase syncing live DAG and kaspadSynced false; KasGraph indexing, RPC audit, Postgres, GraphQL health, and POI checkpoints remained active through the completion target.

example apps

Example apps powered by KasGraph.

These are concrete integration targets for the indexing layer, not claims of existing production deployments.

KRC-20 dashboard

Problem: Token dashboards need supply, holders, transfers, and activity without custom inscription parsers.

KasGraph provides: Indexed KRC entities, transfer history, holder counts, and GraphQL queries.

example query/output
tokens(first: 10) { ticker holdersCount totalSupply }

KRC-721 explorer

Problem: NFT explorers need ownership, transfers, collections, and metadata timelines.

KasGraph provides: Collection and token entity schemas backed by KRC-721 detectors and mappings.

example query/output
collections { id tokenCount ownersCount }

Covenant lineage explorer

Problem: Covenant apps need to follow spend paths, state transitions, and UTXO lineage.

KasGraph provides: Covenant ID indexing, lineage queries, and BlockDAG-aware history.

example query/output
covenant(id: $id) { transactions { spendPath } currentUtxos { txid } }

KasBonds verifier dashboard

Problem: Verifier dashboards need SLA bonds, signatures, deadlines, releases, and slashes.

KasGraph provides: App-specific subgraphs with typed entities and POI-backed checkpoints.

example query/output
bonds(where: { status: ACTIVE }) { id deadline verifier }

AI agent state reader

Problem: Agents should not scrape explorers or infer raw RPC responses.

KasGraph provides: MCP tools for schema discovery, query execution, pattern search, and lineage reads.

example query/output
get_covenant_lineage({ covenantId: "cov_..." })

Wallet asset indexer

Problem: Wallets need fast access to balances, token holdings, activity, and app state.

KasGraph provides: Indexed wallet-facing entities, asset balances, transfer history, and subscriptions.

example query/output
wallet(address: $addr) { assets { id balance } transfers { hash } }

one data plane

Query, stream, and automate through one indexed data plane.

View architecture

GraphQL

Typed queries over indexed entities, covenant lineage, asset state, checkpoints, and subgraph schemas.

MCP

Agent tools for listing subgraphs, reading schemas, executing queries, searching patterns, and inspecting lineage.

WebSockets

Push updates for explorers, dashboards, wallets, and operational views that need fresh indexed state.

KasStream

A low-latency stream of detected Kaspa activity for event-driven products and downstream pipelines.

architecture

Purpose-built around Kaspa primitives.

The node ingests Kaspa RPC and wRPC streams, applies detectors and WASM mappings, writes PostgreSQL state, computes POI checkpoints, and serves GraphQL, MCP, KasStream, and WebSocket consumers.

stage 01
Kaspa Node / RPC / wRPC

Blocks, accepted transactions, virtual-chain changes, and continuous notifications.

stage 02
KasGraph Indexer

Ingests Kaspa activity, tracks progress, handles reorg-aware state transitions, and dispatches work.

stage 03
Detectors + Mappings

Recognizes KRC assets, Covenant IDs, app patterns, and runs deterministic mapping handlers.

stage 04
Proof of Indexing

Builds checkpoint hashes over indexed entity state so output can be independently compared.

stage 05
PostgreSQL Entity Store

Stores registry rows, schemas, lineage, checkpoints, and versioned application entities.

stage 06
GraphQL / SDK / CLI / MCP / WebSocket / KasStream

Serves query, developer, agent, subscription, and streaming interfaces.

stage 07
Wallets / Explorers / Dashboards / AI Agents / Covenant Apps

Consumes indexed state without every product rebuilding a parser.

developer workflow

Define the data you want. KasGraph handles the indexing path.

Scaffold a subgraph, generate TypeScript types from GraphQL SDL, compile the AssemblyScript mapping to WASM, deploy it to a registry, then query the gateway.

quickstart
npx kasgraph init my-subgraph
cd my-subgraph
npx kasgraph codegen
npx kasgraph build
npx kasgraph deploy --database-url "$DATABASE_URL"
npx kasgraph status my-subgraph

kaspa primitives

Not an Ethereum-shaped indexer pointed at Kaspa.

KasGraph is designed around UTXO state transitions, Covenant ID lineage, BlockDAG finality, KRC assets, and verifiable indexing output.

UTXO-first indexing

Model application state from inputs, outputs, spends, and lineage instead of forcing an account-based event-log shape.

KIP-20 Covenant IDs

Use stable consensus-tracked identifiers to query covenant history without recursive UTXO walking in every app.

KRC-20 / KRC-721 assets

Index legacy inscription activity and native covenant-era assets as first-class query targets.

BlockDAG reorg handling

Track committed and probabilistic block state with unwind semantics designed for Kaspa virtual-chain changes.

Postgres-backed entities

Store deployed subgraphs, schemas, checkpoints, lineage, and versioned entities in a durable relational model.

Proof of Indexing

Maintain a blake2b-256 hash chain over indexed entity state so output can be independently verified.

ai-native

AI agents get tools, not scraped explorer pages.

MCP is a first-class interface over the same indexed registry and gateway used by applications. Agents can discover schemas, execute queries, inspect Covenant ID lineage, and search detected Kaspa patterns with structured tool calls.

list_subgraphslive
get_schemalive
execute_querylive
search_by_patternlive
get_covenant_lineagelive

status

Open-source core infrastructure, moving toward hosted validation.

The build -> deploy -> index -> query pipeline is multi-tenant, hot-reloadable, verified end-to-end against real Postgres, and backed by a published 24-hour testnet soak. Remaining public-launch work includes hosted topology, log streaming, benchmarks, and deployment confirmation.

Read the full status

benchmarks

Benchmarks.

This table separates the published testnet soak artifact from performance benchmarks that still need repeatable hosted measurements.

Indexing throughput

Pending measurement

Query latency

Pending measurement

Reorg handling latency

Pending measurement

PostgreSQL storage growth

Pending measurement

WebSocket/KasStream event latency

Pending measurement

MCP tool response latency

Pending measurement

POI checkpoint cost

Pending measurement

Testnet soak duration

24.0 hours

Mainnet readiness

Not production-ready

MetricCurrent ResultTargetStatusNotes
Indexing throughputPendingTBD blocks/secPending measurementRequires repeatable benchmark run beyond the completed soak.
GraphQL query latencyPendingTBD ms p95Pending measurementRequires hosted endpoint and representative subgraphs.
Reorg handling latencyPendingTBD secondsPending measurementNeeds controlled virtual-chain/reorg simulation.
PostgreSQL storage growthPendingTBD GB / million txsPending measurementDepends on entity volume and indexing profile.
WebSocket/KasStream event latencyPendingTBD ms p95Pending measurementRequires live streaming deployment.
MCP tool response latencyPendingTBD ms p95Pending measurementRequires hosted MCP/gateway path.
Proof-of-Indexing checkpoint costPendingTBD ms/checkpointPending measurementDepends on entity update volume.
Testnet soak duration24.0 hours24h minimum / 72h preferredcompletedPublished 2026-06-01 artifact on kaspa-testnet-10 with 236759 blocks and 236759 POI checkpoints.
Mainnet readinessNot validatedDefined checklistNot production-readyRequires monitoring, benchmarks, runbooks, and mainnet validation.

contribute

Contribute to KasGraph.

KasGraph is open-source infrastructure. Useful contributions include indexing correctness, example subgraphs, benchmark harnesses, docs, and operational validation.

Indexer core
GraphQL schema
KRC asset mappings
Covenant detectors
MCP tools
Docs/tutorials
Benchmarks
Testnet soak testing
Example dashboards