Curvance
  • Protocol Overview
    • Click Less, Earn More
    • Protocol Architecture
    • Asset Types
    • Liquidity Markets
      • Borrowing
      • Liquidations
      • Interest Rates
      • Oracles
      • Collateral Caps
      • Bad Debt Socialization
    • Application Specific Sequencing
    • New Age Liquidity Mining
      • Protocols
    • How Are New Assets Integrated
    • Plugin System
    • Universal Account Balance
    • Token Approval Management
    • Lending Risks
  • Security
    • Security and Audits
  • Miscellaneous
    • RPCs and Testnet Stability
    • Glossary
    • TL;DR
      • Customer Types and Benefits
    • Brand Assets
    • Weblinks
    • Disclaimer
    • Frequently Asked Questions
  • Developer Docs
    • Overview
    • Quick Start Guides
      • Atlas Fastlane Auctions (coming soon)
      • Plugin Integration
        • List of Delegable Actions
      • Loans & Collateral
        • Lend Assets
        • Deposit into pTokens
        • Withdraw Loans
        • Withdraw pTokens
      • Borrowing & Repayment
        • Borrow
        • Repaying Debt
      • Leverage
        • Leveraging
        • Deleveraging
    • Lending Protocol
      • Market Manager
      • Position Tokens (pToken)
      • Earn Tokens (eTokens)
      • Dynamic Interest Rate Model
      • Universal Balance
    • Position Management
      • Leverage
      • Deleverage / Fold
    • Dynamic Liquidation Engine (DLE)
      • Orderflow Auction System
      • Bad Debt Socialization
    • Plugin & Delegation System
      • Transfer Lock Mechanism
      • Delegable Actions
    • Cross-Chain Functionality
      • Messaging Hub
      • Fee Manager
      • Reward Manager
    • Auxiliary Functionality
Powered by GitBook
On this page
  • Overview
  • State Machine
  • Message Payload Types
  • Cross-Chain Data Flows
  • Integration with External Messaging Systems
  • Message Execution Security
  • Cross-Chain Health Management
Export as PDF
  1. Developer Docs
  2. Cross-Chain Functionality

Messaging Hub

Overview

The Messaging Hub serves as the central communication layer of the Curvance Protocol, facilitating cross-chain operations between all supported blockchains. It coordinates epoch transitions, distributes protocol fees, manages token emissions, and facilitates the migration of user positions between chains.

State Machine

The Messaging Hub operates in four states:

  • Inactive (0): Not used (reverts if attempted).

  • Send Active (1): Can send messages but not receive them.

  • Fully Active (2): Can send and receive messages.

  • Emergency Paused (3): All cross-chain messaging functionality is disabled.

State transitions require appropriate permissions:

  • Standard DAO permissions can pause the system.

  • Elevated permissions are required to unpause or modify messaging pathways.

Message Payload Types

The Messaging Hub defines a type system for cross-chain messages:

Payload Type
Purpose

1

Basic fee transfer between chains.

2

Gauge emission configuration.

3

Epoch reward distribution.

Cross-Chain Data Flows

1. Epoch Coordination Flow

The Messaging Hub aggregates points across all chains using Wormhole's Cross-Chain Query (CCQ) system. This data drives protocol-wide reward distribution based on the proportional vote-escrow locking across the entire ecosystem.

2. Fee Distribution Flow

Protocol fees are collected by each chain's FeeManager and transferred via CCTP, with cross-chain coordination handled by Wormhole messaging. This enables a unified reward system where all fees contribute to protocol-wide incentives.

3. Emission Configuration Flow

Token emissions are determined by governance voting and distributed to each chain through the Messaging Hub. This ensures that incentives align with governance decisions across the entire protocol.

4. Native Gas Storage for Cross-Chain Actions

The Messaging Hub manages native gas tokens to pay for cross-chain messaging fees across the entire protocol.

Gas Management Flow

  • The contract holds native gas tokens to pay for cross-chain message delivery.

  • Gas cost depends on destination chain, payload size, and gas limit configuration.

  • Default gas limit (300,000) ensures sufficient resources on destination chains.

  • Gas fees are calculated through quoteMessageFee which includes:

    • Wormhole relayer fees for message delivery.

    • Additional Wormhole core message publishing fees.

This architecture allows the protocol to operate seamlessly across multiple chains while maintaining security, proper fee distribution, and efficient gas usage for all cross-chain operations.

Integration with External Messaging Systems

The Messaging Hub acts as an abstraction layer over multiple underlying cross-chain communication systems:

  • Wormhole handles general message passing and validation.

  • Circle's CCTP manages cross-chain stablecoin transfers.

  • Message Keys link CCTP transfers with Wormhole messages.

Message Execution Security

The Messaging Hub implements multiple security mechanisms:

  1. Message Deduplication: All message hashes are recorded to prevent replay attacks.

  2. Source Validation: Messages are only processed from known messaging hubs on authorized chains.

  3. Payload Type Validation: Each payload type requires specific validation logic

  4. Chain ID Validation: Messages are validated against registered chain IDs..

  5. Status Controls: The messaging status state machine prevents undesired message processing

Cross-Chain Health Management

The architecture includes specialized handling for cross-chain synchronization issues:

  • When a RewardManager is offline, rewards are sent to the DAO address.

  • If epoch progression is out of sync, the system routes funds to maintain protocol health.

  • Native gas tokens stored in the Messaging Hub ensure cross-chain actions can be funded.

This resilient design ensures the protocol can maintain operations even when individual chains or components experience temporary issues.

PreviousCross-Chain FunctionalityNextFee Manager

Last updated 14 days ago