MilkyWay Docs
  • INTRODUCTION
    • Welcome to MilkyWay
    • Mission and Vision
    • MILK
      • Staking
        • Quick Start
      • Governance
        • Quick Start
      • Network Parameters
        • Chain Registry
      • Tokenomics
  • User Guides
    • For Liquid Stakers
      • Celestia (milkTIA)
        • Quick Start
        • Using third party apps
          • Camelot
          • Demex
          • Dymension
          • Levana
          • Margined
          • Mars
          • Osmosis
          • UX
      • Initia (milkINIT)
        • Quick Start
        • Using third party apps
      • Babylon (milkBABY)
        • Quick Start
        • Using third party apps
    • For Restakers
      • Quick Start
      • Creating a wallet
      • Restaking your assets
    • Bridging
      • Hyperlane
      • IBC Eureka
  • Infrastructure Operators
    • For Validators
      • Quick Start
      • Consesus node
      • Validator node
  • For Operators
    • Quick Start
    • Operator Management
    • Opt-in and Opt-out Services
  • For Developers
    • Quick Start
    • Service Management
    • Inviting Operators to Join Your Service
    • Creating Rewards Distribution Plan
  • Architecture
    • Modular Liquid Staking
      • Overview
      • Liquid Staking 101
      • Celestia (milkTIA)
        • Technical Architecture
          • Liquid Staking Process
          • Withdrawal Process
          • Exchange Rate
          • Compound Staking Rewards
          • Claim Process
          • Limits and Restrictions
        • Integrating with milkTIA
          • Contract Specifications
          • APIs specification
      • Initia (milkINIT)
        • Technical Architecture
          • Liquid Staking Process
          • Withdrawal Process
          • Exchange Rate
          • Compound Staking Rewards
          • Claim Process
          • Limits and Restrictions
        • Integrating with milkINIT
          • Liquid staking module specifications
          • Chains specifications
      • Bablyon (milkBABY)
        • Technical Architecture
          • Liquid Staking Process
          • Withdrawal Process
          • Exchange Rate
          • Compound Staking Rewards
          • Claim Process
          • Limits and Restrictions
        • Integrating with milkBABY
          • Liquid staking module specifications
          • Chains specifications
    • Modular Restaking
      • Overview
        • Technical Architecture
        • Design Philosophy
        • Programmable Rules
        • Economic Model
        • Use Cases
      • Restaking 101
      • Modules
        • x/assets
        • x/ibc-hooks
        • x/liquidvesting
        • x/operators
        • x/pools
        • x/restaking
        • x/rewards
        • x/services
        • x/tokenfactory
  • SECURITY
    • Audits
    • Bug Bounty Program
  • APPENDIX
    • Official Links
    • Frequently Asked Questions
    • Glossary
    • Branding Resources
    • Whitepaper (PDF)
Powered by GitBook
On this page
  • Transferring your tokens from Babylon to MilkyWay
  • Liquid staking BABY tokens
  • Liquid unstaking (redeeming) milkBABY tokens
  • Transferring milkBABY tokens from MilkyWay to other blockchains.
  1. Architecture
  2. Modular Liquid Staking
  3. Bablyon (milkBABY)
  4. Integrating with milkBABY

Liquid staking module specifications

Our milkBABY implementation is based on the work that the Stride team has put together inside their StakeIBC module. All we have done is simply forking their code and updating it to be compatible with Babylon, the Layer 1 chain the MilkyWay Orchestration Layer 1 interacts with.

In this page you can find a list of messages and commands that can be used in order to liquid stake some BABY tokens and run some useful operations with the minted milkBABY tokens.

Please note that for regular users, the milkBABY 1 click flow allows users to simply hold BABY on their Babylon address and use the feature to automatically send tokens to the MilkyWay orchestration layer to be liquid staked and its representative LSD token to be sent back to user Babylon address in one go.

Transferring your tokens from Babylon to MilkyWay

Before liquid staking your tokens, you need to transfer the BABY tokens you want to liquid stake from the Babylon chain to the MilkyWay chain. To do this, you can use the IBC Transfer module present inside both Babylon and MilkyWay chain.

To transfer some amount of BABY tokens from Babylon to MilkyWay, you can use the following message:

{
  "@type": "/ibc.applications.transfer.v1.MsgTransfer",
  "source_port": "transfer",
  "source_channel": "<Channel ID on the Babylon Mainnet>",
  "token": {
    "denom": "uinit",
    "amount": "<Amount of tokens to be transferred>"
  },
  "sender": "<Babylon address of the user sending the tokens>",
  "receiver": "<MilkyWay address of the user receiving the tokens>",
  "timeout_height": {
    "revision_number": "<Revision number>",
    "revision_height": "<Revision height>"
  },
  "timeout_timestamp": "<Timeout timestamp>",
  "memo": ""
}

Please note that the amount of tokens to be transferred is represented in uinit. This means that if you want to transfer 1 BABY token, you need to specify 1000000 (1 BABY = 1,000,000 uinit).

To know about the source channel to use, please refer to this page.

To know more about the timeout_height and timeout_timestamp fields, please refer the IBC Transfer module specifications.

Liquid staking BABY tokens

To liquid stake your BABY tokens, you first have to transfer such tokens from the Initia chain to the MilkyWay chain where the StakeIBC module is present. To do this, you can reference this section, which highlights the message and command you can use.

Once you have transferred your tokens from the Babylon chain to the MilkyWay chain using IBC, you can use the following message to liquid stake those tokens:

{
  "@type": "/stride.stakeibc.MsgLiquidStake",
  "creator": "<Address of the user>",
  "amount": "<Amount of uinit to be liquid staked (e.g. 1000000)>",
  "host_denom": "uinit"
}

Please note that the amount of tokens to be liquid staked must be in terms of uinit. This means that if you want to liquid stake 1 BABY, you will have to specify 1000000 as the amount value.

You can create, sign and send a transaction with such message using the following command:

milkywayd tx stakeibc liquid-stake <amount> uinit --from <your_key>

To know about the node address and chain id required to run this command, please reference this page.

Liquid unstaking (redeeming) milkBABY tokens

If you want to liquid unstake some milkBABY tokens and receive back the associated BABY tokens, you can use the following message:

{
  "@type": "/stride.stakeibc.MsgRedeemStake",
  "creator": "<MilkyWay address of the user redeeming their milkBABY tokens>",
  "amount": "<Amount of milkBABY to redeem>",
  "host_zone": "<ID of the Babylon chain zone>",
  "receiver": "<Babylon address of the user that will receive the unstaked BABY tokens>"
}

Please note that the amount of tokens to be liquid unstaked needs to be provided as milkubaby. This means that if you want to redeem 1 milkBABY, you will need to specify 1000000 as the amount (1 milkBABY = 1,000,000 milkubaby).

If you want to know more about the id of Babylon chains that you can use, please refer to this page.

Differently from the liquid staking operation, where the user receives the milkBABY tokens as soon as they liquid stake some BABY tokens, the liquid staking operation requires some time before the user can receive the unstaked BABY tokens back after unstaking their milkBABY tokens. This because since the underlying tokens are staked on the Babylon chain, they will need to wait the unbonding period to be over before those tokens are automatically sent to them. You can view the unbonding time of Babylon chain on their docs.

Transferring milkBABY tokens from MilkyWay to other blockchains.

If you want to transfer some milkBABY tokens from the MilkyWay chain to another blockchain, we suggest you doing so using the IBC Transfer module, and in particular by using the packet forward milldeware.

To transfer the milkBABY tokens to your chain, you can use the following message:

{
  "@type": "/ibc.applications.transfer.v1.MsgTransfer",
  "source_port": "transfer",
  "source_channel": "<MilkyWay to Other Chain Channel ID>",
  "token": {
    "denom": "milkubaby",
    "amount": "<Amount of milkubaby to be transferred>"
  },
  "sender": "<MilkyWay address of the user sending the tokens>",
  "receiver": "<Address of the user receiving the tokens>",
  "timeout_height": {
    "revision_number": "<Revision number>",
    "revision_height": "<Revision height>"
  },
  "timeout_timestamp": "<Timeout timestamp>",
  "memo": "{\"forward\": {\"receiver\": \"<Address of the recipient>\", \"port\": \"transfer\", \"channel\": \"<Transfer channel from MilkyWay to another blockchain>\"}}"
}

Please note that the amount of tokens to be transferred is represented in milkubaby. This means that if you want to transfer 1 milkBABY token, you need to specify 1000000 (1 milkBABY = 1,000,000 milkubaby).

To know about the source channel to use, please refer to this page.

To know more about the timeout_height and timeout_timestamp fields, please refer the IBC Transfer module specifications.

Make sure you understand the meaning of the memo field, and how it can be used to leverage the packet forwarding middleware properly.

PreviousIntegrating with milkBABYNextChains specifications

Last updated 1 month ago

Note

ℹ️