From 30aa861438ef68d9b6ea93806a046a45eeb37e7d Mon Sep 17 00:00:00 2001 From: Susannah Evans <65018876+womensrights@users.noreply.github.com> Date: Wed, 7 Aug 2024 17:35:45 +0200 Subject: [PATCH 1/3] docs: Path unwinding and forwarding requirements (#6027) * Create path-unwinding-requirements.md * Unwinding forwarding requirements * Update path-unwinding-forwarding -requirements.md * fix linter and remove commented guide * fix eof violation * formatting nits * Update path-unwinding-forwarding -requirements.md * Create path-unwinding-forwarding-requirements.md * Update path-unwinding-forwarding-requirements.md * Update path-unwinding-forwarding-requirements.md * Update docs/requirements/path-unwinding-forwarding-requirements.md Co-authored-by: Damian Nolan --------- Co-authored-by: Carlos Rodriguez Co-authored-by: Damian Nolan --- .../path-unwinding-forwarding-requirements.md | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 docs/requirements/path-unwinding-forwarding-requirements.md diff --git a/docs/requirements/path-unwinding-forwarding-requirements.md b/docs/requirements/path-unwinding-forwarding-requirements.md new file mode 100644 index 00000000000..1c0c7a447a7 --- /dev/null +++ b/docs/requirements/path-unwinding-forwarding-requirements.md @@ -0,0 +1,99 @@ + + +# Business requirements + +The implementation of fungible token path unwinding vastly simplifies token transfers for end users. End users are unlikely to understand IBC denominations in great detail, and the consequences a direct transfer from chain A, to chain B can have on the fungibility of a token at the destination chain B, when the token sent is not a native or originating token from chain A, and is native to another chain, e.g. chain C. + +Path unwinding reduces the complexity of token transfer for the end user; a user simply needs to choose the final destination for their tokens and the complexity of determining the optimal route is abstracted away. This is a huge user experience improvement. + +In addition to unwinding, when a user recieves their token on a destination chain, they then want to use the token in some way. By enabling token forwarding, a user can recieve a token, perform some action with that token, for example a swap, and then send the token onto another chain. We observe that the complexity of IBC is increasingly being abstracted away from end users and automating workflows such as transfer, swap and forward with a single signed transaction significantly enhances usability. + +## Problem + +A fungible token A transferred from chain A to chain B is an IBC denomination at chain B, where the IBC denom trace records the path the token has travelled to reach its destination chain. + +A user now wants to send this IBC denomination of token A, originating from chain A, onto another chain, chain C. If a user transfers token A on chain B directly to chain C, it will not be fungible with token A sent directly from chain A to chain C. This is because the IBC denomination of token A on chain C is different in both cases due to token A travelling along different paths to reach the same destination. This is the most simple case of the problem involving only 3 chains. + +However, this problem is prevalent within the ecosystem and there are cases of IBC denominations on chains with >2 hops in the path. + +Regarding forwarding, if a user wants to transfer tokens between chains, then perform an action with those tokens, without forwarding, a user would have to sign each transaction on every chain and wait for the tokens to arrive at the destination before performing the next action. This is time consuming and a provides a poor user experience, a user also cannot just specify the desired outcome of their workflow in a trivial way. + +## Objectives + +To enable end users to automatically and atomically unwind fungible tokens when they specify a destination chain, so that tokens arrive at the destination chain with only 1 hop in the path and to be able to forward the token to another destination after it has been unwound. + +## Scope + +| Features | Release | +| --------- | ------- | +| Automatic and atomic path unwinding for fungible tokens suitable for end users initiating a transfer | v9.0.0 | +| Token forwarding for fungible tokens for end users initiating a transfer | v9.0.0 | + +# User requirements + +## Use cases + +### 1. Moving non-native assets between DeFi opportunities on different chains + +Users transfer tokens from an origin chain to a DeFi chain to benefit from yield opportunities or other use cases on that chain, different from the origin chain. A better yield opportunity could then arise and a user would want to move the tokens to another chain to take advantage of this opportunity. Rather than having to manually route the tokens back through the originating chain onto the new chain, it would be much simpler if they could only be concerned with the final destination they want the tokens to arrive at. + +For example, ATOM is native to the Cosmos Hub, a user could transfer ATOM to Osmosis and deposit in a liquidity pool to earn yield on this token. After depositing their ATOM into a pool on Osmosis, a better yield opportunity could arise, for example a better pool APY on another Cosmos DEX, e.g. Crescent or a better yield on lending ATOM on Umee. The user would then want to transfer the ATOM from Osmosis to Crescent (or Umee). + +### 2. Transferring liquid staking derivatives + +Liquid staking derivatives are minted on liquid staking zones and represent a staked asset. There is a common misconception from users that these derivatives originate on the chain of the original staked token. This results in users sending derivatives back to the chain of the natively staked token and then onto the next destination. + +For examples, a user has stATOM on Osmosis, they want to move the stATOM to Evmos, instead of going from Osmosis --> Stride --> Evmos, a user tries to unwind themself and routes the tokens Osmosis --> Cosmos Hub --> Evmos. + +### 3. Moving a token that originated from an interoperability zone or chain, or asset issuer + +Tokens that originate from other blockchain ecosystems that don't yet support IBC, flow into the Cosmos ecosystem through interoperability zones. These tokens are then sent onto other chains with a specific use case for these tokens and a user could want to move this token from one chain to another. + +For example, ETH from Ethereum flows into Osmosis via Axelar, where the final step moving ETH from Ethereum to Osmosis uses an ICS-20 transfer from Axelar to Osmosis. A user may then want to move ETH from Osmosis onto another chain, for example Injective. However, the path with 1 hop would be a transfer from Axelar to Injective. + +### 4. Moving a token from one chain to another, swapping the token and transferring it onwards to a new destination + +A user on one chain, for example the Cosmos Hub holds an asset, e.g. ATOM and wants to instead have AKT on Akash. The user must transfer to ATOM to a DEX chain, swap the ATOM for AKT and then send the AKT onwards to Akash. + +# Functional requirements + +## Assumptions and dependencies + +1. A functional relayer implementation is required for this feature. +2. Routing information for the final hop for unwinding or for forwarding is configured for the user through a front end client, or configured by another means using off-chain data. +3. The feature will have no impact on the existing function of a typical ICS-20 transfer where a native token is sent to another chain. +4. Fees are not within the scope of these requirements. +5. The functionality to enable a specific action before forwarding is not in scope of these requirements. +6. If a transfer contains multiple unique tokens, the unwinding and forwarding functionalities only need to support unwinding or forwarding through the same path, i.e. if there is a transfer containing a native token and 1 hop denom being sent from source to destination, both tokens would always go through the same path. In the future, it may be desirable for different tokens to be unwound through different paths, to support actions such as atomic transfer and supply liquidity to a liquidity pool, but it is currently out of scope for the first version of this feature. + +## Features + +| ID | Description | Verification | Status | +| -- | ----------- | ------------ | ------ | +| 1.01 | When a user initiates a transfer to a destination chain with an IBC denom with > 1 hop, the token shall be sent back to its originating chain before being sent onto the destination as a user selected option | | `Draft` | +| 1.02 | If a user wants to unwind tokens, then they can select this as option for the transfer | | `Draft` | +| 1.03 | The unwinding shall completely succeed or the tokens are recoverable on the chain they were sent from by the user | | `Draft` | +| 1.04 | When unwinding is used in combination with forwarding, both the unwind and forwarding should succeed or the tokens should be recoverable on the sending chain | | `Draft` | +| 1.05 | The forwarding mechanism shall allow a user to transfer tokens beyond the first destination for those tokens | | `Draft` | +| 1.06 | The forwarding mechanism shall allow tokens to have some action performed on them before being sent onto a new destination | | `Draft` | +| 1.07 | The routing information for forwarding or to go from unwound token to destination must be input with the initial transfer | | `Draft` | +| 1.08 | If an intermediate chain does not have the unwinding or forwarding functionality, the tokens must be recoverable on the sending chain | | `Draft` | +| 1.09 | If unwinding or forwarding fails, then the reason for the failure should be returned in an error | | `Draft` | +| 1.10 | When unwinding, it should be possible for the forwarding path to be evaluated implicitly from introspecting the denomination trace or to be explicitly input as forwarding hops by the user | | `Draft` | +| 1.11 | When using unwinding in combination with x/authz, a granter can specify the allowed forwarding paths | | `Draft` | + +# External interface requirements + +| ID | Description | Verification | Status | +| -- | ----------- | ------------ | ------ | +| 2.01 | There must be a CLI interface to initiate a transfer using path unwinding | | `Draft` | +| 2.02 | There must be a CLI interface to initiate a transfer using forwarding | | `Draft` | +| 2.03 | There must be a CLI interface to initiate a transfer using unwinding and forwarding in combination | | `Draft` | + +# Non-functional requirements + +## Security + +| ID | Description | Verification | Status | +| -- | ----------- | ------------ | ------ | +| 3.01 | It must not be possible for a users tokens to be intercepted by another actor during path-unwinding or token forwarding | | `Draft` | From 8edab387094c58fe2b3438a2a260390687683dfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?colin=20axn=C3=A9r?= <25233464+colin-axner@users.noreply.github.com> Date: Wed, 7 Aug 2024 17:56:00 +0200 Subject: [PATCH 2/3] chore: setup new major release cycle docs/workflow (#7054) * chore: setup new major release cycle * Update docs/docs/05-migrations/14-v9-to-v10.md --- CHANGELOG.md | 14 +++++++++++++ docs/docs/05-migrations/14-v9-to-v10.md | 28 +++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 docs/docs/05-migrations/14-v9-to-v10.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 249a4dd8730..6a75108ce43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,20 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Dependencies +### API Breaking + +### State Machine Breaking + +### Improvements + +### Features + +### Bug Fixes + +## v9.0.0 (unreleased) + +### Dependencies + * [\#6828](https://github.com/cosmos/ibc-go/pull/6828) Bump Cosmos SDK to v0.50.9. * [\#6193](https://github.com/cosmos/ibc-go/pull/6193) Bump `cosmossdk.io/store` to v1.1.0. * [\#6848](https://github.com/cosmos/ibc-go/pull/6848) Bump CometBFT to v0.38.10. diff --git a/docs/docs/05-migrations/14-v9-to-v10.md b/docs/docs/05-migrations/14-v9-to-v10.md new file mode 100644 index 00000000000..5cbe3610be4 --- /dev/null +++ b/docs/docs/05-migrations/14-v9-to-v10.md @@ -0,0 +1,28 @@ +# Migrating from v9 to v10 + +This guide provides instructions for migrating to a new version of ibc-go. + +There are four sections based on the four potential user groups of this document: + +- [Chains](#chains) +- [IBC Apps](#ibc-apps) +- [Relayers](#relayers) +- [IBC Light Clients](#ibc-light-clients) + +**Note:** ibc-go supports golang semantic versioning and therefore all imports must be updated on major version releases. + +## Chains + +- No relevant changes were made in this release. + +## IBC Apps + +- No relevant changes were made in this release. + +## Relayers + +- No relevant changes were made in this release. + +## IBC Light Clients + +- No relevant changes were made in this release. From beaf8bc8cea09335190deda3c557944e31400f38 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 8 Aug 2024 11:29:26 +0300 Subject: [PATCH 3/3] chore(deps): bump cosmossdk.io/client/v2 in /simapp (#7085) Bumps [cosmossdk.io/client/v2](https://github.com/cosmos/cosmos-sdk) from 2.0.0-beta.3 to 2.0.0-beta.4. - [Release notes](https://github.com/cosmos/cosmos-sdk/releases) - [Changelog](https://github.com/cosmos/cosmos-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/cosmos/cosmos-sdk/compare/client/v2.0.0-beta.3...client/v2.0.0-beta.4) --- updated-dependencies: - dependency-name: cosmossdk.io/client/v2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- simapp/go.mod | 2 +- simapp/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/simapp/go.mod b/simapp/go.mod index 8d1239116cd..a6a635a709e 100644 --- a/simapp/go.mod +++ b/simapp/go.mod @@ -11,7 +11,7 @@ replace ( require ( cosmossdk.io/api v0.7.5 - cosmossdk.io/client/v2 v2.0.0-beta.3 + cosmossdk.io/client/v2 v2.0.0-beta.4 cosmossdk.io/core v0.11.1 cosmossdk.io/log v1.4.0 cosmossdk.io/store v1.1.0 diff --git a/simapp/go.sum b/simapp/go.sum index b1c362821aa..b7a4d913067 100644 --- a/simapp/go.sum +++ b/simapp/go.sum @@ -188,8 +188,8 @@ cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1V cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= cosmossdk.io/api v0.7.5 h1:eMPTReoNmGUm8DeiQL9DyM8sYDjEhWzL1+nLbI9DqtQ= cosmossdk.io/api v0.7.5/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= -cosmossdk.io/client/v2 v2.0.0-beta.3 h1:+TTuH0DwQYsUq2JFAl3fDZzKq5gQG7nt3dAattkjFDU= -cosmossdk.io/client/v2 v2.0.0-beta.3/go.mod h1:CZcL41HpJPOOayTCO28j8weNBQprG+SRiKX39votypo= +cosmossdk.io/client/v2 v2.0.0-beta.4 h1:LGIzWbVTOof/IHQZeoWwxPX0fq607ONXhsfA7eUrQIg= +cosmossdk.io/client/v2 v2.0.0-beta.4/go.mod h1:c753d0sBv3AQRx6X+BOKL1aGpKjZMTZAHGiLPbVi5TE= cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= cosmossdk.io/core v0.11.1 h1:h9WfBey7NAiFfIcUhDVNS503I2P2HdZLebJlUIs8LPA=