Open-source development framework for Kaspa L1: CLI, TypeScript SDK and IDE. Website: hardkas.dev · Docs: hardkas.dev/docs
HardKAS is an open-source, local-first development framework for Kaspa L1: a CLI and a TypeScript SDK to plan, send and verify transactions and SilverScript contracts on your own simnet node. It is an independent community project, not an official Kaspa tool.
Inspired by the developer ergonomics of Ethereum tooling like Hardhat and Foundry, HardKAS provides:
- Instant In-Memory Simulator (experimental): Plan, sign and simulate Kaspa transactions locally in seconds, with no node and no network. It is an approximate model: confirm timelock, covenant and mass behaviour on simnet (limitations).
- Managed Docker Localnet: One-command local
simnetrunning officialrusty-kaspadv2.1.0 (pinned by image digest) with automatic CPU mining. - Deterministic Accounts & Funding: Pre-configured developer accounts (
alice,bob,carol) for reproducible test flows. - SilverScript & Covenants Toolchain: Managed integration for the official
silverc v1.0.0compiler, P2SH deploy/spend, and Toccata 1:1 auth-bound covenants. - Cryptographic Artifacts: Every transaction plan, signed payload, and receipt is hashed into immutable JSON artifacts that can be verified offline. Simulator runs can also be replayed.
- Visual IDE & Studio: Standalone visual developer workbench with Monaco editor, SilverScript compiler, Deploy & Run, Covenant graph and local node telemetry (HardKas IDE).
Important
Kaspa L1 is a UTXO BlockDAG, NOT an EVM. HardKAS is built from first principles for Kaspa's UTXO and Kaspa Script architecture. It provides the developer experience of Hardhat for the Kaspa ecosystem without pretending Kaspa is an EVM or executing Solidity bytecode on L1.
| Feature / Dimension | Ethereum (Hardhat / Foundry) | Kaspa L1 (HardKAS) |
|---|---|---|
| Ledger Model | Account-based global state | UTXO Proof-of-Work GHOSTDAG (BlockDAG) |
| Smart Contracts | EVM Bytecode (Solidity / Vyper) | Kaspa Script & SilverScript Covenants (Toccata) |
| Fast Unit Testing | Hardhat Network / Anvil (local EVM) | HardKAS Simulator (in-memory synchronous UTXO engine) |
| Local Node Testing | Local geth or anvil container |
Managed Docker rusty-kaspad on simnet with CPU miner |
| State Inspection | Transaction traces & state diffs | Verifiable JSON Artifacts (TxPlan, SignedTx, TxReceipt) |
| Verification & Debug | Hardhat console / console.log | Offline artifact verification; deterministic replay of simulator runs |
| Dev Server & APIs | Hardhat Node / Remix | HardKAS Dev Server (@hardkas/dev-server REST & SSE) |
Requirements: Node.js 24.22.1 exactly (the version HardKAS is built, tested and pinned on: engines declares it, and hardkas doctor warns on another 24.x and fails on other major lines) and npm. Docker only for the local node.
Release note:
1.0.0is the first stable release (see Version Guarantees). It publishes 18 packages, where the last candidate,0.13.0-rc.3, had 22 (@hardkas/escrowis now in@hardkas/sdk,@hardkas/jobsin@hardkas/toolkit,@hardkas/node-orchestratorin@hardkas/node-runnerand@hardkas/sessionsin@hardkas/core). Use@latest(or@1.0.0) when installing from npm, orpnpm hardkasinside this monorepo.
# Initialize a new HardKAS workspace with deterministic accounts
npx @hardkas/cli@latest init my-kaspa-app
cd my-kaspa-app
# init writes a package.json that pins @hardkas/cli; install it so `npx hardkas` runs the project's copy
npm install# Plan, verify, and simulate an in-memory transaction
npx hardkas tx plan --from alice --to bob --amount 10 --network simulated --out tx-plan.json
npx hardkas artifact verify tx-plan.json --strict
npx hardkas tx sign tx-plan.json --account alice --out tx-signed.json
npx hardkas tx send tx-signed.json --network simulated --yes
# Replay the simulator run, using the receipt ID printed by send (replay covers simulator runs only)
npx hardkas replay verify <receipt-id># Start a real local Kaspa simnet node in Docker with automated mining
npx hardkas localnet start --profile toccata-v2
npx hardkas localnet status --json
npx hardkas localnet fund alice --profile toccata-v2To run a node of your own instead (your container, your ports) and take one payment, a SilverScript contract and a
covenant all the way to artifact verify, follow Build on your own simnet.
If you are using Claude Code, Cursor, or another AI coding agent:
- Short navigation map: hardkas.dev/llms.txt
- Full AI reference & verified CLI/SDK recipes: hardkas.dev/llms-full.txt
- AI documentation section: Build on Kaspa with AI (workflows, troubleshooting, Claude Code & Cursor)
- Rule of thumb: Prefer HardKAS CLI/SDK over custom
kaspa-wasmboilerplate, runhardkas doctor --jsonfirst, and validate consensus behavior onsimnet(neversimulatedor localSCRIPT_VMalone).
# Launch the headless local developer API & telemetry daemon (http://localhost:7420)
npx hardkas dev
# For the complete visual studio & workbench (editor, compiler, covenant graph, node manager):
# Run HardKas IDE (https://github.com/KasLabDevs/HardKasIDE)Normal apps:
request -> mutation -> hopeHardKAS:
intent -> artifact -> verification -> execution -> replayThe entire lifecycle of Kaspa UTXOs—from genesis injection to final signature submission—can be tracked, hashed, signed, processed in the simulator, receipted and indexed. Simulator runs can be replayed; real-node sends are checked with hardkas verify and hardkas tx status.
HardKAS 1.0.0 uses the strictly partitioned Execution Contract.
The Execution Contract is a tuple of (mode, domain, network) that unambiguously identifies the context in which an artifact was created, an execution target is connected, or an account exists.
mode: The environment topology (simulator,localnet,rpc,l2-rpc)domain: The ledger semantics (kaspa-l1,evm-l2)network: The network identifier (simulated,simnet,testnet-10,mainnet)
Common targets:
- Simulator:
{ mode: "simulator", domain: "kaspa-l1", network: "simulated" }The JS-based, in-memory, synchronous transaction simulator. Accounts, UTXOs, and funds are strictly synthetic. - Localnet:
{ mode: "localnet", domain: "kaspa-l1", network: "simnet" }A real Kaspa node (rusty-kaspad) running locally via Docker onsimnetwith real Proof-of-Work and local mining. - RPC:
{ mode: "rpc", domain: "kaspa-l1", network: "testnet-10" }A remote connection to a configured Kaspa node.
Compatibility Invariants:
artifact.executionMUST be compatible withtarget.execution.account.network/identityMUST be compatible withtarget.execution.receipt.executionMUST be compatible withartifact.executionANDtarget.execution.
Warning
Simulator != Kaspa simnet
simulated (network) = In-memory synthetic Kaspa ruleset in HardKAS simulator mode.
simnet (network) = Official Kaspa network type used by HardKAS localnet mode.
HardKAS 1.0.0 is local-first deterministic transaction infrastructure
for Kaspa/Toccata development.
Current baseline, verified by the release checks:
simulatoris the recommended default for fast, synchronous testing.- Toccata v2 Docker
localnetbaseline (rusty-kaspadon Kaspasimnet).
- Toccata v2 Docker
- Real local funding by mining with the upstream
kaspanet/cpuminerimage inlocalnet. - Standard transaction lifecycle against the local node.
- SilverScript through the official silverc v1.0.0: P2SH deploy/spend and 1:1 auth-bound covenants on the local node.
- Machine-verifiable golden corpus.
- Release gauntlet through
pnpm gauntlet:toccata. - mainnet is blocked: nothing in HardKAS signs, sends or connects to mainnet in this release line.
- HardKAS is not a wallet, custody system, consensus layer, or production mainnet signing environment.
The 1.0 release line includes a normalized Toccata v2 localnet flow:
- Docker
rusty-kaspadv2.1.0 localnet (pinned by digest) funding with a compatible miner companion (kaspanet/cpuminer). - Standard transaction lifecycle against the local node.
- SilverScript compile, P2SH deploy/spend and a 1:1 covenant transition on the local node, each capability reported on its own by the Toccata gauntlet (simulated steps do not count).
- Machine-verifiable golden corpus (
fixtures/toccata-v2/silver), recompiled and re-derived offline by the gauntlet.
Full Kaspa VM or consensus equivalence is not claimed.
Official release claims:
artifactCoherence:READY_MATCHruntimeOutcome:PARTIALvmConsensusEquivalence:NOT_CLAIMEDmainnet:BLOCKED_BY_POLICY
1.0.0 includes high-level
SDK surfaces for capabilities, localnet status/start/fund, and SilverScript compile and corpus verification,
without changing the release claims above. It enforces strict separation of execution environments across Artifact lineage.
The SDK plans, signs and sends SilverScript deploys, spends and covenant transitions on a node through
sdk.covenants (transaction v1); sdk.experimental.silver compiles, reproduces and derives P2SH addresses (simnet).
1.0.0 also includes a local-only builder surface for SilverScript,
ZK corpus fixtures, and vProgs artifact inspection. This is a programmability
surface, not a protocol/runtime claim.
Programmability surfaces:
hardkas programmability capabilities --jsonhardkas programmability corpus verify fixtures/toccata-v2 --jsonhardkas programmability inspect <path> --kind silver|zk|vprog --jsonhardkas programmability app plan --kind full-lab --jsonawait sdk.experimental.programmability.capabilities()await sdk.experimental.programmability.corpus.verify({ path })await sdk.experimental.programmability.inspect({ kind, path })
ZK corpus surfaces:
hardkas zk capabilities --jsonhardkas zk proof inspect <path> --jsonhardkas zk proof verify-local <path> --jsonhardkas zk corpus verify fixtures/toccata-v2/zk --jsonawait sdk.experimental.zk.capabilities()await sdk.experimental.zk.proof.inspect(path)await sdk.experimental.zk.proof.verifyLocal(path)await sdk.experimental.zk.corpus.verify(path)
vProgs inspect surfaces:
hardkas vprogs capabilities --jsonhardkas vprogs status --jsonhardkas vprogs inspect <artifact> --jsonawait sdk.experimental.vprogs.capabilities()await sdk.experimental.vprogs.status()await sdk.experimental.vprogs.inspect(path)
SilverScript v1 (hardkas silver): the official silverc v1.0.0 and the Kaspa SDK,
with real-node evidence per capability in fixtures/toccata-v2/silver — P2SH
execution, relative timelock, and a Toccata tx-v1 1:1 auth-bound covenant
transition. General covenant support is not claimed.
ZK/vProgs lab claims:
ZK_CORPUS_SURFACE_READYandVPROGS_INSPECT_SURFACE_READY(local inspection surfaces only; no runtime or on-chain claim)- Groth16 corpus verification is local fixture coherence only.
- RISC Zero Groth16 receipts are verified locally against the pinned RISC Zero key (
hardkas zk toccata verify-receipt); HardKAS builds the lock scripts, andhardkas zk toccata spendsends a lock's spend through HardKAS's own send (recorded, one submission per txId; simnet and testnet-10 only, proven on simnet). The node verifies the proof: HardKAS claims no on-chain ZK verification of its own. - vProgs is inspect-only.
ZK_ONCHAIN_VERIFICATION_NOT_CLAIMEDVPROGS_STABLE_API_NOT_CLAIMEDvmConsensusEquivalence:NOT_CLAIMEDmainnet:BLOCKED_BY_POLICY
pnpm build
pnpm test
pnpm packaging:smoke
pnpm gauntlet:toccatapnpm test is the canonical gate. CI runs it on Ubuntu, Windows and macOS from the frozen lockfile. For a release, run
it hermetically:
node scripts/gate-hermetic.mjs --home <a HARDKAS_HOME with kaspa-wasm installed>That run gives the gate a private HARDKAS_HOME, makes Docker unreachable, refuses every non-loopback connection and,
by default, also refuses loopback connections to the managed localnet's ports 16210 (gRPC), 17210 (Borsh wRPC) and
18210 (JSON wRPC), and to 18211, a port some suites fall back to. A
kaspad or simulator that happens to run on the machine therefore cannot change the verdict. --deny-ports a,b replaces
that list. --allow-local-node-ports turns it off for diagnosis only, and a run made that way is not the release gate.
Node-dependent suites run at their own levels (vitest.simnet.config.ts, vitest.silverc.config.ts), never inside
this gate.
Most CLI commands state their maturity at the end of their --help description: stable, beta, preview,
alpha, experimental, research or internal; an unlabelled command is not stable. Only stable commands are
covered by the release scope. On the SDK, the
surfaces under sdk.experimental.* carry no stability promise. hardkas capabilities --json prints a warning that it
is internal/experimental. The levels, and what each one promises, are described in
docs/status/versioning.md, and the known gaps in
docs/status/limitations.md.
Not covered by any guarantee:
@hardkas/simulator(experimental: an approximate model, not consensus evidence);- the L2 extension (
@hardkas/ext-l2) and the L2 library (@hardkas/l2), experimental and not published in this release; @hardkas/pskt-native, which is on hold and not published;@hardkas/sdkdoes not depend on it. Its prebuilt binary is built from rusty-kaspa 2.0.1 crates (not v2.1.0, which the rest of HardKAS pins). It ships for win32-x64 only, with no hash recorded in its provenance, and itsindex.d.tsis empty, so TypeScript consumers that import it do not compile. Its signer is permissive (audit HK-13). Rebuilding it is BLOCKED while the package is on hold. The SDK's PSKT surface uses the kaspa-wasm adapter unless the native one is registered explicitly. See limitations.
Toccata localnet and corpus commands:
hardkas localnet start --profile toccata-v2
hardkas localnet status --json
hardkas localnet fund alice --profile toccata-v2
hardkas corpus verify fixtures/toccata-v2/silver --jsonimport { Hardkas } from "@hardkas/sdk";
// Runs on the simulator; without `network` (or `target`) the workspace's default execution target decides.
const sdk = await Hardkas.create({ network: "simulated", autoBootstrap: true });
const plan = await sdk.tx.plan({ from: "alice", to: "bob", amount: "10" }); // a string amount is KAS
const signed = await sdk.tx.sign(plan, { account: "alice" });
const { receipt } = await sdk.tx.simulate(signed);
// Replay is addressed by the receipt's artifact id (its contentHash), not by its txId.
const replay = await sdk.replay.verify(receipt.contentHash);
console.log(receipt.txId, replay.passed); // synthetic-<64 hex> trueHardKAS CLI commands are scoped to execution worlds:
Synthetic testing without real nodes. Uses JS-based synthetic state and accounts.
HardKAS includes deterministic accounts (alice, bob, carol) by default, but you can create custom ones:
hardkas simulator account create custom-wallet
hardkas simulator fund custom-wallet --amount 1000
hardkas tx send --from custom-wallet --to bob --amount 10 --network simulated --yesA complete managed developer environment wrapping a real rusty-kaspad node. It provides orchestration for local mining (PoW), real Kaspa simnet UTXOs, and developer-friendly local accounts.
hardkas localnet start --profile toccata-v2
hardkas localnet account create treasury
hardkas localnet fund treasuryhardkas tx plan --from alice --to bob --amount 10 --network simulated --out tx-plan.json
hardkas artifact inspect tx-plan.json
hardkas artifact verify tx-plan.json --strict
hardkas tx sign tx-plan.json --account alice --out tx-signed.json
hardkas tx send tx-signed.json --network simulated --yesImmutable JSON files representing planned transactions, signed payloads, receipts, traces, workflows, and replay reports. They use canonical hashing so the same inputs produce the same identity across platforms.
The causal chain between artifacts. A receipt points back to a signed transaction, which points back to the original plan.
The local verification engine that reconstructs a simulator workflow from artifacts and checks whether the observed state transition remains deterministic. It covers simulator runs only.
A rebuildable SQLite projection over .hardkas/artifacts and local events. It
exists for fast reads by CLI, query services and dev-server; the filesystem artifacts remain the
source of truth.
- Deterministic hashing through canonical serialization.
- Tamper detection by recalculating artifact hashes at consumption time.
- Planning and signing isolation.
- Rebuildable projections from committed artifacts.
- Toccata v2 localnet baseline guarded by
pnpm gauntlet:toccata. - Mainnet signing, broadcast and connections blocked in this release.
- Not a production wallet.
- Not a custody system.
- Not a consensus layer.
- Not a replacement for Kaspa nodes.
- Not a promise that local simulation equals mainnet finality.
See docs/ for architecture, limits, command references, and security claims.