Skip to content

feat: Implement Cross-Chain Re-Entrancy & Double-Spend Anomaly Detection Engine with Automated Flash-Pause #1003

Description

@Mosas2000

Area

Backend API / Soroban contracts

What problem does this solve?

During high cross-chain throughput, sophisticated bridge exploits (like double-minting tokens across multiple EVM-Stellar bridge relayers or re-entrancy attacks during cross-chain state updates) can occur within sub-second block windows before standard reconciliation cron jobs trigger.

Proposed solution

  1. Build a real-time stream graph analyzer (crossChainAnomalyEngine.service.ts) operating over Horizon SSE and EVM WebSocket event feeds.
  2. Track pending mint/burn transaction sequence IDs across both source and target chains using Redis sliding windows.
  3. Detect double-spend attempts, out-of-order sequence nonce jumps, or duplicate deposit tx hashes in real time.
  4. If a cross-chain anomaly threshold is breached within a 5-second window, trigger an automated Flash-Pause directly invoking Soroban pause_contract RPC and setting emergency breaker flags.
  5. Create comprehensive unit and integration test suites simulating double-mint scenarios, network latency partitions, and emergency recovery flows.

Alternatives considered

Relying solely on periodic batch reconciliation jobs (which run every few minutes), but real-time stream graph analysis is required to catch exploits before funds leave liquidity pools.

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions