NPS

English 中文版

NPS — Neural Protocol Suite

A complete internet infrastructure protocol suite for the AI era

License Status Release NCP NWP NIP NDP NOP

NPS is a complete web infrastructure protocol suite designed for AI Agents and models. It consists of five sub-protocols covering AI communication, web access, identity, node discovery, and multi-agent orchestration.

Latest published release: v1.0.0-alpha.18, including NWP 0.21 stateful LLM context, six-SDK lifecycle parity, and strict-native savings gates.

This branch contains the reviewed, unreleased alpha.19 specification candidate: NCP 0.12 / NWP 0.22 / NIP 0.15 / NDP 0.13 / NOP 0.10. Install commands and package tables remain pinned to the published alpha.18 line.


Protocol Suite Overview

┌──────────────────────────────────────────────────────────────┐
│  NOP  Neural Orchestration Protocol   Multi-Agent Orchestration │
├──────────────────────────────────────────────────────────────┤
│  NDP  Neural Discovery Protocol       Node Discovery          │
├──────────────────────────────────────────────────────────────┤
│  NIP  Neural Identity Protocol        Agent Identity          │
├──────────────────────────────────────────────────────────────┤
│  NWP  Neural Web Protocol             Node Request/Response   │
├──────────────────────────────────────────────────────────────┤
│  NCP  Neural Communication Protocol   AI-to-AI Communication  │
└──────────────────────────────────────────────────────────────┘
Protocol Analogy Spec Version Implementation Status Port (default / standalone)
NCP Neural Communication Protocol Wire Format v0.12 Alpha.19 candidate: deterministic keepalive/close clocks, replay-safe QUIC policy, identity-preserving migration, and two-layer backpressure 17433 / —
NWP Neural Web Protocol Node request/response v0.22 Alpha.19 candidate: renewable subscription leases and portable stability/SLA/billing normalization 17433 / 17434
NIP Neural Identity Protocol TLS / PKI v0.15 Alpha.19 candidate: deterministic renewal, revocation freshness/unknown handling, and Phase-3 advisory truth 17433 / 17435
NDP Neural Discovery Protocol DNS v0.13 Alpha.19 candidate: durable sequence/epoch fences and fail-closed restart/partition recovery 17433 / 17436
NOP Neural Orchestration Protocol SMTP / MQ v0.10 Alpha.19 candidate: bounded replay ledger, monotonic result TTL, safe eviction, and deterministic aggregation 17433 / 17437

Local dev stack

Run a loopback stack with npsd + a development NIP CA:

docker compose -f deploy/dev-stack/docker-compose.yml up --build -d npsd nip-ca

For a one-shot MCP/A2A/gRPC smoke test against an NWP echo action:

docker compose -f deploy/dev-stack/docker-compose.yml --profile smoke run --rm ingress-echo

See docs/dev-stack.md.

Reference daemon deployment

NPS in production runs as six resident services across three layers — see docs/daemons/architecture.md for the full design, tools/daemons/ for the binaries.

Layer Daemon Port Status (published alpha.18 baseline)
1 (host-local) npsd 17433 L1 minimum plus loopback dev-stack support
1 (host-local) nps-runner — CR-0007 lease renewal, portable OCI SpawnSpec/reference resolution, and lifecycle enforcement
2 (network entry) nps-ingress 8080 Native-mode TLS/mTLS ingress boundary aligned to RFC-0006
2 (network entry) nps-registry 17436 NDP registry with liveness / staleness semantics
3 (trust anchor) nps-cloud-ca 17435 Deferral skeleton (points at tools/nip-ca-server)
3 (trust anchor) nps-ledger 17440 In-memory NPS-RFC-0004 reputation log

Why NPS?

Existing web protocols were designed for human browsers. When AI Agents access them, three fundamental problems arise:

NPS is designed from the ground up to address these problems through AnchorFrame schema anchoring, Cognon (CGN) standardized metering, and the NID identity system — rebuilding the AI internet infrastructure layer.


Key Features

Token Economy First

Five Neural Node Roles

AI-Native Identity Every Agent holds a NID (Neural Identity Descriptor) in the form urn:nps:agent:{issuer}:{id}, issued by a NIP CA. The NID carries capability declarations and access scopes enforced at the protocol layer.

Unified Port & Dual Transport Mode


Repository Structure

nps/
├── spec/                    # Language-agnostic specification (SSoT)
│   ├── NPS-0-Overview.md    # Suite overview v0.4
│   ├── NPS-1-NCP.md         # NCP spec v0.12
│   ├── NPS-2-NWP.md         # NWP spec v0.22
│   ├── NPS-3-NIP.md         # NIP spec v0.15
│   ├── NPS-4-NDP.md         # NDP spec v0.13
│   ├── NPS-5-NOP.md         # NOP spec v0.10
│   ├── frame-registry.yaml  # Machine-readable frame registry v0.15
│   ├── error-codes.md       # Unified error code namespace
│   ├── status-codes.md      # NPS native status codes + HTTP mapping
│   ├── token-budget.md      # CGN metering spec
│   ├── conformance/         # Shared wire vectors and conformance fixtures
│   ├── services/
│   │   └── NPS-AaaS-Profile.md  # AaaS compliance profile v0.2
│   └── rfcs/                # RFC process + 4 drafts (NCP preamble, X.509/ACME NID, assurance levels, reputation log)
├── version.yaml             # Published suite-version oracle; bumped last
├── impl/
│   ├── dotnet/              # C# / .NET 10 reference implementation (includes samples/ + benchmarks/)
│   ├── python/              # Python SDK v1.0.0-alpha.18 candidate
│   ├── typescript/          # TypeScript SDK v1.0.0-alpha.18 candidate
│   ├── java/                # Java SDK v1.0.0-alpha.18 candidate
│   ├── rust/                # Rust SDK v1.0.0-alpha.18 candidate
│   └── go/                  # Go SDK v1.0.0-alpha.18 candidate
├── tools/
│   ├── daemons/                # Six resident services. 4 OSS published as labacacia/nps-daemons bundle (npsd / nps-runner / nps-ingress / nps-registry); 2 cloud daemons published as private labacacia/NPS-Cloud-CA + labacacia/NPS-Ledger
│   ├── nip-ca-server/          # NIP CA Server — C# / ASP.NET Core; published standalone at labacacia/nip-ca-server (subdir example/ holds 5 frozen reference ports)
│   ├── release/                # Release sync scripts (dev → standalone publish repos)
│   └── mirror-to-gitee/        # Gitee mirror sync script (GitHub → Gitee with labacacia URL rewrite)
├── compat/
│   ├── mcp-ingress/          # MCP Ingress v1.0.0-alpha.16 (LabAcacia.McpIngress)
│   ├── a2a-ingress/          # A2A Ingress v1.0.0-alpha.16 (LabAcacia.A2aIngress)
│   └── grpc-ingress/         # gRPC Ingress v1.0.0-alpha.16 (LabAcacia.GrpcIngress)
└── demos/                  # Also published standalone at github.com/labacacia/NPS-examples
    ├── nps-demo/            # End-to-end business demo — NIP identity → AnchorFrame → NOP → DiffFrame
    ├── nwp-graph-walk/      # NWP Complex Node §11 — depth-scoped fanout + X-NWP-Trace cycle detection
    ├── ingress-playground/   # One NWP Action Node fronted simultaneously by MCP + A2A + gRPC
    └── cross-sdk-interop/   # Four language clients (dotnet/python/node/go) diffed against one Memory Node

Standalone showcase. The three Tier-1 demos (nwp-graph-walk, ingress-playground, cross-sdk-interop) are also published as a curated repo at labacacia/NPS-examples (Gitee mirror). The source of truth stays here; the standalone repo exists for discoverability and has per-demo READMEs with principle / purpose / what-it-demonstrates / captured results structure.


Implementation Status

The table below describes the released 1.0.0-alpha.18 source tree. The latest published package line is 1.0.0-alpha.18.

C# / .NET (impl/dotnet/)

Component Version Status Contents
NPS.Core 1.0.0-alpha.18 Released Frame codec (MsgPack/JSON), dual-header mode (4B/8B), frame registry, Anchor cache, NativeAOT-safe codecs
NPS.NWP 1.0.0-alpha.18 Released Memory / Action / Complex / Anchor / Bridge Node middleware; native-mode NWP serving over NCP sessions; /.nwm·/.schema·/actions·/invoke·/query·/system.task.*; graph traversal + X-NWP-Depth + cycle detection; SSRF + idempotency + priority + async task lifecycle
NPS.NIP 1.0.0-alpha.18 Released CA library (key generation, certificate issuance/revocation, typed remote CA client, OCSP, CRL), NipIdentVerifier 6-step identity verification
NPS.NDP 1.0.0-alpha.18 Released NDP frame types (Announce/Resolve/Graph), in-memory registry (TTL eviction), announce signature validator
NPS.NOP 1.0.0-alpha.18 Released DAG orchestration engine (condition eval, input mapping, K-of-N sync, retry/backoff) + §8.2 delegation chain depth limit + §8.4 callback SSRF guard and exponential backoff retry
NPS.Conformance 1.0.0-alpha.18 Released Node L1/L2 conformance case catalog, run manifest model, and CI validation helpers
tools/nip-ca-server 1.0.0-alpha.18 Released NIP CA Server — C# / ASP.NET Core 10, PostgreSQL, Docker. Published standalone at labacacia/nip-ca-server (the only release-tracked impl); 5 reference ports (Python / TypeScript / Java / Rust / Go) frozen at 1.0.0-alpha.11 under tools/nip-ca-server/example/.
Compat ingresses 1.0.0-alpha.16 Last published release (2026-07-23) MCP Ingress (JSON-RPC 2.0, MCP 2024-11-05), A2A Ingress (Google A2A v0.2), gRPC Ingress (HTTP/2, 4 unary RPCs); an alpha.17 deprecation build was prepared but never published, and the packages left the synchronized train from alpha.18 in favor of NPS.NWP.Bridge
Daemons 1.0.0-alpha.18 Released Six resident services: npsd (L1 minimum), nps-runner, nps-ingress, nps-registry, nps-cloud-ca, nps-ledger (RFC-0004 in-memory log); see docs/daemons/architecture.md
Samples — ✅ Available samples/NPS.Samples.NopDag — 3-node NOP DAG end-to-end over real HTTP; demos/nps-demo — 4-scene business demo (NIP → AnchorFrame → NOP → DiffFrame)
Benchmarks — ✅ Available benchmarks/NPS.Benchmarks.TokenSavings → 45.0% token saving vs REST (exceeds Phase 1 ≥30% exit criterion); benchmarks/NPS.Benchmarks.WireSize → 63.6% MsgPack vs JSON (exceeds Phase 2 ≤50% exit criterion)

.NET SDK test gate: 964 tests across NPS.Core / NWP / NIP (incl. AssuranceLevel, Reputation, X.509/ACME, revocation, storage, remote CA client) / NDP / NOP / Anchor / Bridge / native NCP / native NWP / conformance / samples / benchmarks; plus 48 frozen compat-ingress tests (15 mcp + 18 a2a + 15 grpc).

Python (impl/python/)

Component Version Status Contents
nps-lib 1.0.0-alpha.18 Released Full client/server protocol surface, asyncio + httpx, Ed25519 signing, 1372 tests, 92.07% coverage. Python import module remains nps_sdk.

TypeScript (impl/typescript/)

Component Version Status Contents
@labacacia/nps-sdk 1.0.0-alpha.18 Released Full client/server protocol surface, Node.js 22+, MsgPack + JSON dual encoding, Ed25519 signing, 1171 tests. The latest published 1.0.0-alpha.18 package includes dist/.

Java (impl/java/)

Component Version Status Contents
nps-java 1.0.0-alpha.18 Released Full client/server protocol surface, Java 21, MsgPack + JSON dual encoding, Ed25519 built-in signing, AES-256-GCM key encryption, 693 tests

Rust (impl/rust/)

Component Version Status Contents
nps-rs 1.0.0-alpha.18 Released Full client/server protocol surface, Rust stable, MsgPack + JSON dual encoding, Ed25519 signing, AES-256-GCM key encryption, Tokio async, 755 tests

Go (impl/go/)

Component Version Status Contents
github.com/labacacia/NPS-sdk-go 1.0.0-alpha.18 Released Full client/server protocol surface, Go 1.23+, MsgPack + JSON dual encoding, Ed25519 built-in signing, AES-256-GCM key encryption, 683 tests

Quick Start (C#)

1. Register NCP core and NWP services

services.AddNpsCore(opt => {
    opt.DefaultTier = EncodingTier.MsgPack;
});

services.AddNwp(opt => {
    opt.DefaultTokenBudget = 1000;
});

2. Build and encode an NWP query frame

var query = new QueryFrame {
    AnchorRef = "sha256:a3f9b2c1...",
    Filter = JsonSerializer.SerializeToElement(new { status = "active" }),
    Limit = 50
};

byte[] wire = codec.Encode(query); // auto-handles 4-byte / 8-byte frame headers

Roadmap

Phase 0 — Spec Unification (Complete)

Phase 1 — Core Build (In progress, target 2026 Q3)

Phase 2 — Ecosystem Expansion (In progress)


Documentation Index

Concept Guides

Topic Description
Frame Model NCP frame structure, encoding tiers, flags bitmap, schema anchoring
NID Identity System NID format, certificate structure, 6-step verification, OCSP, scope wildcards
DAG Orchestration Execution flow, input mapping, K-of-N sync, callbacks and aggregation strategies
Node Types Memory / Action / Complex / Anchor / Bridge node comparison

.NET SDK Reference

Package Description
.NET SDK Index Environment requirements, package dependencies, DI registration overview
NPS.Core Frame types, codecs, AnchorCache, exception hierarchy
NPS.NWP QueryFrame, Filter DSL, MemoryNodeMiddleware, NWM manifest
NPS.NIP NipIdentVerifier 6-step verification, NipCaService, NipSigner, CA HTTP routes
NPS.NDP AnnounceFrame, INdpRegistry, NdpAnnounceValidator
NPS.NOP TaskFrame/DAG model, NopOrchestrator, callback validator, condition/input mapping

Compatibility Bridges

Topic Description
Compat overview When to pick MCP / A2A / gRPC; shared design and non-goals
MCP Ingress deep dive 1:N upstream model, tool-name encoding, async lifecycle, header semantics
A2A Ingress deep dive 1:1 AgentCard mapping, skill lookup, task state translation, in-memory binding
gRPC Ingress deep dive Bytes-passthrough rationale, dual error mapping, multi-language clients

Benchmarks

Report Result
REST vs NWP token savings Aggregate 45.0% CGN reduction (S1 43.1% / S2 44.0% / S3 54.2%) — exceeds Phase 1 ≥30% exit criterion
Tier-1 JSON vs Tier-2 MsgPack wire size Aggregate 63.6% byte reduction on steady-state frames — exceeds Phase 2 ≤50% exit criterion
Stateful LLM context savings Strict-native second turn: 22.5% fewer decoder bytes and 62.4% fewer evaluated tokens, with role/tool semantic parity and fallback disabled

Protocol Specifications

Document Description
NPS Overview Suite entry point, frame namespace at a glance
NCP Spec Frame wire format, encoding tiers, dual-header mode
NWP Spec Node request/response semantics, Filter DSL, streaming responses
NIP Spec Identity protocol, Ed25519 signing, CRL/OCSP
NDP Spec Node discovery, TTL broadcast, graph sync
NOP Spec DAG orchestration, delegation chains, K-of-N
Cognon (CGN) Metering Cross-model standardized token metering unit
Error Code Namespace Unified error codes across all protocols
Status Code Mapping NPS native status codes with HTTP mapping
AaaS Compliance Profile Anchor Node + Bridge Node, Vector Proxy, L1/L2/L3 compliance levels
Daemon architecture Six-daemon, three-layer reference deployment topology
RFC process + drafts RFC-0001 NCP preamble · 0002 X.509+ACME NID · 0003 assurance levels · 0004 reputation log

Attribution

Output Owner
NPS Specification LabAcacia / INNO LOTUS PTY LTD
Reference Implementations (OSS) LabAcacia
NPS Cloud Service INNO LOTUS PTY LTD

LabAcacia is the open-source lab under INNO LOTUS PTY LTD. Licensed under Apache 2.0.


License

Apache 2.0 © 2026 INNO LOTUS PTY LTD