frequency icon indicating copy to clipboard operation
frequency copied to clipboard

`messages` pallet assumes all IPFS-hosted content is a multi-user batch file

Open JoeCap08055 opened this issue 4 months ago • 0 comments

Describe

Currently in the messages pallet, we have the ability to post two different kinds of content: OnChain and Ipfs. The storage state for messages data contains two fields, provider_id and msa_id, populated as follows:

  • For OnChain content, provider_id always contains the MSA ID of the user that submitted the transaction. This may be a Provider, or a User MSA.
    • If the transaction indicates that it is being submitted on_behalf_of another user, delgation grants are checked, and the message's msa_id is populated with the User MSA that the message is being posted on behalf of
    • Otherwise, the msa_id is set to the same value as provider_id, to indicate that the User is acting directly, not via a Provider

All well and good.

  • For Ipfs content, it is assumed that the content is a batch file containing content on behalf of multiple MSAs; therefore the msa_id is set to None. It is expected that the content will contain individual records containing MSA IDs for which delegation authority can be validated off-chain.

However, we do not make any provisions for a use case wherein a Provider posts Ipfs content on a single user's behalf, where the content schema does not contain the user's MSA ID for off-chain validation.

Some points to consider:

  • Should this use case be accounted for?
  • Would it make sense to enhance the message::add_ipfs_message extrinsic to accept an on_behalf_of parameter, the same as messages::add_onchain_message?
  • Would it make sense to enhance the Schema metadata to indicate whether it represents batch or single-user data?

JoeCap08055 avatar Sep 17 '25 16:09 JoeCap08055