-
Notifications
You must be signed in to change notification settings - Fork 0
Dual Cross Chain Architecture
Written by MikeLee
Date: December 2024
Crossify.io now supports dual cross-chain protocols running in parallel: LayerZero and Supra HyperNova. This architecture provides redundancy, performance optimization, and future-proofing for our cross-chain synchronization system.
Relying on a single cross-chain protocol creates:
- Single Point of Failure: If the protocol fails, cross-chain sync stops
- No Performance Comparison: Can't optimize based on real-world data
- Vendor Lock-in: Difficult to migrate if a better solution emerges
- Limited Options: Can't leverage best features from different protocols
By running LayerZero and Supra HyperNova in parallel, we get:
- ✅ Redundancy: If one fails, the other handles it
- ✅ Performance Comparison: Real metrics to optimize routing
- ✅ Flexibility: Easy to add/remove protocols
- ✅ Best of Both Worlds: LayerZero's reliability + Supra's security
- ✅ Future-Proofing: Ready for new protocols as they emerge
┌─────────────────────────────────────────────────────────┐
│ BondingCurve │
│ (Token Buy/Sell Logic) │
└────────────────────────┬────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────┐
│ GlobalSupplyTracker │
│ (Maintains Global Supply State) │
└────────────────────────┬────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────┐
│ UnifiedCrossChainSync │
│ (Protocol Abstraction Layer) │
│ ┌──────────────────┐ ┌──────────────────┐ │
│ │ LayerZero Adapter│ │ Supra Adapter │ │
│ │ (CrossChainSync) │ │ (SupraSync) │ │
│ └──────────────────┘ └──────────────────┘ │
└────────────────────────┬────────────────────────────────┘
│
┌────────────────┼────────────────┐
│ │ │
▼ ▼ ▼
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ Ethereum │ │ BSC │ │ Base │
│ Sepolia │ │ Testnet │ │ Sepolia │
└──────────────┘ └──────────────┘ └──────────────┘
Address: 0xa5B144683Db8fE4402B06dbb774cacD95FD1A93e (All Networks)
The central abstraction layer that:
- Routes messages to selected protocol(s)
- Tracks metrics for performance comparison
- Handles message deduplication
- Manages global supply state
- Provides protocol selection logic
Key Features:
- Protocol Selection: LayerZero, Supra, Both, or Auto
- Message Deduplication: Prevents double-processing
- Metrics Tracking: Performance data per protocol
- Automatic Failover: If one protocol fails, use the other
- Token-Specific Config: Each token can have preferred protocol
Address: 0x0D5f52088E30802DC8d5c67Bc5E2231f7ad36569 (All Networks)
Adapter contract for Supra HyperNova:
- Interface ready for Supra EVM support
- Message tracking and forwarding
- Chain ID mapping
- Enable/disable toggle
Status: Placeholder until Supra EVM support launches (expected Q1-Q2 2025)
| Feature | LayerZero | Supra HyperNova |
|---|---|---|
| Status | ✅ Live | ⏳ EVM Support Pending |
| Security Model | Relayer-based | L1-to-L1 Cryptographic |
| Finality | ~30 seconds | 600-900ms |
| Bridge Trust | Relayer trust | No bridge trust |
| Maturity | Battle-tested | New (Nov 2024) |
| Cost | ~$0.01-0.05/msg | TBD |
| Multi-Chain | Bilateral | Multi-chain |
UnifiedCrossChainSync automatically selects the best protocol based on:
- Failure rate (prefer lower)
- Latency (prefer lower)
- Cost (prefer lower)
- Availability
Tokens can have preferred protocols:
- LayerZero: Battle-tested, reliable
- Supra: Enhanced security, faster (when available)
- Both: Maximum redundancy
- Auto: Let the system decide
1. BondingCurve → GlobalSupplyTracker
2. GlobalSupplyTracker → UnifiedCrossChainSync
3. UnifiedCrossChainSync → LayerZero Adapter
4. LayerZero → Other Chains
5. Other Chains → UnifiedCrossChainSync
6. UnifiedCrossChainSync → GlobalSupplyTracker
7. GlobalSupplyTracker → BondingCurve (price updated)
1. BondingCurve → GlobalSupplyTracker
2. GlobalSupplyTracker → UnifiedCrossChainSync
3. UnifiedCrossChainSync → LayerZero Adapter (parallel)
4. UnifiedCrossChainSync → Supra Adapter (parallel)
5. Both protocols → Other Chains
6. First message received → Process
7. Duplicate message → Deduplicate (ignore)
8. GlobalSupplyTracker → BondingCurve (price updated)
When both protocols deliver the same message:
- Message ID Generation: Deterministic ID based on content
- First-Wins Strategy: Process first message, ignore duplicates
- State Verification: Verify state before updating
- Idempotent Updates: Safe to apply multiple times
This ensures:
- No double-processing
- No state corruption
- Reliable operation even with duplicates
UnifiedCrossChainSync tracks per-protocol metrics:
- Messages Sent: Count of messages sent
- Messages Received: Count of messages received
- Failures: Count of failed messages
- Total Cost: Cumulative cost per protocol
- Average Latency: Average message delivery time
These metrics enable:
- Performance comparison
- Cost optimization
- Protocol selection
- Failure analysis
| Network | UnifiedSync | SupraSync | Status |
|---|---|---|---|
| Sepolia | 0xa5B144... |
0x0D5f52... |
✅ Complete |
| BSC Testnet | 0xa5B144... |
0x0D5f52... |
✅ Complete |
| Base Sepolia | 0xa5B144... |
0x0D5f52... |
✅ Complete |
Sepolia:
- UnifiedSync: https://sepolia.etherscan.io/address/0xa5B144683Db8fE4402B06dbb774cacD95FD1A93e
- SupraSync: https://sepolia.etherscan.io/address/0x0D5f52088E30802DC8d5c67Bc5E2231f7ad36569
BSC Testnet:
- UnifiedSync: https://testnet.bscscan.com/address/0xa5B144683Db8fE4402B06dbb774cacD95FD1A93e
- SupraSync: https://testnet.bscscan.com/address/0x0D5f52088E30802DC8d5c67Bc5E2231f7ad36569
Base Sepolia:
- UnifiedSync: https://sepolia.basescan.org/address/0xa5B144683Db8fE4402B06dbb774cacD95FD1A93e
- SupraSync: https://sepolia.basescan.org/address/0x0D5f52088E30802DC8d5c67Bc5E2231f7ad36569
The dual architecture is fully backward compatible:
- Existing CrossChainSync contracts still work
- Can be connected as LayerZero adapter
- No disruption to existing tokens
- Gradual migration path
- Phase 1 (✅ Complete): Deploy UnifiedCrossChainSync
- Phase 2 (⏳ Pending): Connect existing CrossChainSync as adapter
- Phase 3 (⏳ Pending): Authorize GlobalSupplyTracker
- Phase 4 (⏳ Pending): Update TokenFactory to use UnifiedSync
- Phase 5 (⏳ Pending): Enable Supra when EVM support launches
When Supra launches EVM support:
- Full Supra HyperNova integration
- L1-to-L1 cryptographic consensus
- Sub-second finality
- Enhanced security model
Supra DORA 2.0 oracles offer:
- 600-900ms finality
- Real-time price feeds
- Price verification layer
- RWA data support
Timeline: 2-4 weeks for integration
Supra AutoFi provides:
- Zero-block delay automation
- No keepers/relayers needed
- Automated airdrops, vesting
- Cross-chain automation
- ✅ More reliable cross-chain sync
- ✅ Faster synchronization (when Supra launches)
- ✅ Better security guarantees
- ✅ No disruption to existing tokens
- ✅ Redundancy and failover
- ✅ Performance optimization
- ✅ Future-proofing
- ✅ Competitive differentiation
- ✅ Protocol-agnostic design
- ✅ Easy to add new protocols
- ✅ Metrics for optimization
- ✅ Clear migration path
UnifiedCrossChainSync:
function syncSupplyUpdate(
address token,
uint256 newSupply,
uint32 sourceEID
) external payable;
function setTokenProtocol(
address token,
Protocol protocol
) external onlyOwner;
function getProtocolMetrics(
Protocol protocol
) external view returns (ProtocolMetrics memory);SupraSync:
function syncSupplyUpdate(
address token,
uint256 newSupply,
uint32 sourceEID
) external payable;
function setEnabled(bool _enabled) external onlyOwner;
function isReady() external view returns (bool);-
Full Architecture:
docs/DUAL_CROSS_CHAIN_ARCHITECTURE.md -
Implementation Summary:
DUAL_CROSS_CHAIN_IMPLEMENTATION_SUMMARY.md -
Deployment Guide:
contracts/DEPLOY_UNIFIED_SYNC.md -
Deployment Results:
UNIFIED_SYNC_DEPLOYMENT_COMPLETE.md
The dual cross-chain architecture represents a significant upgrade to Crossify's infrastructure. By supporting multiple protocols in parallel, we've created a more robust, flexible, and future-proof system that maintains backward compatibility while enabling new capabilities.
Status: ✅ Contracts deployed, ⏳ Awaiting Supra EVM support for full activation
- Supra Integration - Complete Supra HyperNova integration guide
- Architecture - System architecture overview
- Contracts - Smart contract reference
- MikeLee
For general architecture, see Architecture
For contract details, see Contracts
For roadmap, see Roadmap