Zero-Knowledge Sovereign Identity & Merkle Membership Engine
Enables sovereign agents and human operators to prove valid organizational membership, authenticated keypair ownership, and attribute threshold clearance without revealing private keys or leaking confidential attribute values.
+-----------------------------------+
| Issuer Merkle State Root (R) |
+-----------------+-----------------+
^
Hash Pair (L, R) |
|
+-----------------+-----------------+
| Authentication Path Siblings |
| (h_0, L) -> (h_1, R) -> ... |
+-----------------+-----------------+
^
| Leaf Hash = SHA256(LeafData)
+-----------------+-----------------+
| Blinded Vault Credential |
| CredID | PK_subject | Dept | C_attr|
+-----------------+-----------------+
|
+-----------------------------------+-----------------------------------+
| |
v v
[Schnorr NIZK Protocol] [Pedersen & CDS94 1-of-K ZKP]
Prove: Know x s.t. PK = g^x (mod p) Prove: C = g^m * h^r (mod p)
T = g^v (mod p) where m in {threshold, ..., 5}
c = Hash(g, PK, T, context) WITHOUT disclosing exact m!
s = (v - c * x) (mod q) Simulate false branches
Verify: g^s * PK^c == T (mod p) Link challenge sum: sum(e_i) == c_total
Zero secret bits leaked! Zero attribute bits leaked!
-
RFC 3526 2048-bit MODP Safe Prime Group:
- Strictly operating within the cyclic prime-order subgroup of order
$q = \frac{p-1}{2}$ . - Deterministic Nothing-Up-My-Sleeve secondary generator
$h$ derived via SHA-256 square residue to guarantee unknown discrete logarithm$\log_g h$ .
- Strictly operating within the cyclic prime-order subgroup of order
-
Sparse Merkle Tree & Membership Proofs:
-
$O(\log N)$ logarithmic verification paths. - Deterministic canonical serialization ensuring leaf ordering and resistance against second-preimage attacks.
- Live tamper detection with immediate avalanche rejection.
-
-
Non-Interactive Schnorr Proofs of Knowledge (Fiat-Shamir):
- Proves possession of the sovereign credential holder's private key
$x$ without revealing it over untrusted transport.
- Proves possession of the sovereign credential holder's private key
-
Pedersen Attribute Commitments:
- Information-theoretically hiding (computationally impossible for the verifier to determine clearance even with infinite compute) and computationally binding under the Discrete Logarithm assumption.
-
CDS94 1-of-K Disjunctive Range / Threshold Proofs:
- Proves an operator's clearance meets a facility requirement (
$m \ge 3$ ) by demonstrating$m \in {3, 4, 5}$ using simulated challenge distribution without revealing which specific tier they possess.
- Proves an operator's clearance meets a facility requirement (
-
Dual-Stack Runtime:
- Python 3 cryptographic backend with comprehensive pytest suite.
- Pure client-side WebCrypto / BigInt JavaScript implementation running live on GitHub Pages.
zk-merkle-credential-vault/
├── crypto/
│ ├── merkle.py # Sparse Merkle Tree, leaf generation, inclusion proofs
│ ├── zkp.py # RFC 3526 group, Schnorr NIZK, Pedersen, CDS94 1-of-K
│ └── vault.py # Sovereign identity, blinded issuance, verification pipeline
├── tests/
│ └── test_crypto.py # 15 comprehensive unit tests (Pytest)
├── web/
│ ├── index.html # Cryptographic laboratory interface
│ ├── style.css # Cyber-dark theme & glowing SVG visualizer styles
│ ├── crypto_runtime.js # In-browser BigInt & WebCrypto cryptographic engine
│ └── app.js # Interactive Merkle tree rendering & ZK verification
├── server.py # Standalone HTTP server & JSON state API
├── requirements.txt # Dependencies (pytest>=8.0.0)
├── .github/workflows/
│ ├── ci.yml # Automated GitHub Actions test runner
│ └── deploy-pages.yml # Automated GitHub Pages static deployment
├── LICENSE # MIT License
└── README.md
Clone and execute the 15-test cryptographic verification suite:
git clone https://github.com/JayNabasu/zk-merkle-credential-vault.git
cd zk-merkle-credential-vault
# Install dependencies
pip install -r requirements.txt
# Run pytest
pytest tests/ -vLaunch the built-in HTTP server to explore the visual Merkle Tree and live ZK Gateway:
python server.py
# Open http://localhost:8080 in your browserExperience the production deployment directly in your browser without installing anything:
🔗 https://jaynabasu.github.io/zk-merkle-credential-vault/
- Interactive Merkle Tree: Click any credential to watch its sibling authentication path illuminate in glowing gold and cyan up to the Merkle Root.
- Tamper Simulator: Inject malicious bitflips into leaf payloads and observe the immediate cryptographic cascade that breaks proof verification.
-
ZK Access Gate: Test credential presentations against real clearance gates (
$L \ge 2, 3, 4, 5$ ) with live verification auditing.
| Property | Implementation | Mathematical Guarantee |
|---|---|---|
| Completeness | Schnorr & CDS94 | Any honest prover possessing a valid key and credential will always be accepted ( |
| Special Soundness | Fiat-Shamir Heuristic | A cheating prover without knowledge of |
| Zero-Knowledge | Perfect Blinding | The verifier transcript is statistically indistinguishable from a simulation generated without the witness. |
| Tamper Resistance | SHA-256 Merkle Root | Modifying 1 bit of credential data invalidates the entire Merkle path with avalanche probability |
Jerry A. Nabasu
GitHub: @JayNabasu
Focus: Enterprise Architecture, Autonomous Systems, Applied Cryptography & Distributed Systems.