Today we're releasing the first alpha of the Kontor SDK — a TypeScript SDK for building applications on Bitcoin with the Kontor metaprotocol.
Kontor distinguishes itself from other smart-contracts-on-Bitcoin systems by offering a full-featured platform with rich, developer-friendly tooling.
What makes the SDK special: from a WIT specification, developers get a fully typed contract interface at compile time.
No code generation. No hand-rolled serialization logic. Just simple interfaces and transparent types.
Links:
The Kontor SDK treats contract interfaces as executable type definitions. From a WIT specification, the SDK derives function names, call modes (view vs proc), parameter types, return values, and encoding rules — all at the type level.
No codegen step. No generated files. No runtime schema validation.
Contract call correctness is enforced at compile time, not discovered after a transaction fails.
The SDK is intentionally explicit and modular, providing clear separation between querying state, composing calls, and signing transactions. The goal is to abstract away implementation details of Kontor while maintaing transparency of the underlying programming model.
You get:
Install the SDK:
npm install @kontor/kontor-sdk@alpha
Define a contract interface using WIT:
import {
parseWit,
getContract,
signet,
createKontorIndexerClient,
http,
} from "@kontor/kontor-sdk";
const token = parseWit([
"record balance { acc: string, amt: decimal }",
"export balances: func(ctx: borrow<view-context>) -> list<balance>;",
] as const);The as const is important — it allows the SDK to extract literal types directly from the WIT definition.
Create an indexer client and get a typed contract handle:
const indexerClient = createKontorIndexerClient({
chain: signet,
transport: http(),
});
const contract = getContract({
wit: token,
contractAddress: "token_0_0",
client: indexerClient,
});
Call a view function:
const balances = await contract.view.balances();
What you get back is not any:
Array<{ acc: string; amt: bigint;}>
Key details:
ctx: borrow<view-context> parameter is supplied by the runtime, not the callerKontor uses a Taproot P2TR commit-and-reveal scheme to encode contract execution on Bitcoin.
The SDK separates responsibilities:
Indexer client:
proc methods )view methods )Wallet client:
Every write follows the same flow:
compose → sign commit → sign reveal → broadcastFor walkthroughs, see Getting Started and Composing + signing a transfer.
The alpha covers the "real application" baseline:
@kontor/kontor-sdkExplore the building blocks:
This is an alpha release. We're optimizing for:
Expect rough edges — and please tell us when you hit them. Open an issue or PR on GitHub, or reach out through Kontor community channels.