diff --git a/XIPs/xip-48-content-type-local-db-integration.md b/XIPs/xip-48-content-type-local-db-integration.md new file mode 100644 index 0000000..f8526a8 --- /dev/null +++ b/XIPs/xip-48-content-type-local-db-integration.md @@ -0,0 +1,63 @@ +--- +xip: 48 +title: Queryable Content Types in Rust +description: This XIP proposes a new way of managing content types in XMTP in order to make complex content types like reactions, replies, and message filtering easier for XMTP integrators. +author: cameronvoell; cameron@ephemerahq.com; cvoell.eth +discussions-to: URL where the XIP draft will be discussed. +status: Draft +type: Standards +category: XRC +created: 2024-11-27 +--- + +## Abstract + +This XIP proposes a new way of managing content types in XMTP in order to make complex content types like reactions, replies, and message filtering easier for XMTP integrators. + +## Motivation + +During the upgrade from XMTP V2 (Direct Messaging Only) to XMTP V3 (Groups via the MLS protocol), one developer experience improvement was that the new "V3" SDKs manage a local SQLITE database containing all of a user's groups and messages. At the same time, our core "libxmtp" library that manages all the database logic remained completely agnostic to the message "content types" that were being stored in the database. While this separation of content types from the database logic was great for keeping complexity down during initial developement, it has made some quieries that would be common in a production consumer messaging app impossible without forcing developers to implement their own extra local persistent data management. An example of this is when the SDK returnsall message types in order received for a group, how can you efficiently render the emoji reactions, replies and read reciepts for each message in your UI? + +In order to address these types of queries, this XIP proposes a way to integrate XMTP content types with our core library and local SQLITE storage. + +## Specification + +Previously, each XMTP SDK implmented their own ContentType implementations that would aim to serialize and deserialize message contents to the same JSON format. + +This XIP proposes new ContentTypes be defined using protobuf definitions that are integrated into our core rust library. Then binding objects and encoding/decoding functions can be generated for each language all in our libxmtp rust repo. + + + +## Rationale + +Talk about alternative of decoding JSON in rust. + + + +## Backward compatibility + + + +Content types that are implemented in the core library will be treated as new content type versions that will not be automatically supported by older SDK versions. + +## Test cases* + + + +## Reference implementation* + + + +## Security considerations + + + +## Copyright + +Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).