Documentation
Build with TypeScript libraries for identities, private messages, credentials, delegation, and verifiable logs.
Start with the Quickstart for a complete trust exchange. Use the SDK reference for imports, examples, and public API declarations, or Concepts for the protocols behind them.
Setup
You'll need Node 22.13 or later. Install the libraries you use from npm. Each is a separate package under @toip-tools; start with trust-core, which every other library builds on:
npm install @toip-tools/trust-core
Add others as you need them, for example @toip-tools/relay for a message relay, @toip-tools/mandates for delegation, or @toip-tools/eventlog for verifiable logs. The SDK reference lists all of them. The packages are ES modules with TypeScript declarations, and work in Node and, through a bundler, in browsers.
To run this site's examples, or to change the libraries, clone the repository instead. Build the packages after installing:
git clone https://github.com/yourbuddyconner/toip-tools.git
cd toip-tools
npm install
npm install --prefix site
npm run build
From the repository root, run a signed, encrypted request and response over an in-memory transport:
npx tsx --tsconfig site/tsconfig.json site/examples/snippets/trust-core.ts
Run all four Quickstart steps, including a local relay and credential revocation:
npm run quickstart --prefix site
Guides
Short how-tos, each one complete program you can run:
- Create a did:key and sign a JSON document in TypeScript
- Issue and verify a W3C verifiable credential in TypeScript
- Revoke a verifiable credential with a status list
- Send an end-to-end encrypted message with TSP (the Trust Spanning Protocol)
- Run a TSP relay: a mailbox for encrypted messages
- Delegate bounded authority to an AI agent with mandates
- Keep a tamper-evident audit log with KERI key event logs
- Sign and verify COSE messages in TypeScript
- Send Trust Tasks over LoRa radio
- Prove group membership with zero knowledge (Noir)
Work from the source
The root package.json lists the libraries in packages/ and applications in projects/ as npm workspaces. Installing at the root links local package names such as @toip-tools/trust-core, @toip-tools/mandates, and @toip-tools/mesh-transport.
To build an application in this repository, add it to the root workspace list and declare each library it uses as a dependency matching its package manifest. The current trust-core version is 0.1.0. Run npm install from the root after changing those manifests, then npm run build to create the packages' dist/ JavaScript and type declarations. Standard package imports use those build outputs; the @toip-tools/source export condition selects TypeScript source for development.
The standalone site examples instead resolve package names through site/tsconfig.json. Its paths map public imports to local source; pass that configuration to tsx as shown above. Subpath imports, such as @toip-tools/mesh-transport/sim, have explicit mappings. These paths apply to this checkout only; in your own project, install the packages from npm.
Next steps
- Quickstart: create identities, exchange Trust Tasks, and verify credentials.
- Guides: one task each, such as signing with a did:key or running a relay.
- FAQ: Trust over IP, TSP, runtimes, and how this project relates to the ToIP Foundation.
- SDK reference: choose a library and look up its public API.
- Trust Task reference: inspect the message types used by the applications.
- Examples: run complete applications and read their designs.