How babylonlabs-io/babylon works
Key Components to Include in the System Design:
Core Protocol Layer
• Bitcoin Timestamping Module (x/btccheckpoint)
• Bitcoin Staking Module (x/btcstaking)
• Bitcoin Light Client Module (x/btclightclient)
• Finality Module (x/finality)
• Checkpointing Module (x/checkpointing)
• Epoching Module (x/epoching)
• Incentive Module (x/incentive)
• Monitor Module (x/monitor)
• Mint Module (x/mint)
Infrastructure Layer
• Application Core (app/)
• Cryptographic Components (crypto/)
• Client Interface (client/)
• Command Line Interface (cmd/)
• WASM Bindings (wasmbinding/)
External Interactions
• Bitcoin Network Integration
• PoS Chain Interactions
• Client Applications
Use a Multi-Layer Architecture
• [External Systems Layer]
• Bitcoin Network <---> | BTC Light Client | <---> PoS Chains
• [Protocol Layer] | BTC Timestamping |
• BTC Staking |
• Finality |
• Checkpointing |
• [Core Layer] | Application Core |
• State Management |
• [Infrastructure] | CLI/API/RPC |
Elements
• Module boundaries and interfaces
• Data flow directions
• Security boundaries
• External service integration points
• State management components
• Consensus mechanisms
Technical Details to Highlight
• BLS signature verification (crypto/bls12381)
• ECDSA operations (crypto/ecdsa)
• Schnorr signature adaptation (crypto/schnorr-adaptor-signature)
• WASM smart contract integration
• Protocol upgrade paths
Bitcoin Integration
• BTC header validation flow
• Staking transaction verification
• Timestamp submission process
Security Features
• BLS signature aggregation
• Multi-signature schemes
• Transaction validation paths
State Management
• Epoch transitions
• Checkpoint creation and verification
• Finality gadget integration