Example Scenarios
Successful Transfer forwarding through chain B
Memo for simple forward
- The packet-forward-middleware integrated on Chain B.
- The packet data
receiver
for theMsgTransfer
on Chain A is set to"pfm"
or some other invalid bech32 string.* - The packet
memo
is included inMsgTransfer
by user on Chain A.
Error on Forwarding Hop, Refund to A
Forwarding with Retry and Timeout Logic
A -> B -> C full success
A
This sends packet over underlying ICS-004 wrapper with memo as is.B
This receives packet and parses it into ICS-020 packet.B
Validatesforward
packet on this step, returnACK
error if fails.B
If other middleware not yet called ICS-020, call it and ACK error on fail. Tokens minted or unescrowed here.B
Handle denom. If denom prefix is fromB
, remove it. If denom prefix is other chain - addB
prefix.B
Take fee, create new ICS-004 packet with timeout from forward for next step, and remaining innermemo
.B
Send transfer toC
with parameters obtained frommemo
. Tokens burnt or escrowed here.B
Store trackingin flight packet
under next(channel, port, ICS-20 transfer sequence)
, do notACK
packet yet.C
Handle ICS-020 packet as usual.B
On ICS-020 ACK fromC
findin flight packet
, delete it and writeACK
for original packet fromA
.A
Handle ICS-020ACK
as usual
A -> B -> C with C error ACK
B
On ICS-020 ACK fromC
findin flight packet
, delete itB
Burns or escrows tokens.B
And write errorACK
for original packet fromA
.A
Handle ICS-020 timeout as usualC
writes successACK
for packet fromB
C
A packet timeouts on B before C timeouts packet from B
A
Cannot timeout becausein flight packet
has proof onB
of packet inclusion.B
waits for ACK or timeout fromC
.B
timeout fromC
becomes failACK
onB
forA
A
receives success or failACK
, but not timeout
A
assets hang
until final hop timeouts or ACK.
Memo for Retry and Timeout Logic, with Nested Memo (2 forwards)
- The packet-forward-middleware integrated on Chain B and Chain C.
- The packet data
receiver
for theMsgTransfer
on Chain A is set to"pfm"
or some other invalid bech32 string. - The forward metadata
receiver
for the hop from Chain B to Chain C is set to"pfm"
or some other invalid bech32 string. - The packet
memo
is included inMsgTransfer
by user on Chain A. - A packet timeout of 10 minutes and 2 retries is set for both forwards.
next
is the memo
to pass for the next transfer hop. Per memo
intended usage of a JSON string, it should be either JSON which will be Marshaled retaining key order, or an escaped JSON string which will be passed directly.
next
as JSON