Skip to main content

prepare-genesis

Prepare a genesis file with Babylon-specific parameters and configurations. This command creates a fully configured genesis file with all necessary parameters for Bitcoin staking, finality providers, checkpointing, and economic settings tailored for Babylon networks.

Overview

The prepare-genesis command generates a complete genesis file with default parameters optimized for Babylon's Bitcoin security inheritance protocol. It configures Bitcoin integration, finality provider settings, staking parameters, and economic incentives in a single command.

babylond prepare-genesis <testnet|mainnet> <chain-id> [flags]

Prerequisites

Before using this command, ensure you have:

  • Network planning completed - Understand your target network configuration
  • Parameter decisions made - Economic and security parameters chosen
  • Bitcoin network coordination - Base header and network-specific settings ready
  • Backup procedures - Plan for genesis file distribution and backup

Arguments

ArgumentDescription
testnet|mainnetNetwork type - determines default parameter sets
chain-idUnique identifier for the blockchain network

Parameter Categories

Network Configuration

FlagTypeDefaultDescription
--chain-idstringGenesis file chain-id (can override positional argument)
--genesis-timeintCurrent timeGenesis timestamp (Unix epoch)
--homestring~/.babylondApplication home directory

Bitcoin Integration

FlagTypeDefaultDescription
--btc-base-headerstringGenesis headerHex of the base Bitcoin header
--btc-base-header-heightuint320Height of the base Bitcoin header
--btc-confirmation-depthuint326Confirmation depth for Bitcoin headers
--btc-finalization-timeoutuint3220Finalization timeout for Bitcoin headers
--checkpoint-tagstring01020304Hex encoded tag for babylon checkpoint on BTC
--allowed-reporter-addressesstringAddresses allowed to submit Bitcoin headers

Bitcoin Staking Parameters

FlagTypeDefaultDescription
--min-staking-amount-satint500000Minimum staking amount in satoshis (0.005 BTC)
--max-staking-amount-satint100000000000Maximum staking amount in satoshis (1000 BTC)
--min-staking-time-blocksuint16100Minimum staking time in blocks
--max-staking-time-blocksuint1610000Maximum staking time in blocks
--min-slashing-fee-satint1000Minimum slashing fee in satoshis
--slashing-ratestring0.1Bitcoin staking slashing rate (10%)
--slashing-pk-scriptstringDefault scriptBitcoin staking slashing pk script (hex)
--unbonding-timeuint1621Unbonding timelock in BTC blocks
--unbonding-fee-satint1000Required unbonding transaction fee in satoshis

Covenant Configuration

FlagTypeDefaultDescription
--covenant-pksstringDefault keysBitcoin staking covenant public keys (comma-separated)
--covenant-quorumuint323Bitcoin staking covenant quorum threshold

Finality Provider Settings

FlagTypeDefaultDescription
--max-active-finality-providersuint32100Maximum active finality providers
--activation-heightuint1Block height to start accepting finality votes
--finality-sig-timeoutint3Blocks for finality providers to cast votes
--min-commission-ratestring0Minimum commission rate for finality providers
--jail-durationstring24h0m0sMinimum jail period for finality providers
--signed-blocks-windowint100Sliding window for tracking provider liveness
--min-signed-per-windowstring0.5Minimum signing requirement to avoid jail

Economic Parameters

FlagTypeDefaultDescription
--inflation-minfloat0.07Minimum inflation rate (7%)
--inflation-maxfloat0.2Maximum inflation rate (20%)
--inflation-rate-changefloat0.13Maximum inflation rate change per year
--goal-bondedfloat0.67Target bonded token ratio (67%)
--blocks-per-yearuint6311520Expected blocks per year

Validator Configuration

FlagTypeDefaultDescription
--max-active-validatorsuint3210Maximum number of active validators
--epoch-intervaluint400Number of blocks between epochs
--vote-extension-enable-heightint1Height to enable vote extensions

Network Performance

FlagTypeDefaultDescription
--block-gas-limitint50000000Block gas limit