Example Scenarios
Successful Transfer forwarding through chain B
Memo for simple forward
- The packet-forward-middleware integrated on Chain B.
- The packet data
receiverfor theMsgTransferon Chain A is set to"pfm"or some other invalid bech32 string.* - The packet
memois included inMsgTransferby user on Chain A.
Error on Forwarding Hop, Refund to A
Forwarding with Retry and Timeout Logic
Multi-hop Transfer A → B → C → D (full success)
Multi-hop Transfer A → B → C → D (error at D, refund to A)
A -> B -> C full success
AThis sends packet over underlying ICS-004 wrapper with memo as is.BThis receives packet and parses it into ICS-020 packet.BValidatesforwardpacket on this step, returnACKerror if fails.BIf other middleware not yet called ICS-020, call it and ACK error on fail. Tokens minted or unescrowed here.BHandle denom. If denom prefix matches the source chain’s (counterparty, A’s) port/channel, remove it (path-unwind). If not — addB’s port/channel as prefix.BCreate new ICS-004 packet with timeout from forward for next step, and remaining innermemo.BSend transfer toCwith parameters obtained frommemo. Tokens burnt or escrowed here.BStore trackingin flight packetunder next(channel, port, ICS-20 transfer sequence), do notACKpacket yet.CHandle ICS-020 packet as usual.BOn ICS-020 ACK fromCfindin flight packet, delete it and writeACKfor original packet fromA.AHandle ICS-020ACKas usual
A -> B -> C with C error ACK
BOn ICS-020 errorACKfromC, find thein flight packetand delete it.Breverses the tokens it moved when forwarding, refunding them towardA.Bwrites an errorACKfor the original packet fromA.Ahandles the errorACK(a refund) as usual.
C
A packet timeouts on B before C timeouts packet from B
ACannot timeout becausein flight packethas proof onBof packet inclusion.Bwaits for ACK or timeout fromC.Btimeout fromCbecomes failACKonBforAAreceives 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
receiverfor theMsgTransferon Chain A is set to"pfm"or some other invalid bech32 string. - The forward metadata
receiverfor the hop from Chain B to Chain C is set to"pfm"or some other invalid bech32 string. - The packet
memois included inMsgTransferby user on Chain A. - A packet timeout of 10 minutes and 2 retries is set for both forwards.
next is the memo to pass to the next transfer hop. Provide it either as a nested JSON object or as an escaped JSON string; PFM accepts both forms and re-serializes the value for the next hop.
next as JSON
next as escaped JSON string