From 258fdf26c466a5f4b1c8f1776d035493654cb92a Mon Sep 17 00:00:00 2001 From: Virgil Date: Thu, 19 Feb 2026 16:24:49 +0000 Subject: [PATCH] Add "Home" --- Home.md | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 Home.md diff --git a/Home.md b/Home.md new file mode 100644 index 0000000..cfb5cc7 --- /dev/null +++ b/Home.md @@ -0,0 +1,53 @@ +# go-p2p + +**P2P Networking for Lethean** + +`go-p2p` provides peer-to-peer networking infrastructure for the Lethean network. It implements the UEPS (Universal Encrypted Payload System) wire protocol for consent-gated TLV framing, and a full-featured node management layer with encrypted WebSocket transport, challenge-response authentication, and KD-tree-based peer selection. + +## Installation + +```bash +go get forge.lthn.ai/core/go-p2p +``` + +## Package Map + +| Package | Purpose | +|---------|---------| +| `ueps/` | Universal Encrypted Payload System -- TLV packet builder and HMAC-verified reader | +| `node/` | P2P node management -- transport, identity, peer registry, controller, worker, message protocol, bundles | +| `logging/` | Structured logging with levels and fields | + +## Quick Start + +### UEPS Packet + +```go +builder := ueps.NewBuilder(0x20, payload) +frame, err := builder.MarshalAndSign(sharedSecret) +``` + +### P2P Node + +```go +nm, _ := node.NewNodeManager() +nm.GenerateIdentity("my-node", node.RoleDual) + +registry, _ := node.NewPeerRegistry() +transport := node.NewTransport(nm, registry, node.DefaultTransportConfig()) +transport.Start() +``` + +## Architecture Overview + +The system operates on two levels: + +1. **UEPS Protocol** ([[UEPS-Protocol]]) -- Low-level TLV framing with HMAC-SHA256 integrity, intent-based routing, and threat scoring. Designed for the 7-layer Lethean stack. + +2. **Node Architecture** ([[Node-Architecture]]) -- High-level P2P mesh built on WebSockets with SMSG encryption, X25519 ECDH key exchange, challenge-response authentication, and Poindexter KD-tree peer selection. + +Nodes operate in one of three roles: `controller` (manages remote workers), `worker` (receives commands and runs tasks), or `dual` (both). + +## Licence + +EUPL-1.2