Omnichain Asset Bridge
Two-Chain Trust-Minimized Asset Relayer & Bridge
The Omnichain Asset Bridge facilitates decentralized asset transfers between two EVM blockchain environments. It combines on-chain escrow contracts with an off-chain TypeScript relayer that listens for emission events, collects validator signatures, and delivers verifiable mint/unlock payloads to the destination network.
The Engineering Problem
Cross-chain bridges are frequently targeted by replay attacks, relayer desynchronization, and front-running during gas price spikes.
Decentralized Lock-and-Mint with Relayer Verification
The architecture decouples the locking mechanism on Source Chain from the minting mechanism on Destination Chain through an authenticated relayer daemon.
BridgeVault.sol: Escrows user tokens on Source Chain, emitting an indexed BridgeDeposit event with nonce, recipient, and amount.
TypeScript Relayer Daemon: Listens to RPC logs via WebSocket filters, buffers events, and verifies chain confirmations.
On-Chain Nonce & Signature Registry: Validates EIP-712 structured signatures and marks sequential nonces to prevent double-spending.
Exponential-Backoff Retry Queue: SQLite-backed persistent state store ensures zero message drop during RPC downtime.
Technical Challenges & Mitigations
Preventing Cross-Chain Replay Attacks
Constructed unique domain separators per chain ID and incorporated monotonic nonces per user address, verified inside the destination smart contract before token minting.
Relayer RPC Liveness & Network Reorgs
Implemented confirmation depth requirements (e.g. 12 block confirmations) before queuing payloads, coupled with SQLite WAL logging for crash-resilient message dispatch.