xmtp / libxmtp

LibXMTP is a shared library encapsulating the core functionality of the XMTP messaging protocol, such as cryptography, networking, and language bindings.
MIT License
41 stars 17 forks source link

Mutable Metadata Migrations #850

Closed nplasterer closed 3 months ago

nplasterer commented 3 months ago

SDK V1

SDK V2 (adds imageURL)

Default policy Admin/Super Admin. --- Special key possibly _ that signifies if the default should be ignored for super admin.

Raw Notes: We need to handle the case when no field is defined assume a default. There's a policy for each field what happens when the policy is also missing. Assume a default policy for missing fields.

Policy is set when group is created. Deny the update for imageURL.

We would expect only errors to happen when trying to update the imageUrl. When new metadata is added a admin/super admin will need to update the policy before updating new metadata. If we don't know the policy only admin or super admin can update it.

Idea: Central location of a registry for all metadata fields so new and old clients can see what metadata is supported. Immutable registry. Admins who can update the fields could just start updating without the commit.

What if we put the default policy in the name of the policy key. If it contains an _ than it requires a super admin.