📦
v0.2.0 — released

The published P2P Trust Stack

The trust stack is published to npm as two packages: @p2p-trust-stack/core — the protocol engine (cryptographic primitives, DID infrastructure, the Trust Spanning Protocol, relationships, the encrypted keystore, and the VTC/VRC governance framework) — and @p2p-trust-stack/app-api — the application-facing agent API, which depends on core.

Both are dual-licensed: GPL-3.0 for open use, or a commercial license where GPL-3.0 obligations are not acceptable. Requires Node.js ≥ 22.5, and is Node-only (no browser build).

# application developers — core comes with it
npm install @p2p-trust-stack/app-api

# protocol-only embedders
npm install @p2p-trust-stack/core

API Reference →

core on npm ↗  ·  app-api on npm ↗  ·  GitHub repository ↗  ·  CHANGELOG ↗  ·  Commercial license ↗

What the stack provides

🔢 Cryptography
Signing, key agreement, encryption
🪪 Decentralized Identifiers
did:scid:vh, did:peer:4, rotation
✉️ TSP Messaging
Seal/open, payload types, transport interface
🤝 Relationships
Peer handshake, OOBI, persistence
🏛️ Trust Communities
Community policy, signature thresholds
🗄️ Keystore
AES-256-GCM + Argon2id encrypted storage
🧩 Agent API
createAgentStack, 10 domains, events
📇 Profiles & Credentials
R-Cards, VRC issue/verify, disclosure rules

The API Reference documents every method — grouped by the four Trust over IP layers, with a module-by-module reference for the core protocol layer.

Operational Flows

The following flows are operational in the P2P Trust Stack testbed. Each is built on open W3C and IETF standards (DIDs, Verifiable Credentials, HPKE) and was demonstrated at the August 2026 trust stack demo.

🪪

VTA Creation

Create a self-certifying did:scid:vh identity with Ed25519/X25519 key pairs and hash-chained verifiable history. No ledger dependency.

📛

Agent Name Registration

Register a human-readable name cryptographically bound to a did:scid:vh identity via two-phase commit over the Trust Spanning Protocol.

🔑

Challenge/Response Login

Authenticate as a VTA using Ed25519-signed challenge-response with single-use nonces and SHA-256 expiry verification.

🔍

Name Resolution

Look up an agent name to retrieve the associated DID Document with service endpoints for messaging and discovery.

🪪

R-Card Retrieval

Retrieve profile-card data. The API catalog describes per-claim disclosure settings; these settings do not, by themselves, establish credential wrapping, update verification, or a zero-knowledge presentation flow.

🔒

Confidential P2P Chat

Authenticated messaging with optional end-to-end encryption for confidential content. Recipients apply the protocol’s sender-authentication checks when processing messages.

🤝

Mutual acknowledgment ceremony

Two peers confirm their relationship in a mutual acknowledgment ceremony. This records their acknowledgment; it does not establish unique-human identity. The draft’s VRC model uses two reciprocal credentials, one issued by each peer, for a complete relationship edge.

What's Implemented

The Layer 2 Trust Spanning Protocol implementation is functionally complete, with a full two-node direct-mode demo and comprehensive test coverage across all subsystems. As of v0.2.0 the implemented surface spans all four layers: DID infrastructure and rotation (Layer 1), TSP, relationships, and confidential messaging (Layer 2), the Credential Factory, Governance Guard, Policy Engine, and trust-task ceremonies (Layer 3), plus the reference applications (Layer 4).

🪪

Verifiable Identifiers

did:scid:vh and did:peer:4 VID creation, resolution, and cryptographic verification. Self-certifying identifiers with hash-chained verifiable history and no registry dependency.

🔐

TSP Messaging

TSP message sealing and opening for signed application payloads and optional confidential messaging. See the API Reference for package interfaces and message operations.

🤝

Relationship Management

Peer relationship establishment, OOBI-based out-of-band introduction, and a persistent relationship store.

🌐

P2P Transport

libp2p-based transport layer with noise protocol encryption, yamux multiplexing, and the /tsp/1.0.0 protocol handler.

🗄️

Encrypted Key Storage

SQLite-backed keystore with AES-256-GCM encryption and Argon2id key derivation. Secure local storage for VID key pairs.

🔢

Crypto Primitives

Ed25519 signing, X25519 key agreement, and HPKE helpers are documented in the cryptographic API. CESR is a separate encoding mechanism, not a signing or encryption algorithm.

Published Reference & Infrastructure Applications

Alongside the npm packages, the P2P Trust Stack ships a set of open-source applications that exercise the stack end-to-end: two reference applications that show how to build on the app-api, and two infrastructure applications that provide the network services a trust network needs. All four are published to GitHub under the same dual license as the stack, and each carries its own README covering build, configuration, and usage. They are reference and infrastructure builds rather than supported products — read them, run them, fork them.

👤

Agent App

Released

Reference application — desktop

The desktop reference agent: a terminal UI and a browser UI over a single agent runtime. It creates and manages self-certifying VTAs, exchanges OOBI handshakes, chats over the Trust Spanning Protocol, manages profiles, issues and verifies credentials, and runs VTC/VRC ceremonies — programming against @p2p-trust-stack/app-api only.

GitHub repository ↗  ·  README ↗

📱

Agent App — Mobile

Released

Reference application — Android & iOS

A minimal, working Android and iOS example built on the stack with Capacitor. It takes a username and a passphrase, creates a self-certifying VTA, and registers it with a utility server — with multi-account login, agent-name registration and lookup, and status display. It is a deliberate subset of the Agent App, using the same app-api surface.

GitHub repository ↗  ·  README ↗

🏘️

Utility Server

Released

Infrastructure application

The first utility server for the stack: a standalone TypeScript/Node application backed by YugabyteDB that implements the full trust data schema as a layer-by-layer REST API — identities and DID documents, relationships and TSP messaging, credentials, governance, and composed application views. It is also a first-class VTA on the network, reusing the same transport, crypto, DID, and TSP componentry as every other node.

GitHub repository ↗  ·  README ↗

🌐

Bootstrap Server

Released

Infrastructure application

A standalone libp2p bootstrap server with a terminal dashboard, providing peer discovery and circuit relay for the stack. Its peer ID is derived deterministically from a 24-word BIP-39 phrase, so clients can dial it without a prior identify exchange.

GitHub repository ↗  ·  README ↗

Terminology

New to the trust stack? The glossary defines all key terms: VTA, VTC, VRC, VID, DID, TSP, OOBI, HPKE, CESR, did:scid:vh, did:peer:4, R-Card, VidMethod, Witness VTC, and more.

View Glossary →