1. System Overview & Getting Started
NGLChain is a hybrid system combining centralized servers (Supabase) with decentralized security concepts. It uses a "Blockchain-Lite" structure where every message is a block linked to the previous one via cryptographic hashes.
Joining Protocol
Login uses a Chain ID and Secret Key.
- Key Derivation: The Secret Key undergoes 100,000 iterations of PBKDF2 with the Chain ID as salt to generate the true 256-bit encryption key.
- Entry PoW: Your browser must solve a mathematical proof-of-work
(difficulty
0000) to join a lobby, preventing spam bots.
Chain Types
- Public Chain: Visible in the main lobby. Still requires a key to decrypt.
- Private Chain: Hidden, invite-only. Creators can set a maximum peer
limit. If exceeded, new users are auto-banned (
LOBBY_FULL_BAN).
2. Security Architecture
- End-to-End Encryption (E2EE): Messages are encrypted in the browser using AES-GCM before sending. The server only stores ciphertext.
- Proof-of-Work (PoW): Every message requires a "mining" task. The difficulty dynamically adjusts to target a 3000ms block time.
- Chain Integrity Check: On load, your browser
validates the entire chain. It checks that every message's
previous_hashmatches the predecessor'scurrent_hash. - The KillSwitch: If validation fails (tampering
detected), the client triggers a
KillSwitch, locking the session immediately.
3. Messaging Features
Core Architecture
- Block Structure Each message contains: Encrypted Content, Nonce, Current Hash, Previous Hash, Timestamp, and User ID.
- Voice Messages Audio is recorded in-browser, converted to Base64, and E2EE encrypted. The server cannot listen to these files.
Interactions & Management
-
Interactions
Replies: Quote specific messages.
Reactions: React with emojis (👍, 🔥). -
Management
Edit: Fix typos (Max 3 edits).
Delete: Hides content for all users.
Pin: Highlights important messages.
4. Admin Tools
Chain Creators (Admins) have special privileges to maintain order.
Key Rotation
Change the Secret Key. Online users update automatically; offline users are locked out.
Ownership Transfer
Transfer admin rights to another online user (verified via Presence Check).
Purge Chat
Permanently delete all messages in the chain from the database.
Force Ban
Ban suspicious users directly from the Log Dashboard.
5. Log Dashboard & Analytics
The Log Dashboard (/nglchain/log/) provides deep insights
into network health.
Performance Metrics
-
PoW Time (ms) Target: ~3000ms
Time to solve the puzzle. < 500ms may indicate a bot.
-
Difficulty Dynamic
Complexity of the puzzle. Increases with traffic.
-
Hashrate (H/s) Est. Power
Estimated network hashes per second.
-
Supabase Latency Network
Real-time ping to the database.
Security & Health
-
Anomaly Score 0% - 100%
High scores indicate suspicious behavior (fast PoW, rate limits).
-
Security Violations Count
Validation failures or rate limit hits.
-
Block Time Volatility Stability
Consistency of message intervals.
-
Active Nodes Real-time
Users currently connected.
Advanced Analytics Charts
PoW Time Distribution
Bar chart showing solution times. Skew toward <1000ms indicates scripting.
Difficulty Timeline
Line chart of difficulty adjustments based on traffic.
Security Violation Trend
Line chart showing attacks or failures over time.
User Anomaly Scatter
Scatter plot of "Avg PoW Time" vs "Anomaly Score".
Throughput (Msg/Min)
Volume of messages over time.
Hourly Heatmap
Busiest times of day (0-24h).
6. Privacy & Local Storage
NGLChain stores data locally on your device:
- Local Storage: Anonymous User ID, "My Chains" list, ban status.
- IndexedDB: Derived encryption keys (stored per-chain) to avoid re-typing.
7. Troubleshooting
If you experience issues (stuck loading, "Invalid Key" loops, or UI glitches), you can force a clean reset of the application. This will clear the Service Worker, Cache, and reload the page. It will NOT delete your keys or chain data.
NGLChain System Info • v2.2.1