Bridge Module
Cross-chain token and NFT migration with oracle-verified consensus.
Purpose
The Bridge module enables bidirectional asset movement between two EVM or EVM-compatible chains. It exists because:
- Games may need to migrate from a legacy chain to a new settlement chain
- Players need to move tokens and NFTs across chains without trusting a centralized custodian
- The bridge must work with any ERC-20 token, not just a specific gameplay currency
Components
| Component | Description | Doc |
|---|---|---|
| Token Bridge | Bidirectional fungible token transfer with oracle consensus | Token Bridge → |
| NFT Bridge | Phased NFT migration strategy (lock, map metadata, mint on target) | NFT Bridge → |
| Oracle Network | Decentralized attestation layer that verifies cross-chain events | Oracle Network → |
Architecture
┌─────────────────────────────────────────────────────────────┐
│ SOURCE CHAIN │
│ │
│ Player deposits tokens ──► Bridge Contract (lock/burn) │
│ │ │
│ emits event │
└────────────────────────────────────┼────────────────────────┘
│
┌──────▼──────┐
│ ORACLE │
│ NETWORK │
│ │
│ ┌────┐ │
│ │ O1 │ ──► signs attestation
│ ├────┤ │
│ │ O2 │ ──► signs attestation
│ ├────┤ │
│ │ ON │ ──► signs attestation
│ └────┘ │
└──────┬──────┘
│ threshold met
│
┌────────────────────────────────────▼────────────────────────┐
│ TARGET CHAIN │
│ │
│ Player calls claim() with signatures ──► Bridge Contract │
│ (mint/unlock) │
│ │
└─────────────────────────────────────────────────────────────┘
Key Properties
| Property | Detail |
|---|---|
| Bidirectional | Tokens can flow in both directions between chains |
| Oracle consensus | Requires configurable threshold of independent oracle signatures |
| Replay-protected | Claim hashes prevent double-processing |
| Chain-verified | Packets include chain ID; wrong-chain submissions revert |
| Time-bounded | Claims expire after a configurable window (default: 30 days) |
| Token-agnostic | Bridge contracts work with any ERC-20; token address is a parameter |
Reference Implementation
The first deployment bridges between WAX (EOSIO) and Avalanche (EVM):
| Contract | Chain | Purpose |
|---|---|---|
teleporteos | WAX | Lock/release tokens, store oracle signatures |
FadedMonsutaTHC | Avalanche | Mint/burn tokens, verify oracle consensus |
While the reference uses WAX ↔ Avalanche, the bridge pattern is chain-agnostic. Any source chain that can emit events can serve as the source side.
When to Use This Module
| Your Situation | Use Bridge? |
|---|---|
| Migrating from another chain | ✅ Token bridge + NFT bridge |
| Game is already on the target chain | ❌ No bridge needed |
| Want to support multi-chain tokens | ✅ Deploy bridge between each chain pair |
| Need a DEX or AMM | ❌ That's not what this module does |