Skip to content

toon-protocol/toon

Repository files navigation

toon

The shared library layer of the TOON Protocol — an ILP-gated Nostr relay network (pay to write, free to read). This repo publishes two npm packages that every TOON node and client builds on:

  • @toon-protocol/core — protocol primitives: the TOON binary codec, Nostr peer discovery (kind:10032), bootstrap, ILP address derivation, settlement chain config, and the structural ConnectorNode interface (EmbeddableConnectorLike).
  • @toon-protocol/sdk — the framework for building an ILP-gated Nostr service: createNode() (verify → price → dispatch), the handler registry, the Arweave DVM handler, swap modules, and the multi-chain settlement engines.

These are libraries only — no Docker image, no end-user CLI. The node products (relay, swap, store), the operator product (hub), and the client consume them from npm.

How it relates to the connector

toon does not vendor the @toon-protocol/connector (the ILP payment engine that validates claims, takes fees, and routes packets). core talks to it only through a structural interface; sdk loads it via an optional, dynamic import. The connector is an optional peer dependencytoon builds and runs without it present, and all payment-claim validation lives in the connector, never here.

Develop

pnpm install
pnpm -r build
pnpm -r test

Getting started with Devbox

Devbox pins the local toolchain to the exact versions CI uses — Node 22 and pnpm 8.15.9 — so pnpm build, pnpm test, and pnpm lint run in a reproducible shell without touching your system packages.

Prerequisites: Install devbox (one-liner).

# Enter the pinned shell (downloads packages on first run via Nix)
devbox shell

# Inside the devbox shell, all tools are on PATH:
node --version    # v22.x
pnpm --version    # 8.15.x

# Run the standard targets (defined as devbox scripts)
devbox run build  # pnpm install --no-frozen-lockfile && pnpm build
devbox run lint
devbox run test

.devbox/ (the Nix symlink/cache dir) is gitignored; devbox.json and devbox.lock are committed.

Release

Publishing is done by CI (.github/workflows/release.yml) via changesets + pnpm (which rewrites workspace:* to real versions at publish time). Add a changeset with pnpm changeset; merging the generated "Version Packages" PR publishes to npm using the org NPM_TOKEN secret.

Extracted from the original TOON monorepo with full history preserved.

About

TOON Protocol shared library layer: @toon-protocol/core + @toon-protocol/sdk

Resources

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors