Understand content types with XMTP
When you build an app with XMTP, all messages are encoded with a content type to ensure that an XMTP client knows how to encode and decode messages, ensuring interoperability and consistent display of messages across apps.
In addition, message payloads are transported as a set of bytes. This means that payloads can carry any content type that a client supports, such as plain text, JSON, or even non-text binary or media content.
At a high level, there are two categories of content types with XMTP:
Standard content types
A standard content type is one that has undergone the XMTP Request for Comment (XRC) process and has been adopted as an XMTP Improvement Proposal (XIP).
Once adopted, a standard content type is bundled in XMTP client SDKs. You can then import the standard content type from an SDK for use in your app.
Here are the current standard content types:
- Text content type: An app built with XMTP uses the
TextCodec(plain text) standard content type by default. This means that if your app is sending plain text messages only, you don't need to perform any additional steps related to content types. - Attachment content type: Use to send attachments smaller than 1MB.
- Remote attachment content type: Use to send attachments of any size.
- Multiple remote attachments content type: Use to send attachments of any size.
- Read receipt content type: Use to send a read receipt, which is a
timestampthat indicates when a message was read. - Reaction content type: Use a reaction to send a quick and often emoji-based way to respond to a message.
- Reply content type: Use a reply to send a direct response to a specific message in a conversation. Users can select and reply to a particular message instead of sending a new one.
- Onchain transaction reference content type: Use to send references to onchain transactions, such as crypto payments.
- Onchain transaction content type: Use to support sending transactions to a wallet for execution.

