Back to docs

Security & Privacy

Cryptographic architecture and security best practices

Security Architecture

Styx Protocol is designed with privacy-by-default principles. All sensitive data is encrypted client-side before ever touching the blockchain. The protocol uses industry-standard cryptographic primitives that have been extensively audited.

Zero-Knowledge Design: The Styx protocol never sees unencrypted messages. All encryption/decryption happens locally in your application.

Encryption Stack

Four-layer cryptographic protection

Key Exchange

X25519 (Curve25519)

Elliptic curve Diffie-Hellman for perfect forward secrecy

Security: 128-bit security level

Symmetric Encryption

XChaCha20-Poly1305

AEAD cipher with 24-byte nonce for message encryption

Security: 256-bit keys

Message Authentication

Poly1305 MAC

Authenticates ciphertext to prevent tampering

Security: Included in AEAD

Envelope Wrapping

Styx Envelope V1

Multi-recipient envelope with ephemeral keys per message

Security: Compact 88-byte format

Styx Envelope V1 Format

Messages are wrapped in a compact 88-byte envelope that contains all necessary cryptographic material for decryption while revealing nothing about the content.

OffsetSizeFieldDescription
01VersionEnvelope version (0x01)
11FlagsFeature flags (stealth, anonymous)
232Ephemeral PKX25519 public key for key exchange
3424NonceXChaCha20 nonce
5816Auth TagPoly1305 authentication tag
74NCiphertextEncrypted message payload

Privacy Features

Stealth Addresses

One-time derived addresses prevent linking sender to recipient

Sender Anonymity

Optional sender concealment for anonymous messaging

Minimal On-chain Data

Only encrypted ciphertext stored - no metadata leakage

Forward Secrecy

Each message uses unique ephemeral keys

WhisperDrop Privacy Model

WhisperDrop uses Merkle trees to enable private airdrops without revealing the full recipient list on-chain.

What's Public

  • • Merkle root (32 bytes)
  • • Total token amount
  • • Expiration timestamp
  • • Campaign authority

What's Private

  • • Recipient addresses
  • • Individual allocations
  • • Merkle tree structure
  • • Total recipient count

Stealth Claiming: Recipients can optionally claim to a derived stealth address, breaking any link between their allocation and their public wallet.

Decentralization Guarantees

No relayers, no sequencers, no oracles, no backend. Three on-chain programs on Solana L1 — no in-protocol admin access to user funds.

No Fund Admin Access

No instruction grants admin access to user pools or funds. The program has an upgrade authority (Styx Labs) — but no in-protocol path allows draining, pausing, or redirecting shielded tokens. Pool creation is permissionless — any wallet, any SPL token.

Transparent Fee Schedule

Core shield/unshield: ~5000 lamports Solana base fee only. ZK private transfers: 100–400 lamports to OBOL treasury for verifier costs. WhisperDrop: 0.01 SOL init + 0.0003 SOL per claim. All amounts hardcoded in the binary.

No Infrastructure Required

No relayer, sequencer, oracle, or backend server. The indexer is optional UX convenience — not a dependency. Protocol functions entirely on Solana L1.

100% On-Chain Verification

Groth16 via CPI, Ed25519 via instructions sysvar, range proofs via SHA-256, nullifiers via PDA creation. Validators ARE the verifiers.

Self-Custodial Pools

Pool PDA authority derived from ["sts_pool", mint_id]. invoke_signed requires matching seeds. No admin, multisig, or governance can withdraw.

No Censorship Mechanism

No allowlist, denylist, paused state, or circuit breaker. If the cryptographic proofs are valid, the transaction succeeds.

On-Chain Verification

Every cryptographic operation is verified by Solana validators. No trusted third party in any path.

OperationVerification MethodTrusted Third Party?
ZK Private TransferGroth16 via CPI to StyxZK verifierNone (on-chain)
Ed25519 OwnershipSolana instructions sysvar (native)None (native Solana)
Range ProofSHA-256 commitment-opening in programNone (on-chain)
Merkle ProofKeccak256 tree verification in programNone (on-chain)
Nullifier UniquenessPDA creation (Solana runtime)None (Solana runtime)
Token TransferSPL Token CPI (invoke/invoke_signed)None (SPL Token program)

Deterministic PDA Architecture

All program-derived addresses are deterministic and verifiable by anyone. No centralized server needed.

PDASeeds
Pool PDA["sts_pool", mint_id]
Pool Token Account["sts_pool", mint_id, "token"]
IC Pool PDA["ic_pool", mint_id]
Nullifier PDA["sts_nullifier", nullifier_hash]
DAM Pool PDA["dam_pool", mint_id]
IC Tree PDA["ic_tree", tree_id]
FeeConfig PDA["styx_zk_fee"]
Receipt Mint["sts_receipt", mint_id]
Stealth Address["sts_stealth", owner, nonce]

Threat Model

Cannot Be Stopped

  • Pool creation for any SPL token
  • Shielding tokens into pools
  • Unshielding tokens from pools (with valid nullifier)
  • Private transfers between notes
  • Message posting (inscriptions)
  • NFT creation and transfer
  • ZK proof submission

Could Be Affected

  • Solana validator censorship — mitigated by leader rotation
  • RPC node censorship — mitigated by multiple providers
  • Program upgrade — mitigated by revoking upgrade authority
  • Low anonymity set — improves as more users shield tokens

Cannot Happen

  • Admin withdrawing from shielded pools (no in-protocol path exists)
  • Protocol pausing or freezing (no pause instruction)
  • Unauthorized fee changes (all fee amounts are hardcoded in the binary)
  • Transaction censorship at protocol level
  • Retroactive de-anonymization (without viewing keys)
  • Double-spending (nullifier PDAs are unique)

Decentralization Comparison

How StyxStack compares to other privacy protocols

StandardStyxStackTornado CashLight Protocol
Fund admin accessNoneNoneNone
Upgrade authorityYes (Styx Labs)None (immutable)Yes
Protocol feesTransparent (hardcoded)ZeroVariable
Pause mechanismNoneNoneUnknown
Governance tokenNoneTORNNone
InfrastructureOnly SolanaOnly EthereumSolana + indexers
Pool creationPermissionlessFixed denominationsPermissionless
Censorship resistanceFull (no fund admin)Full (immutable)Partial (upgradeable)

Mainnet Programs

Styx Privacy Standard (SPS)

STYXygfX7on1MMnjjjxXtkzqbQ7heyh6gsC5Mihhs95

Canary Ferry v3.0.0 — 369,272 bytes — Pinocchio + Jiminy 0.7

StyxZK Verifier

FERRYpEo4dPbJZYqUfpkWHEMQCCs33Vm3TwBLZpBovXM

Groth16 proof verification + custom ZK circuit registry — 88,688 bytes

Security Best Practices

CRITICAL

Never Log Private Keys

Never log, store in plaintext, or transmit private keys. Use secure enclaves when possible.

CRITICAL

Validate All Inputs

Always validate public keys, signatures, and decrypted data before processing.

HIGH

Use Secure RPC

Always use HTTPS for RPC connections. Use dedicated RPC providers like Helius for production.

MEDIUM

Rate Limit API Calls

Implement rate limiting to prevent abuse and protect your API keys.

MEDIUM

Rotate Keys Periodically

Rotate encryption keys and API keys on a regular schedule.

MEDIUM

Audit Dependencies

Regularly audit npm dependencies for known vulnerabilities.

Security Audits

Audit in Progress

Styx Protocol is currently undergoing security audits. While the cryptographic primitives used (X25519, XChaCha20-Poly1305) are well-established and battle-tested, the smart contract code has not yet received a formal third-party audit. Use in production at your own risk.

Bug Bounty Program

Found a security vulnerability? We offer CRED rewards for responsible disclosure.

10,000 CRED
Critical
5,000 CRED
High
1,000 CRED
Medium

Report vulnerabilities to: security@styx.nexus