01 — Overview
Crate: kinetic-kid
Stage: 3 of 10
Reading time: ~5 minutes
Depends on: kinetic-types, kinetic-verify
What Is This?
kinetic-kid handles Kinetic Identity Documents (KIDs). It provides the self-sovereign identity layer for the network. In the Kinetic ecosystem, a KID acts as a decentralized identifier (DID) anchored to the .kin network. This crate defines exactly how these identities are created, signed, cryptographically verified, and extended using capability manifests.
Why Kinetic Needs This
Important
In a decentralized network, there is no central database of users. Without this crate, there would be no way to securely prove who owns a specific
.kinname or what their keys are authorized to do. By using ML-DSA-65 post-quantum signatures and RFC 8785 JSON Canonicalization,kinetic-kidguarantees that identities are cryptographically tamper-proof across the network.
How It Works
The crate exposes the core types required for identity management. The main entry point is lib.rs (208 lines), which publicly exports the modules.
- It heavily leverages the JCS (JSON Canonicalization Scheme) to ensure that the byte representation of an identity document is exactly identical across all platforms (Windows, Linux, WASM in browser) before it gets signed.
- It provides a robust, bounded parsing mechanism to defend against malicious peers sending massive payloads.
Key Pieces (Topic File Breakdown)
This crate is composed of ~981 total lines of code, broken down into the following topics:
02_document.md— CoversKidDocumentandControllerKey. This is the root identity document structure and signature verification logic.03_manifest.md— CoversCapabilityManifestandServiceEntry. Explains how identities advertise web endpoints securely.04_error.md— CoversKidError. The robust 16-variant error taxonomy for the identity layer.05_did.md— CoversKineticDid. The strict parsing logic fordid:kin:<hash>identifiers.06_bounded.md— Covers OOM defense mechanisms (BoundedVecVisitor) to stop network memory-bomb attacks.
How This Connects to the Rest of Kinetic
- CROSS-CRATE: Relies heavily on the ML-DSA-65 algorithms and structures from
kinetic-typesandkinetic-verify. - FORWARD DEPENDENCY: The DHT/P2P network (
kinetic-network) and the database layer (kinetic-storage) will ingest these structs. Specifically, they rely onKidDocument::is_authorized_updateto manage key rotations securely across the network.
Quick Reference
- Total Lines: ~981
- Signature Algorithm: ML-DSA-65 (Post-Quantum)
- Canonicalization: JCS (RFC 8785)
- Bounds: Max 20 controller keys, max 50 services.
Open Questions / Things to Revisit
Warning
The
testsmodule insidelib.rscontains hardcoded key generation forMlDsa65. In a production environment, test fixtures should ideally be isolated to prevent testing dependencies from bleeding into the compiled WASM binary.