Synopsis
Learn about the different ways to pay for fees, how the fees are paid out and what happens when not enough escrowed fees are available for payoutEscrowing fees
The fee middleware module exposes two different ways to pay fees for relaying IBC packets:-
MsgPayPacketFee
, which enables the escrowing of fees for a packet at the next sequence send and should be combined into oneMultiMsgTx
with the message that will be paid for. Note that theRelayers
field has been set up to allow for an optional whitelist of relayers permitted to receive this fee, however, this feature has not yet been enabled at this time.TheFee
message contained in this synchronous fee payment method configures different fees which will be paid out forMsgRecvPacket
,MsgAcknowledgement
, andMsgTimeout
/MsgTimeoutOnClose
.
MultiMsgTx
with the MsgTransfer
coming from a token transfer message, along with MsgPayPacketFee
.

-
MsgPayPacketFeeAsync
, which enables the asynchronous escrowing of fees for a specified packet: Note that a packet can be ‘topped up’ multiple times with additional fees of any coin denomination by broadcasting multipleMsgPayPacketFeeAsync
messages.where thePacketFee
also specifies theFee
to be paid as well as the refund address for fees which are not paid out
MsgPayPacketFeeAsync
can be broadcasted asynchronously. Escrowing of the fee associated with a packet can be carried out by any party because ICS-29 does not dictate a particular fee payer. In fact, chains can choose to simply not expose this fee payment to end users at all and rely on a different module account or even the community pool as the source of relayer incentives.

Paying out the escrowed fees
Following diagram takes a look at the packet flow for an incentivized token transfer and investigates the several scenario’s for paying out the escrowed fees. We assume that the relayers have registered their counterparty address, detailed in the Fee distribution section.
- In the case of a successful transaction,
RecvFee
will be paid out to the designated counterparty payee address which has been registered on the receiver chain and sent back with theMsgAcknowledgement
,AckFee
will be paid out to the relayer address which has submitted theMsgAcknowledgement
on the sending chain (or the registered payee in case one has been registered for the relayer address), andTimeoutFee
will be reimbursed to the account which escrowed the fee. - In case of a timeout transaction,
RecvFee
andAckFee
will be reimbursed. TheTimeoutFee
will be paid to theTimeout Relayer
(who submits the timeout message to the source chain).
Please note that fee payments are built on the assumption that sender chains are the source of incentives — the chain that sends the packets is the same chain where fee payments will occur — please see the Fee distribution section to understand the flow for registering payee and counterparty payee (fee receiving) addresses.
A locked fee middleware module
The fee middleware module can become locked if the situation arises that the escrow account for the fees does not have sufficient funds to pay out the fees which have been escrowed for each packet. This situation indicates a severe bug. In this case, the fee module will be locked until manual intervention fixes the issue.A locked fee module will simply skip fee logic and continue on to the underlying packet flow. A channel with a locked fee module will temporarily function as a fee disabled channel, and the locking of a fee module will not affect the continued flow of packets over the channel.