# Documentation

Build with TypeScript libraries for identities, private messages, credentials, delegation, and verifiable logs.

Start with the [Quickstart](https://toip.tools/quickstart/) for a complete trust exchange. Use the [SDK reference](https://toip.tools/toolkit/) for imports, examples, and public API declarations, or [Concepts](https://toip.tools/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:

Terminal:

```bash
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](https://toip.tools/toolkit/) 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:

Work from the source:

```bash
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:

Run the trust-core example:

```bash
npx tsx --tsconfig site/tsconfig.json site/examples/snippets/trust-core.ts
```

Run all four Quickstart steps, including a local relay and credential revocation:

Run the Quickstart:

```bash
npm run quickstart --prefix site
```

For coding assistants

## Ask your AI assistant

Assistants write better code with the documentation in front of them. Paste this prompt into yours, then describe what you're building.

Prompt:

```text
I'm building with the @toip-tools TypeScript libraries (on npm, Node 22.13 or later).
Before writing code, read https://toip.tools/llms-full.txt: it holds their documentation, guides and Trust Task reference.
Use only the exports and options it documents, install packages as @toip-tools/<name>, and tell me if something I ask for isn't supported.

My task: 
```

[llms-full.txt](https://toip.tools/llms-full.txt) · all docs in one Markdown file · [llms.txt](https://toip.tools/llms.txt) · an index · [JSON indexes](https://toip.tools/api/) · packages, exports and Trust Tasks

## Guides

Short how-tos, each one complete program you can run:

- [Create a did:key and sign a JSON document in TypeScript](https://toip.tools/guides/did-key-sign-document/)
- [Issue and verify a W3C verifiable credential in TypeScript](https://toip.tools/guides/issue-verify-credential/)
- [Revoke a verifiable credential with a status list](https://toip.tools/guides/revoke-credential-status-list/)
- [Send an end-to-end encrypted message with TSP (the Trust Spanning Protocol)](https://toip.tools/guides/tsp-encrypted-message/)
- [Run a TSP relay: a mailbox for encrypted messages](https://toip.tools/guides/run-tsp-relay/)
- [Delegate bounded authority to an AI agent with mandates](https://toip.tools/guides/delegate-to-ai-agent/)
- [Keep a tamper-evident audit log with KERI key event logs](https://toip.tools/guides/tamper-evident-audit-log/)
- [Sign and verify COSE messages in TypeScript](https://toip.tools/guides/sign-cose/)
- [Send Trust Tasks over LoRa radio](https://toip.tools/guides/trust-tasks-over-lora/)
- [Prove group membership with zero knowledge (Noir)](https://toip.tools/guides/zero-knowledge-membership/)

## Work from the source

The root [`package.json`](https://github.com/yourbuddyconner/toip-tools/blob/main/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](https://github.com/yourbuddyconner/toip-tools/blob/main/packages/trust-core/package.json) 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`](https://github.com/yourbuddyconner/toip-tools/blob/main/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](https://toip.tools/quickstart/): create identities, exchange Trust Tasks, and verify credentials.
- [Guides](https://toip.tools/guides/): one task each, such as signing with a did:key or running a relay.
- [FAQ](https://toip.tools/faq/): Trust over IP, TSP, runtimes, and how this project relates to the ToIP Foundation.
- [SDK reference](https://toip.tools/toolkit/): choose a library and look up its public API.
- [Trust Task reference](https://toip.tools/spec/): inspect the message types used by the applications.
- [Examples](https://toip.tools/examples/): run complete applications and read their designs.

---

This is the Markdown version of https://toip.tools/docs/. An index of the documentation for AI assistants is at https://toip.tools/llms.txt.
