|
2 | 2 | ## Table of contents
|
3 | 3 | 1. [Introduction](#1-introduction)
|
4 | 4 | 2. [Stake registration on the Babylon chain](#2-stake-registration-on-the-babylon-chain)
|
5 |
| - 1. [Post-Staking Registration Flow](#21-post-staking-registration-flow) |
6 |
| - 2. [Pre-Staking Registration Flow](#22-pre-staking-registration-flow) |
| 5 | + 1. [Post-Staking Registration Flow](#21-post-staking-registration-flow) |
| 6 | + 2. [Pre-Staking Registration Flow](#22-pre-staking-registration-flow) |
7 | 7 | 3. [Stake Submission](#3-stake-submission)
|
8 |
| - 1. [Overview of Data that needs to be Submitted](#31-overview-of-data-that-needs-to-be-submitted) |
9 |
| - 2. [Babylon Chain BTC Staking Parameters](#32-babylon-chain-btc-staking-parameters) |
10 |
| - 3. [Creating the Bitcoin transactions](#33-creating-the-bitcoin-transactions) |
11 |
| - 4. [The `MsgCreateBTCDelegation` Babylon message](#34-the-msgcreatebtcdelegation-babylon-message) |
| 8 | + 1. [Overview of Data that needs to be Submitted](#31-overview-of-data-that-needs-to-be-submitted) |
| 9 | + 2. [Babylon Chain BTC Staking Parameters](#32-babylon-chain-btc-staking-parameters) |
| 10 | + 3. [Creating the Bitcoin transactions](#33-creating-the-bitcoin-transactions) |
| 11 | + 4. [The `MsgCreateBTCDelegation` Babylon message](#34-the-msgcreatebtcdelegation-babylon-message) |
12 | 12 | 4. [Stake Registration Flows](#4-stake-registration-flows)
|
| 13 | + 1. [Post-Staking Registration](#41-post-staking-registration) |
| 14 | + 2. [Pre-Staking Registration](#42-pre-staking-registration) |
| 15 | + 3. [Technical Resources for Babylon Broadcasting](#43-technical-resources-for-babylon-broadcasting) |
13 | 16 | 5. [Managing your Stake](#5-managing-your-stake)
|
14 |
| - 1. [On-demand unbonding](#51-on-demand-unbonding) |
15 |
| - 2. [Withdrawing Expired/Unbonded BTC Stake](#52-withdrawing-expiredunbonded-btc-stake) |
16 |
| - 3. [Withdrawing Remaining Funds after Slashing](#53-withdrawing-remaining-funds-after-slashing) |
| 17 | + 1. [On-demand unbonding](#51-on-demand-unbonding) |
| 18 | + 2. [Withdrawing Expired/Unbonded BTC Stake](#52-withdrawing-expiredunbonded-btc-stake) |
| 19 | + 3. [Withdrawing Remaining Funds after Slashing](#53-withdrawing-remaining-funds-after-slashing) |
17 | 20 | 6. [Bitcoin Staking Rewards](#6-bitcoin-staking-rewards)
|
18 | 21 |
|
19 | 22 | ## 1. Introduction
|
@@ -137,18 +140,23 @@ The following sections cover:
|
137 | 140 |
|
138 | 141 | ### 3.2. Babylon Chain BTC Staking Parameters
|
139 | 142 |
|
140 |
| -<!-- yes! yup there is separate param for this https://github.com/babylonlabs-io/babylon/blob/main/proto/babylon/btcstaking/v1/params.proto#L64. btc_activation_height describe from which btc block given parameters start i.e if your staking transaction is included in block 10, and there are two sets of parameters one with btc_activation_height=1 and the second with btc_activation_height=30 , all the delegation data must be valid against first set of parmeters. --> |
141 |
| - |
142 | 143 | BTC Staking transactions need to abide by the parameters specified by the Babylon
|
143 |
| -Babylon chain for BTC Staking transaction validity. These parameters are Bitcoin |
144 |
| -height-specific, meaning they are valid starting from a specific Bitcoin block |
145 |
| -height, known as `btc_activation_height`. If your staking transaction is included |
146 |
| -in a Bitcoin block, it must comply with the set of parameters active at that |
147 |
| -block's height. |
| 144 | +chain for BTC Staking transaction validity. These parameters are Bitcoin height-specific, |
| 145 | +meaning that staking transactions included in different Bitcoin block heights |
| 146 | +might correspond to different Bitcoin staking validity rules. |
| 147 | +The parameters and the Bitcoin block heights they apply to are defined as follows: |
| 148 | +* Each parameters version specifies a Bitcoin block height from which it starts applying |
| 149 | + known as the `btc_activation_height`. |
| 150 | +* In order to find out which parameters version a Bitcoin transaction should adhere to, |
| 151 | + you take all the parameters versions and sort them in an ascending manner through the |
| 152 | + `btc_activation_height`. |
| 153 | +* The first parameters version that has `btc_activation_height > lookup_btc_height` is the |
| 154 | + staking parameters version for the `lookup_btc_height` Bitcoin height. |
148 | 155 |
|
149 | 156 | Below, we provide
|
150 | 157 | a brief overview of the parameters employed by the Babylon chain
|
151 |
| -as part of the [x/btcstaking](../x/btcstaking) Cosmos SDK module: |
| 158 | +as part of the [x/btcstaking](../x/btcstaking) Cosmos SDK module. |
| 159 | +We will focus on the values defined in each parameters version: |
152 | 160 |
|
153 | 161 | * `covenant_pks`:
|
154 | 162 | A list containing the BIP-340 public keys used by the covenant committee.
|
@@ -180,11 +188,25 @@ as part of the [x/btcstaking](../x/btcstaking) Cosmos SDK module:
|
180 | 188 | * `min_slashing_tx_fee_sat`:
|
181 | 189 | The minimum transaction fee (in satoshis) required for the pre-signed slashing
|
182 | 190 | transaction. Represented in int64 format.
|
| 191 | +* `slashing_rate`: A scalar that defines what's the portion of the stake |
| 192 | + that will be slashed in the case of the finality provider double-signing. |
183 | 193 | * `unbonding_time_blocks`:
|
184 | 194 | The required time lock on unbonding transactions (and change output of
|
185 | 195 | slashing transactions).
|
186 | 196 | * `unbonding_fee_sat`:
|
187 | 197 | The fee required for unbonding transactions.
|
| 198 | +* `min_commission_rate`: A scalar defining the minimum commission rate |
| 199 | + for finality providers. |
| 200 | +* `delegation_creation_base_gas_fee`: A uint64 defining the minimum |
| 201 | + gas fee to be paid when registering a stake through the pre-staking |
| 202 | + registration flow. |
| 203 | +* `allow_list_expiration_height`: The Babylon block height (as a uint64) |
| 204 | + on which the initial staking transaction allow-list expires. |
| 205 | +* `btc_activation_height`: The Bitcoin block height on which this version of |
| 206 | + parameters takes into effect. |
| 207 | + |
| 208 | +<!--- TODO 2: troubleshooting for btc activation --> |
| 209 | +<!--- TODO 3: note about finality not being activated --> |
188 | 210 |
|
189 | 211 | **How to Retrieve Parameters**
|
190 | 212 |
|
@@ -454,6 +476,10 @@ message to the Babylon network:
|
454 | 476 | * Creation using Golang based on this [type reference](../x/btcstaking/types/tx.pb.go)
|
455 | 477 | and broadcast to the Babylon network.
|
456 | 478 |
|
| 479 | +> **Important**: When submitting a staking transaction using the |
| 480 | +> pre-registration staking flow a special gas fee should be applied. |
| 481 | +> More details on this in the following section. |
| 482 | +
|
457 | 483 | ## 4. Stake Registration Flows
|
458 | 484 |
|
459 | 485 | Having defined the construction of Bitcoin staking transactions and their
|
@@ -530,7 +556,31 @@ has been launched.
|
530 | 556 | > by the [btccheckpoint](../x/btccheckpoint) module's parameters.
|
531 | 557 | 8. After receiving the proof of inclusion, the stake is designated as `ACTIVE`.
|
532 | 558 |
|
533 |
| -**Technical Resources for Babylon Broadcasting** |
| 559 | +**Important: Gas requirements for the pre-staking registration flow**: |
| 560 | +Given that the pre-staking registration flow does not have the requirement |
| 561 | +that the staker has already committed funds to the Bitcoin network, |
| 562 | +it could serve as a chain spamming vector, especially given that it |
| 563 | +leads to the submission of multiple covenant emulator signatures. |
| 564 | +To combat this, the submission of a `MsgCreateBTCDelegation` message |
| 565 | +using the pre-staking registration flow requires a minimum gas amount |
| 566 | +specified by the `delegation_creation_base_gas_fee` attribute of the |
| 567 | +Babylon parameters. |
| 568 | + |
| 569 | +**Important: Which Bitcoin Staking parameters to use**: Given that the staking |
| 570 | +parameters are Bitcoin block height specific and the fact that the |
| 571 | +pre-staking registration flow requires the staker to first submit their |
| 572 | +transaction to Babylon and then to Bitcoin, a concern might arise that |
| 573 | +the Bitcoin block height at the time of Babylon submission might correspond |
| 574 | +to different parameters than the Bitcoin block height at the time of |
| 575 | +Bitcoin inclusion. To combat this, the Babylon chain expects |
| 576 | +that the staking transaction will use the Bitcoin staking parameters |
| 577 | +defined for the Bitcoin height of the tip of the **on-chain Bitcoin light client** |
| 578 | +of the Babylon chain at the time of the pre-staking registration submission. |
| 579 | +The tip height of the on-chain Bitcoin light client can be retrieved as follows: |
| 580 | +* LCD/RPC: through the `/babylon/btclightclient/v1/tip` query endpoint |
| 581 | +* CLI: through the `babylond query btclightclient tip` query |
| 582 | + |
| 583 | +### 4.3. Technical Resources for Babylon Broadcasting |
534 | 584 |
|
535 | 585 | To broadcast your Babylon transactions, you will need access to a node and can use
|
536 | 586 | various methods:
|
|
0 commit comments