libertaria-stack/core/l1-identity
Markus Maiwald 0a86a93cf5
refactor: complete repository restructure with tiered licensing
BREAKING CHANGE: Repository restructured from flat layout to tiered:

FOLDER REORGANIZATION:
- core/          - L0-L3 layers (Commonwealth LCL-1.0)
  - l0-transport/   - Transport with MIMIC, Noise, PNG
  - l1-identity/    - Identity, QVL, Crypto
  - l2_session/     - Session management
  - l2-federation/  - Cross-chain bridging
  - l2-membrane/    - Policy enforcement
- sdk/           - L4+ and bindings (Sovereign LSL-1.0)
  - janus-sdk/
  - l4-feed/
- apps/          - Examples (Unbound LUL-1.0)
  - examples/
- legal/         - All license texts
  - LICENSE_COMMONWEALTH.md
  - LICENSE_SOVEREIGN.md
  - LICENSE_UNBOUND.md

IMPORT FIXES (All Layers):
- L0: 13 files fixed - all relative imports corrected
- L1: 14 files fixed - module imports for cross-layer dependencies
- L2: 6 files fixed - session, membrane, federation
- Capsule: 9 files fixed - TUI, node, main, control
- Examples: 2 files fixed - lwf, crypto

LICENSES ADDED:
- LCL-1.0: Viral reciprocity for Core (SaaS-proof)
- LSL-1.0: Business-friendly for SDK
- LUL-1.0: Maximum freedom for docs/apps

NO CLA REQUIRED - contributors keep copyright

README.md REWRITTEN:
- Documents new folder structure
- Explains tiered licensing strategy
- Clear SPDX identifiers per component

TODO:
- Fix remaining test module configuration issues
- Full green build in follow-up

Refs: 4 sub-agents parallel execution
2026-02-05 21:50:54 +01:00
..
qvl refactor: complete repository restructure with tiered licensing 2026-02-05 21:50:54 +01:00
README.md refactor: restructure repository with tiered licensing 2026-02-05 20:12:32 +01:00
argon2.zig refactor: complete repository restructure with tiered licensing 2026-02-05 21:50:54 +01:00
crypto.zig refactor: restructure repository with tiered licensing 2026-02-05 20:12:32 +01:00
did.zig refactor: complete repository restructure with tiered licensing 2026-02-05 21:50:54 +01:00
entropy.zig refactor: restructure repository with tiered licensing 2026-02-05 20:12:32 +01:00
mod.zig refactor: complete repository restructure with tiered licensing 2026-02-05 21:50:54 +01:00
pqxdh.zig refactor: restructure repository with tiered licensing 2026-02-05 20:12:32 +01:00
prekey.zig refactor: complete repository restructure with tiered licensing 2026-02-05 21:50:54 +01:00
proof_of_path.zig refactor: complete repository restructure with tiered licensing 2026-02-05 21:50:54 +01:00
qvl.h refactor: restructure repository with tiered licensing 2026-02-05 20:12:32 +01:00
qvl.zig refactor: restructure repository with tiered licensing 2026-02-05 20:12:32 +01:00
qvl_ffi.zig refactor: complete repository restructure with tiered licensing 2026-02-05 21:50:54 +01:00
slash.zig refactor: restructure repository with tiered licensing 2026-02-05 20:12:32 +01:00
soulkey.zig refactor: complete repository restructure with tiered licensing 2026-02-05 21:50:54 +01:00
test_pqxdh.zig refactor: restructure repository with tiered licensing 2026-02-05 20:12:32 +01:00
test_qvl_ffi.c refactor: restructure repository with tiered licensing 2026-02-05 20:12:32 +01:00
trust_graph.zig refactor: complete repository restructure with tiered licensing 2026-02-05 21:50:54 +01:00
vector.zig refactor: complete repository restructure with tiered licensing 2026-02-05 21:50:54 +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