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 Initia to MilkyWay
  • Liquid staking INIT tokens
  • Liquid unstaking (redeeming) milkINIT tokens
  • Transferring milkINIT tokens from MilkyWay to another Minitia
  1. User Guides
  2. For Liquid Stakers
  3. For Initia (milkINIT)
  4. Integrating with milkINIT

Liquid staking module specifications

PreviousIntegrating with milkINITNextChains specifications

Last updated 10 months ago

Our milkINIT 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 , the Layer 1 chain on top of which our optimistic rollup (MilkyWay) runs.

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

Transferring your tokens from Initia to MilkyWay

Before liquid staking your tokens, you need to transfer the INIT tokens you want to liquid stake from the Inita chain to the MilkyWay chain. To do this, you can use the module present inside both Initia and MilkyWay chain.

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

{
  "@type": "/ibc.applications.transfer.v1.MsgTransfer",
  "source_port": "transfer",
  "source_channel": "<Channel ID on the Initia testnet>",
  "token": {
    "denom": "uinit",
    "amount": "<Amount of tokens to be transferred>"
  },
  "sender": "<Initia 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 INIT token, you need to specify 1000000 (1 INIT = 1,000,000 uinit).

Liquid staking INIT tokens

Once you have transferred your tokens from the Initia 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 INIT, 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) milkINIT tokens

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

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

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

Transferring milkINIT tokens from MilkyWay to another Minitia

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

{
  "@type": "/ibc.applications.transfer.v1.MsgTransfer",
  "source_port": "transfer",
  "source_channel": "<MilkyWay to Initia Channel ID>",
  "token": {
    "denom": "milkuinit",
    "amount": "<Amount of milkuinit 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 on your Minitia>\", \"port\": \"transfer\", \"channel\": \"<Transfer channel from Initia to your Minitia>\"}}"
}

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

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 INIT 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 Initia chains that you can use, please refer to .

Note

Differently from the liquid staking operation, where the user receives the milkINIT tokens as soon as they liquid stake some INIT tokens, the liquid staking operation requires some time before the user can receive the unstaked INIT tokens back after unstaking their milkINIT tokens. This because since the underlying tokens are staked on the Initia 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 each Initia chain .

If you want to transfer some milkINIT tokens from the MilkyWay chain to another Minitia, we suggest you doing so using the , and in particular by using the . Since all Minitias are connected to the Initia chain, you can take advantage of this by avoiding to setup a channel directly between the MilkyWay chain and your Minitia. Instead, using such middleware, the tokens will be routed to your chain passing by the Initia chain itself, decreasing the number of channels that need to be opened and maintained.

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
Initia
IBC Transfer
this page
IBC Transfer module specifications
this page
this page
here
IBC Transfer module
packet forward milldeware
this page
IBC Transfer module specifications
this section