Skip to content

Commit aafb3da

Browse files
committed
more text
1 parent d2e78a1 commit aafb3da

File tree

1 file changed

+68
-18
lines changed

1 file changed

+68
-18
lines changed

docs/register-bitcoin-stake.md

Lines changed: 68 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,21 @@
22
## Table of contents
33
1. [Introduction](#1-introduction)
44
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)
77
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)
1212
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)
1316
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)
1720
6. [Bitcoin Staking Rewards](#6-bitcoin-staking-rewards)
1821

1922
## 1. Introduction
@@ -137,18 +140,23 @@ The following sections cover:
137140

138141
### 3.2. Babylon Chain BTC Staking Parameters
139142

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-
142143
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.
148155

149156
Below, we provide
150157
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:
152160

153161
* `covenant_pks`:
154162
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:
180188
* `min_slashing_tx_fee_sat`:
181189
The minimum transaction fee (in satoshis) required for the pre-signed slashing
182190
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.
183193
* `unbonding_time_blocks`:
184194
The required time lock on unbonding transactions (and change output of
185195
slashing transactions).
186196
* `unbonding_fee_sat`:
187197
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 -->
188210

189211
**How to Retrieve Parameters**
190212

@@ -454,6 +476,10 @@ message to the Babylon network:
454476
* Creation using Golang based on this [type reference](../x/btcstaking/types/tx.pb.go)
455477
and broadcast to the Babylon network.
456478

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+
457483
## 4. Stake Registration Flows
458484

459485
Having defined the construction of Bitcoin staking transactions and their
@@ -530,7 +556,31 @@ has been launched.
530556
> by the [btccheckpoint](../x/btccheckpoint) module's parameters.
531557
8. After receiving the proof of inclusion, the stake is designated as `ACTIVE`.
532558

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
534584

535585
To broadcast your Babylon transactions, you will need access to a node and can use
536586
various methods:

0 commit comments

Comments
 (0)