%[https://www.youtube.com/watch?v=Lkw4hQpgt50]
Decentralized Trust Without Servers
Have you ever wondered how a system with no central server, no single source of truth, can possibly be secure? It sounds like a paradox. In a network of equal peers where anyone can broadcast a message, how do you know what to believe?
This isn't a theoretical puzzle; it's the core challenge we solved while building the security layer for GenosDB. The solution is a robust, layered architecture built on three core principles:
- Cryptographic Identity: Who you are is mathematically provable.
- Verifiable Actions: Everything you do is signed and cannot be forged.
- A Shared Constitution: The rules are embedded in the software itself and are the same for everyone.
Let's dive into this world by following our heroes and villains: the all-powerful Super Admin, a legitimate Manager, and a malicious user, Eve.
Identity and Cryptographic Proof
In GenosDB, every user is identified by a unique Ethereum address. This identity isn't just a username; it's backed by a private key that only the user controls, protected by WebAuthn (biometrics, hardware keys) or mnemonic phrases.
Every single action a user takes is cryptographically signed with their private key. This signature proves:
- Authenticity: The message truly came from the claimed sender.
- Integrity: The message has not been altered in transit.
The Security Manager
Every peer has its own incorruptible security guard: the Security Manager (SM), activated with { sm: true }. Its job is to inspect every incoming operation and run it through a rigorous checklist. It trusts no one by default — only mathematical proof.
Its rulebook is the Role-Based Access Control (RBAC) system, defining what roles (superadmin, manager, guest) are allowed to do.
Attack Scenario: Privilege Escalation
Eve wants manager power. She's currently a guest.
Eve's Plan A: The Forged Promotion
Eve calls db.sm.assignRole('eve_eth_address', 'manager'), signs it, and broadcasts it.
Alice's SM responds:
- Signature Check: Pass. Message is authentically from Eve.
-
Identity Check: Eve is a
guest. -
Permission Check: Can a
guestperformassignRole? NO. - Verdict: OPERATION REJECTED.
Eve's Plan B: The Tampered Client
Eve modifies her local RBAC rules to allow guests to assign roles. Her tampered SM allows it.
Alice's SM response: identical. It consults its own untampered rulebook. A guest cannot assign roles. OPERATION REJECTED.
Security Lesson: Authority is not claimed; it is verifiably granted and enforced collectively.
The Super Admin Paradox
A superadmin's authority is hard-coded into the software's initial configuration (sm: { superAdmins: ["0x1..."] }). They are the root of all trust.
But we hit a snag: when a superadmin tried to assign a role, some peers rejected it because they couldn't find the superadmin's role in the database.
The Solution: A Two-Tiered Source of Truth
-
The Constitution Check (Static Truth): The SM first checks if the sender is on the hard-coded
superAdminslist. If yes, permission passes instantly. - The Public Record Check (Dynamic Truth): If not a super admin, the SM checks the database for assigned roles — roles that were verifiably granted by someone with constitutional authority.
Network Lag and Eventual Consistency
What if a superadmin promotes Bob to manager, and Bob immediately writes data? A slow peer might receive Bob's write before the promotion.
- T1: Super Admin promotes Bob.
- T2: Bob writes data.
- T3: Slow peer Charlie receives Bob's write first → REJECTS (Bob is still a guest).
- T4: Promotion arrives at Charlie → Bob updated to manager.
- T5: Bob's write is retried → ACCEPTED.
This is Eventual Consistency with a security-first mindset. The system prioritizes verifiable proof over instant availability.
Security Commitment
Building a truly secure distributed system is a journey of relentless testing and refinement. By embracing the unique challenges of decentralized environments, we've built a system that is demonstrably trustworthy.
How It Works in Practice
We replace centralized trust with decentralized verification:
-
The Constitution: The
superAdminslist — unchangeable, pre-agreed foundation. - The Public Record: The database itself — truth as provable historical fact.
- The Enforcer: Every peer's SM — a sovereign judge that validates against its own copy of the rules.
GenosDB's security is an emergent property. It's secure not because we trust any single entity, but precisely because we don't have to. The proof is in the data, the rules are in the code, and every peer is a vigilant guardian.
This article is part of the official documentation of GenosDB (GDB).
GenosDB is a distributed, modular, peer-to-peer graph database built with a Zero-Trust Security Model, created by Esteban Fuster Pozzi (estebanrfp).
📄 Whitepaper | overview of GenosDB design and architecture
🛠 Roadmap | planned features and future updates
💡 Examples | code snippets and usage demos
📖 Documentation | full reference guide
🔍 API Reference | detailed API methods
📚 Wiki | additional notes and guides
💬 GitHub Discussions | community questions and feedback
🗂 Repository | Minified production-ready files
📦 Install via npm | quick setup instructions

Top comments (0)