API Reference

Overview

Bitcoin and Babylonchain

Note that BTC is staked on the Bitcoin chain, while the Finality Provider and BABY rewards reside on the Babylonchain. Our API uses mainnet to refer to Bitcoin mainnet and Babylonchain mainnet, and testnet to refer to Bitcoin signet and Babylonchain testnet.

Flow

The API interactions to stake are outlined below. TLDR is:

Step 1 - Intent

  • Use the Create Babylon Delegation endpoint and get back 2 PBSTs (Slashing tx and Unbonding tx) and 1 message (Proof of ownership of Babylon address).
  • You will also get a uuid called stake_id (this will allow you to get back this response later without needing to start over).
  • The state of the flow moves to initialized

Once you've signed them...

Step 2 - Delegate (on Babylon)

  • Using the 3 signatures above, pass them to the Create Delegate Tx endpoint and get back a Babylon Chain MsgCreateBTCDelegation that you will need to sign and broadcast
  • The state moves to waiting_for_delegation
  • Sign this transaction
  • Broadcast it
    • if you want us to do it for you, use the Broadcast Delegate Tx endpoint.
    • if you do it yourself, use Update Delegate Tx endpoint to send us the tx hash. We will need it to monitor the status of delegation before building a viable staking tx

Step 3 - Stake (on Bitcoin)

  • Once the delegation has been confirmed onchain, call the Bitcoin Stake Tx endpoint with stake_id and you will get back an unsigned Bitcoin staking tx. Once signed...
    • Broadcast Staking Tx:
      • if you want us to broadcast it for you, use the Broadcast Staking Tx (Docs TBD) endpoint.
      • if you broadcast it yourself, use Update Staking Tx endpoint to send us the tx hash.