A Cosmos SDK-based application that enables staking of Bitcoin Ordinal RUNEs.
The application consists of two main components:
- Rune Module (
x/rune
): Handles RUNE staking operations and state management on the Cosmos chain - Bridge Service (
bridge/
): Manages synchronization between Cosmos chain and Bitcoin Ordinal Runes
- State tracking with multiple status types (pending, staked, unstaked, failed)
- Event-driven architecture for stake/unstake operations
- Unidirectional bridge between Cosmos chain and Bitcoin network
- Automatic synchronization of RUNE metadata with Bitcoin Ordinals
- User initiates stake transaction through Cosmos SDK messages
MsgStakeRune
creates a staking record with pending status- Bridge service listens for stake events
- Ordinal metadata is updated on Bitcoin network
- Stake status is confirmed on Cosmos chain
type BridgeService struct {
config Config
cosmosClient *cosmos.Client
ordinalClient *ordinals.Client
}
- Maintains connections to both Cosmos and Bitcoin networks
- Processes stake/unstake events
- Updates RUNE metadata
- Handles failure scenarios with automatic status updates
type RuneMetadata struct {
RuneID string
State string
Chain string
Owner string
TxHash string
StakeTimestamp time.Time
}
The platform uses an event-driven architecture:
rune_stake_initiated
: Emitted when a stake is initiatedrune_unstake_initiated
: Emitted when an unstake is requested- Events include metadata for cross-chain synchronization
- Cosmos SDK
- Bitcoin Core RPC
- Ordinals Protocol Support