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

Feature Request: IBC transfers of the entire balance of a particular denomination. #6567

Closed
3 tasks
srdtrk opened this issue Jun 11, 2024 · 1 comment · Fixed by #6877
Closed
3 tasks

Feature Request: IBC transfers of the entire balance of a particular denomination. #6567

srdtrk opened this issue Jun 11, 2024 · 1 comment · Fixed by #6877
Assignees
Labels
20-transfer needs discussion Issues that need discussion before they can be worked on nice-to-have type: feature New features, sub-features or integrations
Milestone

Comments

@srdtrk
Copy link
Member

srdtrk commented Jun 11, 2024

Summary

Enhance the UX of interchain workflows by enabling IBC transfers of the entire balance of a particular denomination.

Problem Definition

Consider two chains, Chain A and Chain B. Chain B has a DEX, while Chain A has an ICA controller. If an ICA user on Chain A wants to:

  1. Transfer coins from Chain A to Chain B
  2. Swap the transferred tokens on Chain B using the DEX
  3. Transfer the resulting tokens back to Chain A

Currently, each step of this workflow requires a new IBC packet. We aim to streamline this process by combining steps 2 and 3 into a single ICA packet. Though it may seem feasible to construct an ICA transaction that includes both SwapMsg and MsgTransfer together, in practice, slippage considerations during the swap complicate this. This makes it impossible to determine the exact amount to be transferred at the time of constructing the ICA transaction.

By introducing a CosmosSDK message that allows transferring all coins of a particular denomination, we can effectively combine steps 2 and 3 into a single packet.

This workflow has caused headaches for multiple users.

Use cases

  • Improved ICA workflows
  • Reduced need for ICQ by smart contracts in similar workflows

Proposal

This feature would require modifications only to the transfer message server, not the transfer packet itself. Below are two proposed implementations, though we welcome alternative approaches:

MsgTransferAll

Introduce a new MsgTransferAll to facilitate transfers:

message MsgTransferAll {
  option (cosmos.msg.v1.signer) = "sender";

  option (gogoproto.goproto_getters) = false;

  // the port on which the packet will be sent
  string source_port = 1;
  // the channel by which the packet will be sent
  string source_channel = 2;
  // the sender address
  string sender = 3;
  // the recipient address on the destination chain
  string receiver = 4;
  // Timeout timestamp in absolute nanoseconds since unix epoch.
  // The timeout is disabled when set to 0.
  uint64 timeout_timestamp = 5;
  // optional memo
  string memo = 6;
  // denoms to be transferred
  repeated string denoms = 7 [(gogoproto.nullable) = false];
}

Set amount to UnboundedSpendLimit

Alternatively, we could continue using MsgTransfer. If any amount for any denomination is set to UnboundedSpendLimit(), the sender's entire balance for that denomination will be used.


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged/assigned
@srdtrk srdtrk added 20-transfer needs discussion Issues that need discussion before they can be worked on nice-to-have labels Jun 11, 2024
@crodriguezvega crodriguezvega added the type: feature New features, sub-features or integrations label Jun 12, 2024
@womensrights
Copy link
Contributor

This feature was requested by Timewave and Nomos. Timewave would benefit from having the feature live on Cosmos Hub, Osmosis, Stride, Persistence and Celestia. As of 9/7/24 the version those chains are on:

  • Cosmos Hub 7.6.0
  • Osmosis 7.4.1, with 8.3.2 in main
  • Stride 7.4.0
  • Persistence 7.4.0
  • Celestia 6.2.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
20-transfer needs discussion Issues that need discussion before they can be worked on nice-to-have type: feature New features, sub-features or integrations
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants