Replies: 2 comments 3 replies
-
is it required to do this in a go module, or is it possible to do it in a cosmwasm contract? |
Beta Was this translation helpful? Give feedback.
3 replies
-
We reimplemented ibc instead. Lol |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Introduction
We need to do packet forwarding to enable seemless IBC connection between Ethereum and the Cosmos chains. Since there isn't any built-in multihop mechanism exist in the IBC protocol yet, we need to create a custom protocol on top of IBC to enable this functionality.
Design
This protocol is planned to be built as an IBC Middleware because this mechanism provides the lowest level access to the IBC protocol stack. And it's better to handle packet forwarding at the routing phase instead of handling it at the app level.
Our end goal is to be able to forward any IBC packet which means this protocol shouldn't be specific to any use case or apps such as
ics20
orucs01
.IBC Middleware
How it works?
IBC middlewares have the ability to hook into the IBC module callbacks such as
OnChanOpenInit
,OnRecvPacket
, etc. They implement the same interface as a regular IBC module so they have access to any data that is passed around during an execution. This means that they can alter or save any data they need and then they are expected to pass the execution to the next middleware.The IBC Middleware interface
Our IBC Middleware
Our module will not interfere with the channel opening or closing mechanisms so it will just pass the execution to the next layer.
Eg.
When it receives a packet, it will try to parse the data to figure out if the middleware is targeted or not. The data type will be opaque over the underlying data and it will contain the necessary information to forward the packet.
Here is the definition of the middleware's packet.
Receiving a packet
Getting an acknowledgement
Beta Was this translation helpful? Give feedback.
All reactions