Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Hub routing idea #1

Closed
okwme opened this issue Sep 16, 2021 · 1 comment
Closed

Hub routing idea #1

okwme opened this issue Sep 16, 2021 · 1 comment

Comments

@okwme
Copy link
Contributor

okwme commented Sep 16, 2021

Problem

When a multi-hop IBC transfer takes place there's a chance that the second hop fails. If that's the case the tokens are returned to the sending chain. In a multi-hop scenario this is not always the original sending chain. That means that a user has to find which chain their assets landed on, and hope that the chain they landed on was using an address they control. This is part of the multihop design, that users designate an address on each chain that they control in order to remain in control of the funds should the multi-hop transfer fail.

Proposed Solution

Create an escrow module on each chain that is used to hold the tokens and record who the original sender was. When a transfer hop fails it is sent back to this escrow module and correlated to the original sender. In this scenario anyone can execute a "return-to-sender" message, not just the original sender who has to find their stalled transfer. Also this decreases the chance that the original sender accidentally uses an address they don't control (or keeps them from having to create an account they control in the first place).

Sketched solution

  • on initial receipt of IBC transfer
  • parse sender and final destination
  • create an ID of the transfer if the equivalent doesnt' already exist in IBC
  • store the ID with information about amount and original sender and a boolen set to false in a keeper
  • get module based account for escrow tracking
  • create the second hop transfer packet from the escrow tracking module based account
    • if the second hop succeeds delete the transfer ID from the keeper
    • if the second hop fails mark the boolean as true for that ID
  • create a message type that checks whether any transfer ID with boolean true exists (can be targeted or general)
    • this message will create an outgoing IBC transfer back to the original sender and can be executed by anyone (or automatically in endblocker)
@agouin
Copy link
Member

agouin commented Nov 18, 2022

This is resolved by #33 and #36

@agouin agouin closed this as completed Nov 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants