libertaria-stack/l1-identity
Markus Maiwald 5aab5cdc8d feat(qvl): add libmdbx persistent storage layer
Add PersistentGraph with libmdbx backend for Kenya Rule compliance.
2026-02-03 08:59:13 +01:00
..
qvl feat(qvl): add libmdbx persistent storage layer 2026-02-03 08:59:13 +01:00
README.md docs: Add Panopticum Phase 1 - Sovereign Indexes and layer docs 2026-01-30 22:28:55 +01:00
argon2.zig feat(all): Complete Phase 2 and Phase 3 Implementation 2026-01-30 23:24:01 +01:00
crypto.zig fix(l1): Export PQXDH module and correct build linkage 2026-01-30 23:12:35 +01:00
did.zig feat(l1-identity): integrate ML-KEM-768 post-quantum key and fix Zig 0.13 compatibility 2026-01-31 00:13:36 +01:00
entropy.zig feat(capsule): stabilize TUI monitor, implement control IPC, and fix leaks (Zig 0.15.2) 2026-02-01 10:35:35 +01:00
pqxdh.zig feat(l1-identity): integrate ML-KEM-768 post-quantum key and fix Zig 0.13 compatibility 2026-01-31 00:13:36 +01:00
prekey.zig feat(l1-identity): integrate ML-KEM-768 post-quantum key and fix Zig 0.13 compatibility 2026-01-31 00:13:36 +01:00
proof_of_path.zig feat(capsule): implement discovery, federation, and persistence (Phase 10) 2026-01-31 08:35:22 +01:00
qvl.h Phase 6A: QVL FFI C exports for L2 integration 2026-01-31 03:06:20 +01:00
qvl.zig feat(qvl): add libmdbx persistent storage layer 2026-02-03 08:59:13 +01:00
qvl_ffi.zig feat(capsule): implement discovery, federation, and persistence (Phase 10) 2026-01-31 08:35:22 +01:00
slash.zig Phase 9 Complete: Autonomous Immune Response Operational 🛡️ (Artifacts Removed) 2026-01-31 04:32:09 +01:00
soulkey.zig feat(l1-identity): integrate ML-KEM-768 post-quantum key and fix Zig 0.13 compatibility 2026-01-31 00:13:36 +01:00
test_pqxdh.zig feat(l1): Integrate real LibOQS (ML-KEM-768) 2026-01-30 23:08:15 +01:00
test_qvl_ffi.c Phase 6A: QVL FFI C exports for L2 integration 2026-01-31 03:06:20 +01:00
trust_graph.zig feat(capsule): implement discovery, federation, and persistence (Phase 10) 2026-01-31 08:35:22 +01:00
vector.zig feat(capsule): implement discovery, federation, and persistence (Phase 10) 2026-01-31 08:35:22 +01:00

README.md

L1 Identity Layer

Layer: L1 (Identity)
Purpose: Decentralized identity, cryptography, trust graphs, vectors
RFCs: RFC-0105 (Sovereign Time), RFC-0120 (QVL)


Overview

The L1 Identity layer provides cryptographic identity primitives, trust relationship management, and the QuasarVector Lattice (QVL) for event-driven consensus.

Components

DID (Decentralized Identifiers) - did.zig

Spec: did:libertaria:... format

DID generation and parsing:

  • Blake3-based DID derivation from public keys
  • 24-byte routing hints (192-bit)
  • Base58 encoding for human readability

SoulKey (Identity Keys) - soulkey.zig

Crypto: Ed25519

Core identity keypair management:

  • Key generation, storage, derivation
  • Signing and verification
  • Seed phrase support

QuasarVector - vector.zig

RFC: RFC-0120

Event lattice vectors:

  • Ed25519 signatures
  • SovereignTimestamp (u128 attoseconds)
  • Proof-of-Path integration
  • Vector validation pipeline

TrustGraph - trust_graph.zig

Pattern: Web-of-trust

Decentralized trust relationships:

  • Trust grant/revoke operations
  • Path finding (Dijkstra)
  • Trust weight calculation
  • Graph serialization

ProofOfPath - proof_of_path.zig

RFC: RFC-0120

Trust path verification:

  • Multi-hop signature chains
  • Path expiration checking
  • Hop limit enforcement

Entropy - entropy.zig

RFC: RFC-0100

Entropy stamps for Sybil resistance:

  • Blake3-based proof-of-work
  • Difficulty calibration (0-255)
  • Verification logic

Crypto - crypto.zig

Cryptographic primitives wrapper:

  • Ed25519 (signing)
  • X25519 (key exchange)
  • Blake3 (hashing)
  • XChaCha20-Poly1305 (encryption)

Argon2 - argon2.zig

FFI: C library wrapper

Password hashing:

  • Argon2id for SoulKey seed derivation
  • Memory-hard KDF

PQXDH - pqxdh.zig

Protocol: Post-Quantum Extended Diffie-Hellman

Future-proof key exchange:

  • Hybrid classical + PQ security
  • X25519 + Kyber integration (planned)

PreKey - prekey.zig

Protocol: X3DH prekey bundles

Asynchronous messaging:

  • Prekey bundle generation
  • Signal-style forward secrecy

Usage

const l1 = @import("l1_identity.zig");

// Generate identity
const soulkey = try l1.soulkey.SoulKey.generate(allocator);
const did = try l1.did.fromPublicKey(&soulkey.public_key);

// Create vector
var vector = try l1.vector.QuasarVector.create(allocator, soulkey, payload_data);
defer vector.deinit(allocator);

// Sign and verify
try vector.sign(soulkey);
const valid = vector.verifySignature();

Testing

Run L1 tests:

zig build test
# Or individual modules:
zig test l1-identity/vector.zig
zig test l1-identity/trust_graph.zig

Dependencies

  • std.crypto - Ed25519, X25519, Blake3
  • vendor/argon2/ - Argon2 C library
  • L0 Time (time.zig) - SovereignTimestamp