|
| 1 | +# Bridge Relayer Daemon — Scoping Doc |
| 2 | + |
| 3 | +**Status:** Not yet implemented. Tracked post-mainnet-launch (launch was 2026-04-16). |
| 4 | +**Blocker for:** Arbitrum ERC-20 UDAG ↔ UltraDAG mainnet native UDAG round-trips. |
| 5 | +**Not a blocker for:** Anything currently shipped. Arbitrum ERC-20 trades on Camelot; native UDAG is earned via staking/validator emission. |
| 6 | + |
| 7 | +## What exists today |
| 8 | + |
| 9 | +Consensus layer is ready on both sides: |
| 10 | + |
| 11 | +- **UltraDAG mainnet**: `BridgeDepositTx` and `BridgeReleaseTx` fully implemented in `crates/ultradag-coin/src/tx/bridge.rs`, with quorum enforcement, deposit-nonce tracking, and `MIN_BRIDGE_VALIDATORS=4` / `MIN_BRIDGE_QUORUM=3` floors (GHSA-6gwf-frh8-ppw7 fix). |
| 12 | +- **Arbitrum**: `UDAGBridgeValidator` contract deployed; validator signature aggregation and replay protection in place. |
| 13 | + |
| 14 | +What's missing is the off-chain daemon that: |
| 15 | +1. Watches the Arbitrum `UDAGBridge` contract for `Deposit(from, amount, unique_id)` events. |
| 16 | +2. Aggregates validator signatures (Ed25519 from the UltraDAG active set) over `(chain_id, deposit_nonce, recipient, amount)`. |
| 17 | +3. Submits `BridgeReleaseTx` to UltraDAG mainnet with those signatures. |
| 18 | +4. Reverse direction: watches UltraDAG for `BridgeBurnTx`, aggregates, submits Arbitrum-side release. |
| 19 | + |
| 20 | +## Scope estimate |
| 21 | + |
| 22 | +- **Language:** Rust (reuses `ultradag-coin` types + `ultradag-sdk`). |
| 23 | +- **Size:** ~2-3k SLOC new daemon + ~500 SLOC validator-side handler mod. |
| 24 | +- **Key design decisions (open):** |
| 25 | + - How do validators know to sign? Auto-sign on deposit observation, or require operator action? |
| 26 | + - Where does the daemon run? Founder-operated first, then permissioned per validator, then permissionless? |
| 27 | + - Signature aggregation: threshold BLS, Ed25519 multi-sig list, or something else? |
| 28 | +- **Bridge-hardening pass (reporter's recommendation from GHSA-6gwf-frh8-ppw7 #2):** deposit-nonce ↔ source-chain-proof binding. Still open; should land in the same sprint. |
| 29 | + |
| 30 | +## Why not now |
| 31 | + |
| 32 | +1. **No user pressure.** ERC-20 UDAG on Arbitrum has its own liquidity and trades fine. Native UDAG is earned via validator emission. Nobody is currently trying to round-trip. |
| 33 | +2. **Surface-area.** A live bridge daemon is the highest-risk component in a crypto system — history is littered with 8-figure bridge exploits. Shipping it in a rush right after the nuclear restart would be reckless. |
| 34 | +3. **Genesis-clean.** With the 2026-04-16 hard-fork restart, the bridge deposit counter on both sides starts at 0. No legacy state to reconcile. |
| 35 | + |
| 36 | +## Suggested next steps |
| 37 | + |
| 38 | +1. **Week 1:** design doc — which signature scheme, who runs the daemon, how are validators compensated for signing. |
| 39 | +2. **Week 2-3:** implement the happy-path daemon (founder-operated, single instance, manual sig collection). |
| 40 | +3. **Week 4:** bounty-program-hardened — let Sumitshah00 and others have a crack at it on testnet before mainnet. |
| 41 | +4. **Week 5+:** mainnet bridge enabled. |
| 42 | + |
| 43 | +Until then, the UI at `/bridge` remains correctly labeled "Bridge contracts not yet deployed for round-trips" (check `dashboard/src/pages/BridgePage.tsx`). |
0 commit comments