CyxWiz LogoCyxWiz
DocsSecurity

Security Model

Security architecture, authentication mechanisms, and best practices for the CyxWiz platform.

Security Overview

CyxWiz implements multiple layers of security to protect:

User Data

Models, datasets, credentials

Compute Resources

Node hardware from malicious code

Financial Assets

Token balances and transactions

Network Integrity

Communication between components

JWT Authentication

All gRPC communications use JWT (JSON Web Tokens) for authentication.

Token Structure
{
  "header": {
    "alg": "HS256",
    "typ": "JWT"
  },
  "payload": {
    "sub": "node_id or user_id",
    "iss": "cyxwiz-central-server",
    "iat": 1702000000,
    "exp": 1702086400,
    "scope": ["job:execute", "metrics:report"],
    "node_id": "uuid-...",
    "session_id": "uuid-..."
  },
  "signature": "..."
}

Token Types

Token TypeLifetimePurpose
Session Token24 hoursNode registration session
Job TokenJob durationAuthorization for specific job
P2P Token1 hourDirect Engine-Node communication
Refresh Token7 daysObtaining new session tokens

Role-Based Access Control

RolePermissions
UserSubmit jobs, view own jobs, manage wallet
NodeAccept jobs, report progress, claim payments
AdminManage nodes, view all jobs, configure system

Encryption

Data at Rest
DatabaseAES-256 (PostgreSQL TDE)
Model FilesAES-256-GCM
Wallet KeysArgon2 + AES-256
LogsNot encrypted (no sensitive data)
Data in Transit
gRPCTLS 1.3
REST APIHTTPS
IPFSTLS + Content Hash Verification
Solana RPCHTTPS

Docker-Based Sandboxing

Server Nodes execute untrusted training code in Docker containers:

# Sandboxed training container
FROM python:3.10-slim

# Non-root user
RUN useradd -m -s /bin/bash trainer
USER trainer

# Limited resources (set via docker run)
# --memory, --cpus

# No network access during training
# --network none

# Read-only filesystem (except /tmp and /output)

ENTRYPOINT ["python", "/job/train.py"]

Container Restrictions

ResourceLimit
MemoryJob-specific (e.g., 16GB)
CPUJob-specific (e.g., 4 cores)
Disk50GB per job
NetworkDisabled during training
CapabilitiesAll dropped
SyscallsSeccomp whitelist

Blockchain Security

Escrow System Flow
1. Job Submission
   User ---> CreateEscrow(amount) ---> Solana
                                          |
                                    Escrow Account
                                    (Locked funds)

2. Job Completion
   Node completes job
   Central Server verifies
   Central Server ---> ReleaseEscrow ---> Solana
                                             |
                                       Node Wallet
                                       (Payment received)

3. Dispute Resolution
   If disputed:
   - Funds remain in escrow
   - Arbitration process
   - Manual resolution

Threat Model

ThreatMitigation
Malicious NodeSandboxed execution, verification
Man-in-the-MiddleTLS encryption, certificate pinning
Token TheftShort expiration, refresh rotation
Replay AttackNonce in requests, timestamp validation
DoS AttackRate limiting, connection limits
Data ExfiltrationNetwork isolation, output limits
Payment FraudEscrow, multi-sig, verification

Security Boundaries

+----------------------------------------------------------+
|                     Trusted Zone                          |
|                                                           |
|  +------------------+        +------------------+         |
|  | Central Server   |<------>|    Database      |         |
|  +------------------+        +------------------+         |
|           ^                                               |
+-----------|-------------------------------------------------+
            | TLS + JWT
+-----------v-------------------------------------------------+
|                    Semi-Trusted Zone                        |
|                                                             |
|  +------------------+        +------------------+           |
|  |  Server Node     |        |  Engine Client   |           |
|  |  (Authenticated) |        |  (Authenticated) |           |
|  +------------------+        +------------------+           |
|           |                                                 |
+-----------|-------------------------------------------------+
            | Docker Sandbox
+-----------v-------------------------------------------------+
|                    Untrusted Zone                           |
|                                                             |
|  +------------------+                                       |
|  | Training Code    |  <- No network, limited resources    |
|  | (User-provided)  |                                       |
|  +------------------+                                       |
+------------------------------------------------------------+

Audit Logging

All security-relevant events are logged:

EventDetails Captured
Login attemptUser ID, IP, success/failure, method
Token generationToken type, subject, expiration
Job submissionUser ID, job config, payment
Node registrationNode ID, hardware info, location
Payment transactionAmount, from, to, tx hash
Configuration changeChanged fields, old/new values

Best Practices

For Operators
  • Rotate JWT signing keys every 30 days
  • Enable TLS for all connections
  • Monitor security logs daily
  • Update dependencies weekly
  • Backup encryption keys securely
  • Use strong passwords (16+ chars)
  • Enable 2FA where supported
For Node Operators
  • Keep Docker updated (latest stable)
  • Use dedicated hardware for nodes
  • Monitor resource usage for anomalies
  • Secure wallet private keys offline
  • Enable firewall (only required ports)
For Users
  • Protect API keys - don't commit to Git
  • Verify model hashes after download
  • Review node reputation before submitting
  • Use escrow for large payments
  • Keep wallet backups secure