Packet Forward Middleware: The Hub as Router
The Cosmos Hub has an identity problem.
In the early vision, the Hub was supposed to be the center of the Interchain—the router that everything connected to. But by 2021, that vision had drifted. Chains connected to each other directly. The Hub was just another zone, distinguished only by being first.
Packet Forward Middleware is an attempt to change that.
The Problem#
IBC is point-to-point. Chain A connects to Chain B. If Chain C wants to talk to both, it needs two connections, two relayers, two sets of infrastructure. Scale that to fifty chains and the connection graph becomes a nightmare.
Every new chain faces the same bootstrapping problem: establish connections to all the chains your users care about, or be an island.
The Hub could solve this. If the Hub connects to everyone, and the Hub can forward packets, new chains only need one connection. Send tokens to the Hub, the Hub routes them to the destination.
The Implementation#
PFM is IBC middleware. It intercepts incoming transfer packets, checks for forwarding instructions in the memo field, and routes accordingly:
{
"forward": {
"receiver": "cosmos1...",
"port": "transfer",
"channel": "channel-141",
"timeout": "10m",
"retries": 2
}
}
The key insight: asynchronous acknowledgements. When a packet arrives for forwarding, PFM doesn’t immediately acknowledge it. It holds the acknowledgement until the forward completes (or fails). This makes multi-hop transfers atomic—either the tokens arrive at the final destination, or they refund all the way back to the sender.
The implementation handles the edge cases: retries on timeout, proper refund flows, fee deduction for the routing service.
Governance Proposal 56#
In September 2021, we submitted Proposal 56 to add PFM to the Hub. The proposal passed, and PFM shipped in the Vega upgrade (Gaia v6.0.0) in December 2021.
The initial fee was set to zero. The point wasn’t revenue—it was adoption. Get chains routing through the Hub first. Economic parameters can come later.
Adoption#
PFM is now running on most major Cosmos chains. The routing vision is partially realized—though the ecosystem evolved differently than expected. Osmosis became a de facto hub for many token flows. Noble became the stablecoin routing layer.
The infrastructure pattern matters more than which chain runs it. Interchain routing is a solved problem.
The Team#
Justin Tieri did the bulk of the implementation work—17 commits spanning the initial build through ICS30 compliance and ibc-go version upgrades. Andrew Gouin contributed the metadata refactoring that made the forward instructions more flexible. Dan Kanefsky helped with project management.
The repo is now archived. Active development moved to cosmos/ibc-apps, where PFM lives as part of the broader IBC applications suite.
The original code lives at github.com/strangelove-ventures/packet-forward-middleware.