Understand and calculate XMTP fees
Use this guide to understand XMTP fees and how to calculate estimated XMTP fees for an app or agent.
Understand XMTP fees
To support a decentralized and sustainable network, XMTP operates on a usage-based fee model. The fees paid by apps and agents (payers) directly compensate the independent node operators who run the infrastructure, ensuring the network remains resilient, secure, and censorship-resistant.
Fee types
To understand XMTP fee types, it's helpful to understand XMTP's architecture, which uses a two-layer system:
- XMTP Broadcast Network (offchain): A globally distributed network of nodes responsible for securely routing and delivering encrypted messages between users.
- XMTP App Chain (onchain): A specialized blockchain that stores critical metadata, such as user identities, contacts, and group permissions. This onchain layer is essential for decentralized identity and ensuring that only the appropriate users can access conversations.
Messaging fees
Messages sent through the XMTP Broadcast Network incur these types of messaging fees:
- Base fee: A flat per-message fee charged at a single global rate, not a rate per app or sender.
- Storage fee: A fee charged per-byte-day of storage required.
- Congestion fee: A dynamic fee computed by looking at the recent activity of an originator. Added only during periods of high network activity.
The fee rates for the base fee, storage fee, and congestion fee are denominated in dollars and stored as constants in a smart contract. These rates are set and adjusted through protocol governance and remain constant for a specified period of time.
Every message an app or agent sends through the XMTP Broadcast Network counts against its message allowance. These message types include:
- App messages (text, reactions, replies)
- Media attachments (charged by size, with a 1 MB cap). To send larger files and reduce fees, use a remote attachment to point to off-network storage (for example, IPFS or S3).
- System messages (read receipts, typing indicators)
To learn more, see Envelope types.
Collected messaging fees are paid directly to the node operators who run the globally distributed nodes that power the XMTP Broadcast Network.
Messaging fee payment flow
This sequence diagram illustrates the messaging fee payment flow from payers to independent node operators using a series of smart contracts.
Gas fees
Certain administrative operations involve transactions on the XMTP App Chain:
- Group management updated (member additions, permission changes)
- Identity updates
- Payer-related updates
To pay for these transactions, apps and agents need to maintain a gas reserve balance on the XMTP App Chain. The Funding Portal automatically manages funding this gas reserve for apps and agents based on their expected message volume.
Collected gas fees are paid directly to the XMTP App Chain. Fees are used to maintain the App Chain.
Calculate estimated XMTP fees
As a rough estimate, an app or agent can expect to pay about $5 per 100,000 messages ($0.00005/message). This all-in fee for typical usage is based on the following key assumptions:
- A 95/5 split between messaging and gas fees. Meaning, for every $5 in total fees:
- $4.75 is for XMTP Broadcast Network messaging fees
- $0.25 is for XMTP App Chain gas fees
- An average message size of 1 KB (1024 bytes).
- A message retention period of 90 days.
- Normal network conditions (no congestion fees).
Your actual costs may vary depending on your app's specific usage patterns. For example, sending smaller messages or using a shorter retention period will result in lower messaging fees.
All pricing is onchain and fully auditable. For the most accurate estimates based on your specific usage, the XMTP Funding Portal provides a detailed breakdown of messaging fees, gas fees, and your historical and projected spend.
Calculate estimated messaging fees
The total messaging fee for a single message is the sum of its component fees:
total messaging fee = base fee + storage fee + congestion fee
The storage fee is calculated as follows:
storage fee = rate × message size in bytes × message retention in days
For example, a 1 KB text message stored for 90 days on the XMTP Broadcast Network would incur a messaging fee calculated as:
total messaging fee = base fee + (storage rate × 1024 bytes × 90 days) + congestion fee
The congestion fee is applied only during periods of high network activity to manage load.
Calculate estimated gas fees
Gas fees for transactions on the XMTP App Chain are calculated as follows:
gas fee = fee per unit of gas × amount of gas consumed by a transaction
This often works out to fractions of a US cent.
The fee per unit of gas is set by the XMTP App Chain based on network activity.
The total amount of gas consumed depends on the size of the transaction.
Fees and network scale
The network is designed for sustainability, not to accumulate profit. Fee revenue is used to cover network operational costs incurred by node operators.
The messaging fee per message is expected to step down as the network achieves and sustains global message volume milestones. For example, at a volume of 1 billion messages per month, revenue is expected to cover operational costs.
The specific schedule for these milestones is managed by protocol governance, with a current effective floor fee target of $5 per 100,000 messages.
While the system is designed for fees to decrease over time, the global messaging fee can rise if network volume drops significantly, ensuring node operator sustainability.