Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: registration of phase 1 stake #417

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Conversation

samricotta
Copy link
Contributor

No description provided.

@@ -1,136 +0,0 @@
## Running a node
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removal of this should be a separate pull request, doesn't have much to do with what we're doing here.

Comment on lines 15 to 23
This documentation guides you through the structures that need to be
communicated to the Babylon chain in order to register a Phase-1 stake or
create new stake.

We are going to start with the Babylon structures associated with BTC staking
and how to generate and construct them.

Then we are going to explore different use cases utilising the different
structures.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This documentation guides you through the structures that need to be
communicated to the Babylon chain in order to register a Phase-1 stake or
create new stake.
We are going to start with the Babylon structures associated with BTC staking
and how to generate and construct them.
Then we are going to explore different use cases utilising the different
structures.
This document walks through the communication protocol
with the Babylon chain in order to register existing Bitcoin stakes
or create new ones. It is structured as follows:
- [Section 2](...link) introduces the `MsgCreateBTCDelegation`
Babylon chain message which is utilized to communicate
staking transactions to the Babylon chain. The section includes
details about how to fill in its different fields.
- [Section 3](...link) outlines on how to register existing Bitcoin stakes
(e.g., stakes created during Phase-1) using the above structure.
- [Section 4](...link) outlines on how to create new Bitcoin stakes using
the Expression of Interest (EOI) workflow.
- [Section 5](...link) outlines how to monitor your stake transaction's status
and gives a high-level overview of the unbonding and withdrawing actions.

We will go through the fields in the above message in detail to understand how
to construct them.

### Staking Transaction
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need so much detail. Let's just specify that this is the staking transaction (not necessarily signed, @KonradStaniec can verify) in hex format. Same for the unbonding and slashing transactions.

Let's first give an overview of what is required and then we provide links on how these can be created. The purpose of this guide is not to instruct people on how to create a staking transaction or unbonding transaction. The purpose of the guide is to instruct people on the communication protocol and what is expected from each field. For example, we can follow such a structure:

We will go through the fields in the above message in detail to understand how 
to construct them:

- ...
- `staking_tx`: The Bitcoin staking transaction in hex format. The transaction can either be signed or unsigned. You can find details on how to create the staking transaction using our [Golang library ](...) or our [TypeScript library](...). You can find the rules of what constitutes a valid staking transaction [here](..) (cc @KonradStaniec ). You can find details on the staking script [here](..). 
- `slashing_tx`: The slashing transaction which spends the staking transaction. The signature needs to be provided on the `slashing_tx_sig` field. You can find details bla blah
- `unbonding_time`: The unbonding time...


To generate this hash you will need to do the following:

1. Build the staking hash using `BuildStakingInfo`:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The following are a bit hard to follow, not sure why need them here. We don't need to provide code examples, that's not the goal of this document. It should serve as a "router" document which explains to user the sequence of steps of what they need to do and provides them links to the places they can find details if they don't know them.

### Stake creation/registraton
#### Registering a phase-1 stake

To register your phase-1 stake to phase-2, you need to submit a
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To register your phase-1 stake to phase-2, you need to submit a
To register a Bitcoin stake that is already on Bitcoin to the Babylon chain (e.g., a phase-1 stake), you need to submit a

1. Create `MsgCreateBTCDelegation` with the inclusion proof filled as defined
above and submit `MsgCreateBTCDelegation` to the Babylon network's btcstaking
module. If all verifications pass, your delegation becomes active on the Babylon
chain immediately since you've already proven your BTC is locked on Bitcoin.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not the case, they need to wait for covenants to submit their signatures.

2. You can check the activation status by querying the babylon node like this.

```bash
babyloncli query btcstaking delegation-status <staking-tx-hash>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
babyloncli query btcstaking delegation-status <staking-tx-hash>
babylond query btcstaking delegation-status <staking-tx-hash>

babyloncli query btcstaking delegation-status <staking-tx-hash>
```

3. Note that certain eligibility criteria apply including:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need this, we should define the validity criteria on the MsgCreateBTCDelegation section.

verify your transactions and add their required signatures. This ensures your
delegation will be accepted once you commit your BTC.

3. Once you have covenant approval, you can confidently submit your staking
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you know you have verification? (side-note: don't use "approval")


#### Creating new stakes

Create and submit `MsgCreateBTCDelegation` with an empty inclusion proof to the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you submit?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants