diff --git a/docs/register-phase-1-stake.md b/docs/register-phase-1-stake.md new file mode 100644 index 0000000..da4e266 --- /dev/null +++ b/docs/register-phase-1-stake.md @@ -0,0 +1,104 @@ +# Register your Phase-1 stake to Phase-2 through CLI + +## Understanding the registration process + +The registration of Phase-1 stakes to Phase-2 is a manual process that requires +the staker to register their stake to Phase-2 of the Babylon network. +This registration is executed through the `stakercli` binary +and this guide will show you how to do it through the `stakercli` binary. For +detailed information about stake eligibility criteria, registration requirements, +and how to gain voting power and earn rewards in phase-2, please refer to the +[Registration of Existing Stakes to the Babylon Chain](https://github.com/babylonlabs-io/babylon/blob/main/docs/stake-registration.md). + +## Table of Contents +- [Prerequisites](#prerequisites) +- [Setup](#setup) +- [Register your stake](#register-your-stake) +- [Verify the registration](#verify-the-registration) + +## Prerequisites + +To register your stake to Phase-2, you need to have the +following: +- Access to your existing Bitcoin wallet from Phase-1 (needed to sign transactions + and prove ownership of staked funds). +- The Bitcoin block height in which your staking transaction was included, which + will be used in the registration command. +- A funded Babylon address, which will be used to receive the rewards from the + registration. +- Global parameter file as seen here https://github.com/babylonlabs-io/networks/blob/main/bbn-test-5/parameters/global-params.json + that were used in Phase-1. This will be used in the registration command later + on. +- A running instance of the `stakerd` daemon. Please follow the `stakerd` + [setup guide](../README.md#3-btc-staker-installation) to complete the setup. + This is also inclusive of creating a Babylon keyring with funds step as the + `stakerd` daemon requires a funded keyring to pay for the transactions. + +## Setup + +First, you will need to dump the default configuration file. This creates a +template configuration file that you'll customize with your specific values: + +```bash +stakercli admin dump-config +``` + +This will create a `config.json` file in your current working directory. +You'll need to modify this file with your specific settings before proceeding. +Here are the key configurations: + +### Bitcoin Configuration +```toml +[walletconfig] +WalletName = "btc-staker" # Your Bitcoin wallet name +WalletPass = "your-wallet-password" # Your wallet password + +[walletrpcconfig] +Host = "127.0.0.1:19001" # Your Bitcoin node RPC endpoint +User = "your-rpc-user" # Your Bitcoin RPC username +Pass = "your-rpc-pass" # Your Bitcoin RPC password + +[chain] +Network = "signet" # Bitcoin network (signet for testnet) +``` + +### Babylon Configuration +```toml +[babylon] +Key = "btc-staker" # Your Babylon key name created in the btc-staker-installation +ChainID = "bbn-test-5" # Babylon chain ID +RPCAddr = "http://localhost:26657" # Babylon RPC endpoint +GRPCAddr = "http://localhost:9090" # Babylon gRPC endpoint +AccountPrefix = "bbn" # Babylon address prefix +KeyringBackend = "test" # Keyring backend type +GasPrices = "0.01ubbn" # Minimum gas price +``` + +Finally, start the `btcstaker` daemon, which will manage your connections to both +Babylon and Bitcoin nodes, monitor transactions, and handle the staking process. +Add the location for the above created `config.json` file to the command: + +```bash +stakerd --configfile admin start +``` + +## Register your stake + +Following the setup of the configuration file and starting the `btcstaker` +daemon, you can proceed to register your stake from Phase-1 to Phase-2 using +the following command. We use the `global_parameters.json` file that you should +already have created as stated in the prerequisites. + +```shell +stakercli daemon stake-from-phase1 \ + --staking-transaction-hash \ + --staker-address \ + --tx-inclusion-height +``` + +parameters: +- `global-parameters-file`: The path to the global parameters file. +- `your-phase1-tx-hash`: The original hash of your phase-1 staking transaction. +- `your-btc-address`: BTC address of the staker in hex. +- `block-height`: The block height at which your staking transaction was + included.