libertaria-stack/core/l1-identity
Voxis 8f86a32eee fix(build): resolve Zig module conflicts - capsule binary now compiles
- Changed file-level imports to module imports throughout codebase
- Added missing module imports to l1_mod (soulkey, time, trust_graph, qvl)
- Added l0_mod.addImport("time", time_mod) for l0-transport
- Fixed API calls in examples to match current encryptPayload/decryptPayload signatures
- Fixed namespace references in capsule code (l0_transport.lwf → l0_transport)
- Removed redundant soulkey import from capsule_mod
- Capsule binary: 29MB debug build, verified working

Build Status:  PASS (all artifacts compile successfully)
Tests: zig build completes successfully
2026-02-16 04:24:55 +01:00
..
qvl fix(build): resolve Zig module conflicts - capsule binary now compiles 2026-02-16 04:24:55 +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 fix(crypto): add AAD to AEAD encryption binding ciphertext to context 2026-02-09 00:55:34 +01:00
did.zig fix(build): resolve Zig module conflicts - capsule binary now compiles 2026-02-16 04:24:55 +01:00
entropy.zig refactor: restructure repository with tiered licensing 2026-02-05 20:12:32 +01:00
liboqs_real.zig fix(pqxdh): add compile-time feature gating for liboqs 2026-02-09 00:55:11 +01:00
liboqs_stub.zig fix(pqxdh): add compile-time feature gating for liboqs 2026-02-09 00:55:11 +01:00
mod.zig fix(build): resolve Zig module conflicts - capsule binary now compiles 2026-02-16 04:24:55 +01:00
pqxdh.zig fix(pqxdh): add compile-time feature gating for liboqs 2026-02-09 00:55:11 +01:00
prekey.zig fix(build): resolve Zig module conflicts - capsule binary now compiles 2026-02-16 04:24:55 +01:00
proof_of_path.zig fix(build): resolve Zig module conflicts - capsule binary now compiles 2026-02-16 04:24:55 +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 fix(build): resolve Zig module conflicts - capsule binary now compiles 2026-02-16 04:24:55 +01:00
slash.zig refactor: restructure repository with tiered licensing 2026-02-05 20:12:32 +01:00
soulkey.zig fix(pqxdh): add compile-time feature gating for liboqs 2026-02-09 00:55:11 +01:00
test_pqxdh.zig fix(test_pqxdh): implement real Ed25519 signature generation/validation 2026-02-09 00:56:02 +01:00
test_qvl_ffi.c refactor: restructure repository with tiered licensing 2026-02-05 20:12:32 +01:00
trust_graph.zig fix(build): resolve Zig module conflicts - capsule binary now compiles 2026-02-16 04:24:55 +01:00
vector.zig fix(build): resolve module import issues post-refactor 2026-02-05 22:17:11 +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