MilkyWay Docs
  • INTRODUCTION
    • Welcome to MilkyWay
    • Mission and Vision
    • MILK
      • Tokenomics
    • Whitepaper (PDF)
  • User Guides
    • For Liquid Stakers
      • Quick Start
      • For 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
        • Using third party apps
          • Camelot
          • Demex
          • Dymension
          • Levana
          • Margined
          • Mars
          • Osmosis
          • UX
      • For 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
      • For Bablyon (milkBABY)
        • Technical Architecture
          • Liquid Staking Process
          • Withdrawal Process
          • Exchange Rate
          • Compound Staking Rewards
          • Claim Process
          • Limits and Restrictions
        • User Flow
        • One-Click Stake
        • Integrating with milkBABY
          • Liquid staking module specifications
          • Chains specifications
    • For Restakers
      • Quick Start
      • For Restakers
        • Creating a wallet
        • Restaking your assets
    • Bridging
      • Hyperlane
      • IBC Eureka
  • Infrastructure Operators
    • For MilkyWay Validators
      • Quick Start
      • For Validators
        • Consesus node
        • Validator node
    • For Service Operators
      • Quick Start
      • For Operators
        • Operator Management
        • Opt-in and Opt-out Services
  • For Service Developers
    • Quick Start
    • For Services Admins
      • Service Management
      • Inviting Operators to Join Your Service
      • Creating Rewards Distribution Plan
  • Architecture
    • Modular Liquid Staking
      • Overview
      • Liquid Staking 101
    • 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
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. User Guides
  2. For Liquid Stakers
  3. For Bablyon (milkBABY)
  4. Integrating with milkBABY

Liquid staking module specifications

PreviousIntegrating with milkBABYNextChains specifications

Last updated 16 days ago

Our milkBABY implementation is based on the work that the Stride team has put together inside their . 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 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).

Liquid staking BABY tokens

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>

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).

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.

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).

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

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

To know more about the timeout_height and timeout_timestamp fields, please refer the .

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 , which highlights the message and command you can use.

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

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

Note

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

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

To know more about the timeout_height and timeout_timestamp fields, please refer the .

ℹ️
StakeIBC module
IBC Transfer
this page
IBC Transfer module specifications
this page
this page
IBC Transfer module
packet forward milldeware
this page
IBC Transfer module specifications
this section