# IBC Protocol

Considering users want to transfer their assets and data between execution chains in a safe, simple, affordable, and timely way, let’s imagine another multi-chain topology where all execution chains are directly connected and are also connected with every legitimate settlement chain. Moreover, all connections between blockchains are trustless — based on light client verification or its ZKP equivalents.&#x20;

Surprisingly, this describes a landscape that Cosmos had envisioned for years with its [IBC protocol](https://cosmos.network/ibc/).

<figure><img src="https://2449931268-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4wpeVeIMUl16M4FunVKI%2Fuploads%2FhZwU7Sm8PjGb4oNrU6Xq%2FOmnity-04.png?alt=media&#x26;token=a5b4ef02-53a0-4c62-9ba7-e4b5e2a94318" alt="" width="563"><figcaption></figcaption></figure>

However, dark clouds still hover, albeit replaced by a different set.&#x20;

* _<mark style="color:blue;">After token A has been transferred from S to E1, can it be transferred to E2?</mark>_&#x20;

The answer should be a firm “Yes.” Else, the connection between E1 and E2 is useless.&#x20;

* _<mark style="color:blue;">But when token A arrives in E2, is it the same, aka fungible, as its kind, which was transferred directly from S to E2?</mark>_

The answer from IBC is “No” because different paths carry different risks. In other words, the probability of the token losing its redemption rights for the original asset on the settlement chain varies.

The answer from IBC is “No” because different paths carry different risks. In other words, the probability of the token losing its redemption rights for the original asset on the settlement chain varies.

<figure><img src="https://2449931268-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4wpeVeIMUl16M4FunVKI%2Fuploads%2F8jjUiqco6pneMxZEIn0m%2FOmnity-05.png?alt=media&#x26;token=8a7d5665-d649-4953-bde7-79390848966c" alt="" width="563"><figcaption></figcaption></figure>

Fungibility loss leads to liquidity fragmentation and user confusion.&#x20;

To address these issues, IBC is working on a so-called ['unwinding](https://github.com/cosmos/ibc/discussions/824)' feature, whereby token A doesn't directly transfer from E1 to E2 but goes back to S and then to E2 — the whole process is transparent to the user.&#x20;

However, even with the full implementation of unwinding, users still have to bear the high gas costs of the settlement chain and significant delays.&#x20;

* <mark style="color:blue;">Taking a step back, what would happen if tokens remained fungible when reaching an execution chain via different paths?</mark>&#x20;

A disaster. A hacker could take down one execution chain, most likely the weakest one, flood other chains with fake tokens (since they are all connected directly, and accept tokens from the hacked chain). Liquidity on all execution chains, plus tokens locked on settlement chains, would all be exploited at once.

* <mark style="color:blue;">Is there a way to balance security, token fungibility (for preventing liquidity fragmentation and user confusion), cost, and delay?</mark>&#x20;

Yes! And guess what? IBC once had an opportunity to achieve all of these.

<figure><img src="https://2449931268-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4wpeVeIMUl16M4FunVKI%2Fuploads%2FxP8YjXhYmF15sGPrPNGs%2FOmnity-06.png?alt=media&#x26;token=698062c9-74af-4500-b1f3-ee475b757f06" alt="" width="563"><figcaption></figcaption></figure>

If a hub were imposed between all chains, it could keep a global ledger of how many tokens have been transferred to an execution chain. In this case, tokens remain fungible on all execution chains, while attacking losses are limited to the assets users explicitly choose to store on the hacked chain.&#x20;

Logical connections (dashed lines) can be established between any two execution chains, provided they have physical connections (solid lines) with the hub. As long as the Hub is fast enough and cheap enough, it can be kept invisible to users by utilizing multi-hop IBC packets.

However, this system still has three weak points: relayers, hub, and peg zones.&#x20;

<figure><img src="https://2449931268-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4wpeVeIMUl16M4FunVKI%2Fuploads%2FsJKCY0ohbdFha9mVBOiG%2FOmnity-07.png?alt=media&#x26;token=34092de6-306c-407d-b31a-3b1d42a94214" alt="" width="563"><figcaption></figcaption></figure>
