Private Swap (Stealth Mode)

The Private Swap module is the core privacy engine of Crosterix. It allows users to execute on-chain token swaps without revealing their main wallet address, transaction metadata, or activity history to any third-party service. All swap operations are executed client-side, using decentralized liquidity aggregators (such as 1inch or 0x API) to ensure optimal routing and gas efficiency while maintaining complete data anonymity.

Key Concepts

1. Privacy-Preserving Execution

Traditional swap interfaces (e.g., Uniswap, 1inch) require users to broadcast transactions directly from their main wallet, exposing wallet addresses, token balances, and behavioral patterns. Crosterix’s Stealth Mode eliminates this by introducing an intermediary stealth address layer:

  • The user signs transactions locally using their private key, but the execution address (sender) is a one-time stealth address generated for that swap session.

  • The stealth address is cryptographically derived from the user’s main public key using elliptic-curve Diffie–Hellman (ECDH) encryption.

  • As a result, even if someone inspects the blockchain or mempool, they cannot correlate multiple swaps back to the same user.

2. Client-Side Aggregation

Instead of routing swap requests through Crosterix’s backend, the DApp interacts directly with liquidity APIs such as:

  • 1inch Aggregation API — for optimal path finding and routing quotes.

  • 0x Swap API — as a fallback or alternative route provider.

All API calls are executed from the user’s browser, never through a centralized relay. This ensures:

  • No IP logging or user session tracking.

  • No persistent storage of quotes or swap metadata.

  • No server-side event correlation between users or addresses.

Example (simplified flow):

// Example: client-side swap quote retrieval
const quote = await fetch(
  `https://api.1inch.dev/swap/v6.0/1/quote?fromTokenAddress=${tokenA}&toTokenAddress=${tokenB}&amount=${amount}`
);

Once the quote is returned, the user signs and submits the transaction locally through MetaMask or WalletConnect all within the Crosterix interface.

3. No Backend Logging

Crosterix is stateless by architecture.

  • The DApp has no centralized database, backend server, or analytics tracker.

  • Every request and response occurs in memory during the session and disappears once the browser is closed.

  • No data about the user’s wallet, transaction routes, or token pairs is ever persisted or analyzed.

This guarantees zero-knowledge transparency: Crosterix never sees or stores what tokens a user swaps, when, or in what amounts.

4. Optional “Private Gas Relay”

To further increase anonymity, Crosterix supports an optional Private Gas Relay layer. This feature allows the user to delegate gas payment to a temporary relay address or network sponsor, obfuscating the transaction origin.

How it works:

  1. The user signs the swap transaction locally (off-chain).

  2. The signed transaction is encrypted and sent to a relay endpoint.

  3. The relay broadcasts it to the blockchain using its own gas instead of the user’s wallet.

  4. Once executed, the relay discards the transaction data — keeping the original sender fully hidden.

This prevents on-chain correlation between the gas payer and the transaction originator, which is one of the last remaining metadata leaks in standard DeFi swaps.

Private Gas Relay can be integrated using third-party providers like Biconomy’s Gasless SDK, OpenZeppelin Defender Relayers, or custom RPC endpoints configured by developers.

Developer Architecture

User Wallet (Signer)

├──> Crosterix UI (Client-Side App)
│     ├──> Stealth Address Generation (ECDH)
│     ├──> 1inch / 0x API (Swap Quotes)
│     └──> Optional Gas Relay API

└──> Ethereum Mainnet (Execution)
       ├──> Swap executed via Aggregator Router
       └──> Relayed stealth transaction

Execution Flow Summary:

  1. User toggles “Stealth Mode ON”.

  2. Crosterix generates a stealth address.

  3. Swap quote retrieved via 1inch/0x (client-side).

  4. User signs swap transaction locally.

  5. Transaction optionally routed through Private Gas Relay.

  6. Swap executes on Ethereum mainnet without exposing original wallet.

Security Properties

Layer
Mechanism
Protection

Address

Stealth derivation

Unlinkable identities

Execution

Client-side aggregation

No data exposure

Logging

Stateless frontend

No server persistence

Gas Relay

Optional proxy sender

Removes address traceability

Integration Notes

Developers can integrate Private Swap into their own DApps using:

  • @1inch/limit-order-protocol or @0x/contract-wrappers

  • ethers.js or viem for signing and sending swaps

  • Optional biconomy gasless for relayed execution

Crosterix provides SDK stubs and a TypeScript interface for custom integrations:

interface PrivateSwapParams {
  fromToken: string;
  toToken: string;
  amount: string;
  slippage: number;
  stealthMode: boolean;
  relay?: boolean;
}

Last updated