Documentation Index
Fetch the complete documentation index at: https://docs.yattacorp.xyz/llms.txt
Use this file to discover all available pages before exploring further.
The Problem: Front-Running
Without encryption, transactions in the mempool are publicly visible before they are included in a block. On AMM pools this means:- Sandwich attacks: A bot sees your swap, inserts a buy before it and a sell after, profiting at your expense
- Front-running: Bots copy and accelerate profitable transactions
- Transaction snooping: Anyone can see what you are doing before it executes
The Solution: Encrypted Mempool
NEXUS encrypts transactions before submission. The content is hidden from everyone — including node operators — until the miner decrypts and executes it at inclusion time.Encrypted mempool is live in V1, with protocol version 2. It is particularly important for protecting AMM V3 swaps from sandwich attacks.
How it Works
Encryption (You → Mempool)
Decryption (Miner, at inclusion)
Only the miner holds the protocol private key. On inclusion:Why ChaCha20-Poly1305?
| Property | Benefit |
|---|---|
| Authenticated encryption | Detects tampered ciphertexts |
| 256-bit security | Quantum-resistant margin |
| No padding oracles | Safe against adaptive attacks |
| Fast (software-optimized) | Low overhead per transaction |
Using the Encrypted Mempool (TypeScript SDK)
MEV Protection Properties
| Attack | Protected? |
|---|---|
| Sandwich attacks on AMM swaps | ✅ |
| Front-running profitable calls | ✅ |
| Transaction content snooping | ✅ |
| Replay attacks | ✅ (authenticated ciphertext) |
| Mempool ordering manipulation | ⚠️ Ordering is still visible, content is not |
Encrypted mempool hides transaction content. Transaction ordering within a block is still controlled by the miner. For full ordering protection, combine with private RPC submission (direct to trusted miner).
Cryptographic Details
| Component | Specification |
|---|---|
| Key agreement | ECDH on secp256k1 |
| Key derivation | HKDF-SHA256 (RFC 5869) |
| Symmetric encryption | ChaCha20-Poly1305 (RFC 8439) |
| Nonce | 12 bytes, random per transaction |
| Auth tag | 16 bytes (Poly1305, appended to ciphertext) |
| Protocol version | 2 |
| Transaction ID | SHA256(version || ephemeral_pubkey || ciphertext) |