FleetMesh fleetmesh
Mesh Guide 8 Chapters
L1 Crypto Core L1 Crypto Core

Cryptographic Core & Identity.

In a peer-to-peer mesh, there is no login server, no domain registrar, and no company vouching for who is on the other end of a wire. Layer 1 replaces institutional trust with seven open cryptographic building blocks so any two strangers can verify every byte, prove identity, encrypt conversations, and hide metadata.

1.0 · Layer 1 Big Picture

Why cryptography comes before networking

On the corporate web, you connect to a server first and prove who you are second (by typing a password into someone else’s database). In a mesh, you might receive a file from a stranger’s home Raspberry Pi or route an encrypted message across three relays you have never met. That only works safely if integrity, identity, confidentiality, and metadata privacy live inside the data itself.

L1 L1
Companion Explainer 1.0
Layer 1: Cryptographic Core & Identity
SHA-256 SHA-256

1.1 · Integrity & Fingerprints

SHA-256 & Cryptographic Hashing

The Concept

A cryptographic hash function like SHA-256 is a deterministic blender: feed in a single word, an entire movie, or a JSON schema, and it always outputs a fixed 32-byte (64-hex-character) fingerprint. You can never un-blend the fingerprint back into the input, and changing even one bit causes an avalanche that flips roughly half of all 256 output bits.

FleetMesh Implementation

  • Event IDs & Blobs: Every Nostr event ID and Blossom blob address is a SHA-256 hash.
  • Protocol Pin (schema/DIGEST): All 80 wire schemas hash to one canonical digest (fleetmesh/0.1-draft@1c1bdc73471892dd...) checked at handshake time.
  • Chains, Bao & KDFs: Links receipt chains (r0 → r1), builds 1 KB Bao Merkle trees, drives HKDF-SHA256, and powers optional 20-bit NIP-13 PoW on descriptors.
Interactive Lab 1.1 · Real WebCrypto SHA-256
Watch the SHA-256 Avalanche Effect Live
Computing SHA-256...
SHA-256 SHA-256
Companion Explainer 1.1
SHA-256 & Cryptographic Hashing
Keys Keys

1.2 · Public-Key Cryptography

Asymmetric Keys & BIP-340 Schnorr

The Concept

Every participant generates a matched pair of numbers: a private key (kept strictly on your own machine) and a public key (shared freely like a mailbox address). Your private key stamps a mathematical wax seal — a signature — onto every message. Anyone holding your public key can check that seal offline in microseconds, without ever learning your private key.

FleetMesh Implementation

  • Never reuse one key for every job: Each node binds dedicated keys inside its signed kind 11801 descriptor.
  • BIP-340 Schnorr (secp256k1, 0xe7): Compact 64-byte signatures over 32-byte x-only pubkeys (also makes FROST threshold signatures look identical!).
  • Clean retirement: Signed kind 11802 revocations retire keys and optionally hand off to a successor pubkey.
Interactive Lab 1.2 · Blast Radius Isolation
Inspect a FleetMesh Node’s 4 Role-Separated Keys
Keys Keys
Companion Explainer 1.2
Asymmetric Keys & BIP-340 Schnorr
DIDs DIDs

1.3 · Self-Sovereign Addressing

Decentralized Identifiers (W3C DIDs)

The Concept

A Decentralized Identifier (DID) is a globally unique URI — like did:nostr:82341f88… — that you mint yourself offline. It resolves to a structured DID Document listing your public keys and reachable network endpoints, without asking a domain registrar, ICANN, or a certificate authority for permission.

FleetMesh Implementation

  • did:nostr (Canonical): The node’s 32-byte x-only secp256k1 pubkey — single source of truth.
  • did:key & did:peer:2 (Derived): Deterministic multicodec re-encodings of descriptor keys so standard DIDComm & VC libraries work unchanged.
  • did:group, did:web & did:plc: Equal-peer Circles (kind 30834), web domains, and AT Protocol handles.
Interactive Lab 1.3 · Zero-DNS Addressing
Switch Between FleetMesh’s 6 DID Formats
DIDs DIDs
Companion Explainer 1.3
Decentralized Identifiers (W3C DIDs)
DIDComm v2 DIDComm v2

1.4 · Authenticated Private Messaging

DIDComm v2 Encrypted Envelopes

The Concept

TLS only encrypts the pipe between two directly connected sockets — if a message hops through an offline relay, TLS terminates at the relay. DIDComm v2 encrypts the letter inside the envelope itself, addressed by DID rather than IP address, so it stays confidential and tamper-proof no matter how many relays, queues, or transports carry it.

FleetMesh Implementation

  • Authcrypt (Default): ECDH-1PU+A256KW + A256CBC-HS512 over X25519 (NIST SP 800-56A Concat KDF + RFC 3394 AES Key Wrap) — proves sender authenticity.
  • Anoncrypt (First Contact): ECDH-ES+A256KW before a peer reveals itself.
  • 12 FleetMesh Protocols + 11 Reused Protocols (8 didcomm.org): Carries peering/1.0, budget/1.0, sync/1.0, complaint/1.0, standing/1.0, control/1.0, plus 8 upstream DIF protocols (including coordinate-mediation/2.0 & messagepickup/2.0) and 3 app protocols (grasp/1.0, ncontainer/1.0, magpie/1.0).
Interactive Lab 1.4 · Wire Envelope Inspector
Compare Authcrypt (ECDH-1PU) vs. Anoncrypt (ECDH-ES)
DIDComm DIDComm
Companion Explainer 1.4
DIDComm v2 Encrypted Envelopes
Encryption Encryption

1.5 · Symmetric & Transport Ciphers

Encryption Methods (NIP-44, ChaCha20, Noise, TLS)

The Concept

Why does a mesh use more than one cipher? Because encrypting a tiny JSON event on a public relay, sealing a 100 MB shared Circle video, and negotiating a live UDP datagram tunnel have completely different constraints (padding, nonce size, forward secrecy, streaming overhead). FleetMesh uses AEAD (Authenticated Encryption with Associated Data) or Encrypt-then-MAC everywhere so corrupted ciphertext is rejected before decryption ever touches your app.

FleetMesh Implementation

  • NIP-44 v2: secp256k1 ECDH → HKDF-SHA256 → ChaCha20 + HMAC-SHA256 with power-of-2 length padding.
  • XChaCha20-Poly1305 & ChaCha20-Poly1305: 192-bit-nonce Circle Fiber sealing (@fleetmesh/circles) and live LLM token stream frames.
  • Transport Layer: Noise IK / XK (FIPS), TLS 1.3 (WSS), and SSB SHS + Box Stream. The opt-in iroh_rung wire itself is neither encrypted nor authenticated—confidentiality comes from the inner DIDComm JWE envelope.
Interactive Lab 1.5 · Cipher Selector
Pick a FleetMesh Use Case to See Its Exact Encryption Stack
Encryption Encryption
Companion Explainer 1.5
Encryption Methods Across FleetMesh
NIP-59 NIP-59

1.6 · Metadata Minimization

NIP-59 Gift Wrap (3-Layer Metadata Hiding)

The Concept

Even if you lock a postcard inside a steel box, writing “From: Alice, To: Bob, Sent: 3:14 PM” on the outside tells every post office who your friends are and when you talk. NIP-59 Gift Wrap puts your message inside three nested Russian-doll envelopes, signed on the outside by a brand-new throwaway key with a fuzzed timestamp so relays route it completely blind.

FleetMesh Implementation

  • Kinds 1059 & 21059: Carries offline DIDComm messages, NIP-17 DMs, and remote control/1.0 operator commands from meshctl.
  • Never replicated as open shards: Gift wraps route strictly to the recipient’s declared kind 10050 inbox relays.
  • Plausible deniability: The innermost Rumor is deliberately unsigned.
Interactive Lab 1.6 · Russian-Doll Unwrapper
Peel a NIP-59 Gift Wrap Layer by Layer
NIP-59 NIP-59
Companion Explainer 1.6
NIP-59 Gift Wrap (Metadata Hiding)
Blinding Crypto Blinding Crypto

1.7 · Privacy-Preserving Math

Blinding Cryptography (Three Distinct Uses)

The Concept

Blinding lets a third party store, index, or even sign something without knowing what is inside or who it belongs to. Imagine putting a contract inside a carbon-paper envelope: a notary stamps the outside, the signature transfers onto the document inside, and when you later show the signed document, even the notary cannot tell which envelope it came from.

FleetMesh Implementation

  • 1. Pairwise Blinded d-tags (Core): HKDF-SHA256(ECDH_x, "fleetmesh/grant/1", "fleetmesh/grant-tag/1") hides peering graphs on kind 30801 & 30811.
  • 2. Chaumian BDHKE Blind Signatures (Cashu, Exp): B_ = Y + rG → C_ = kB_ → C = C_ - rK (+ NUT-12 DLEQ proofs) for unlinkable bearer ecash.
  • 3. Blinded Pre-emptive Tombstones (Exp): Salted SHA-256 origin commitments & ephemeral lift tokens in fleetmesh_protocols.circles.blinding.
Interactive Lab 1.7 · Live Blinding Simulator
Explore All 3 Blinding Constructions in FleetMesh
Blinding Blinding
Companion Explainer 1.7
Blinding Cryptography (HKDF, BDHKE & Locks)