Cross-Chain Functionality
Last updated
Last updated
The Curvance Protocol implements a sophisticated cross-chain architecture that enables seamless operation across multiple blockchains while maintaining protocol-wide consistency. This architecture enables unified governance, shared incentives, and the efficient distribution of rewards across the entire ecosystem.
The cross-chain system consists of several specialized components that work together:
CentralRegistry: Serves as a single source of truth for each chain, containing protocol configuration and contract addresses.
MessagingHub: The unified communication layer that enables cross-chain message passing. It handles:
Epoch coordination
Fee distribution
Token bridging
veCVE lock migration
Governance message propagation
FeeManager: Collects protocol fees and prepares them for cross-chain distribution.
RewardManager: Distributes rewards to veCVE holders based on their proportional lock amounts.
VotingHub: Coordinates token emission allocation across all chains based on governance decisions.
Curvance's cross-chain architecture relies on two primary technologies:
Wormhole
Facilitates generic message passing between chains
Provides Cross-Chain Query (CCQ) capability for state verification
Powers the system's VAA (Verifiable Action Approval) verification
Circle's CCTP (Cross-Chain Transfer Protocol)
Handles token transfers between chains
Primarily used for fee and reward token movements
The Curvance Protocol has several critical cross-chain data flows:
This diagram illustrates the bi-weekly process of distributing protocol fees across all chains in the Curvance ecosystem:
A privileged operator initiates the process on one chain by querying veCVE lock points across all other chains using Wormhole CCQ.
After verification of chain data, the system pulls accumulated fees from the local FeeManager.
The protocol calculates each chain's share of fees based on the proportion of total veCVE points on that chain.
Fees are then transferred to destination chains using CCTP for the token transfer, alongside a Wormhole message carrying distribution instructions.
Each receiving chain's MessagingHub routes the received tokens to its RewardManager for distribution to veCVE holders proportionally.
This mechanism ensures fair fee distribution based on governance participation across all chains in the ecosystem.
CVE Bridging
User initiates bridge on source chain
Calls bridge(recipient, dstChainId, amount, gasLimit)
on CVE contract
Pays required message fee
Accounting & Message Prep
CVE contract burns user's tokens (_burn(msg.sender, amount)
)
CVE calls MessagingHub's bridgeToken()
with payloadType 5
MessagingHub validates parameters (chain support, recipient address)
MessagingHub calls Wormhole to send cross-chain message
Wormhole Message
Wormhole network relays the message to destination chain
Message contains recipient address and token amount
Accounting & Validation
MessagingHub receives and validates the Wormhole message
Checks that message hasn't been processed before (prevents replay)
For payloadType 5, calls completeBridge()
on destination CVE
Destination CVE mints tokens to recipient
Result
User now has equivalent CVE tokens on destination chain
Total supply across chains remains constant (burned on source, minted on destination)
veCVE Bridging
User initiates lock bridge on source chain
Calls bridgeLock(lockIndex, bridgeData, rewardsData, params, aux)
on veCVE
Provides destination chain info and continuousLock status preference
Pays required message fee
Accounting & Message Prep
Claims any pending rewards for user
Updates user's points to reflect removed lock
Burns user's veCVE tokens
Removes lock entry from storage
Calls burnLockedTokens()
on CVE to burn underlying tokens
veCVE calls MessagingHub's bridgeToken()
with payloadType 4
Encodes lock parameters (amount, continuous lock status)
MessagingHub validates and sends Wormhole message
Wormhole Message
Wormhole network relays the message to destination chain
Message contains original owner, amount, and lock properties
Accounting & Validation
MessagingHub receives and validates the Wormhole message
For payloadType 4, calls mintLockedTokens()
on destination CVE
CVE mints tokens to MessagingHub
MessagingHub approves veCVE to spend the tokens
Calls createLockFor()
on veCVE with same properties
Result
User has equivalent veCVE lock on destination chain
Lock maintains same continuous status as selected
Total veCVE supply across chains remains consistent
The Curvance cross-chain architecture implements several key states:
This diagram outlines the state transitions during a Curvance protocol epoch:
Epoch Start: A new epoch begins based on the timestamp defined by genesisEpoch + (epochNumber * EPOCH_DURATION)
.
Fee Collection & Trading Activity: During the epoch, fees accumulate from protocol activity across all chains independently.
Cross-Chain Coordination: Near epoch end, the protocol aggregates veCVE points across all chains using Wormhole CCQ to determine reward distribution.
Fee Distribution: Collected fees are distributed pro-rata to each chain based on its proportion of total veCVE points, with tokens bridged using CCTP.
Epoch Completion: The nextEpochToDeliver
counter is incremented, allowing the system to track epochs sequentially and ensure proper distribution.
The epoch system operates in a strictly sequential manner to ensure consistency across chains.
The cross-chain architecture implements several safety mechanisms:
Message Hash Verification: Each cross-chain message is tracked by its hash to prevent replay attacks.
Messaging Status Controls: The messaging hub can be put into various states to control message creation and execution:
Status 1: Full operation (create and execute messages)
Status 2: Execute-only mode (no new messages)
Status 3: Complete pause (no operations)
Guardian Validation: Uses Wormhole guardians to validate cross-chain messages through VAA signatures.
Chain Verification: Messages are only accepted from known, registered chains configured in the Central Registry.
Fallback Mechanisms: If the system gets stuck, administrative overrides exist to ensure continued operation.
The Curvance Protocol maintains cross-chain consistency through:
Synchronized Epochs: All chains share a common epoch schedule, defined by the genesisEpoch and epochDuration values.
Cross-Chain Queries: The system uses Wormhole's CCQ to verify the state of remote chains before making critical decisions.
Sequential Epoch Processing: Each epoch must be processed in order, and all chains must catch up sequentially (tracked via nextEpochToDeliver).
Verifiable Messages: All cross-chain communications are verified through cryptographic signatures from Wormhole guardians.
The Curvance cross-chain architecture creates a unified, multi-chain DeFi protocol that maintains consistency and shared state across all supported networks. This design enables protocol-wide coordination for token emissions, fee distribution, and governance while allowing users to interact with the protocol on their preferred blockchain.