Skip to content

[Feature]: Add 'OffChain' payload location for Schemas & Intents #2677

@JoeCap08055

Description

@JoeCap08055

Feature Description

Details

Some recent use cases have arisen regarding how to describe off-chain content. Currently, Frequency has a single mechanism for posting & describing off-chain content: an Intent/Schema with PayloadLocation::IPFS. Posting to such a schema requires, specifically, an IPFS CID which is used as a resource locator for finding the resource off-chain; the referenced Schema defines how to interpret the off-chain resource.

However, off-chain resources may live in a variety of locations, not just IPFS. We can get around the specific format/locator requirements of add_ipfs_message by posting add_onchain_message with a schema that defines some other resource locator (ie, a URL, AWS S3 bucket locator, etc). However, that message then would need to reference a Schema that defines how the off-chain payload itself is to be interpreted, and for that, none of the existing payload locations of OnChain, IPFS, or the stateful-storage locations Itemized or Paginated accurately describe this.

Suggestion: Expand the PayloadLocation enum with an OffChain variant

This is the minimum change necessary to allow this use case. Future enhancements could explore defining a basic format for posting an off-chain reference, ie, an add_offchain_message extrinsic similar to add_ipfs_message, but more generic. However, for now, expanding the enum at least gives us the ability to create Schema definitions that accurately indicate the general payload location as being off-chain, but not specifically IPFS.

How this would work

In order to announce off-chain content, two Intents would be required:

  • An OnChain Intent whose Schema defines an object locator payload (ie, a URL, content-addressable location, etc) AND the SchemaId of the off-chain payload
  • An OffChain Intent whose Schema defines the shape of the off-chain payload itself

Content could thus be announced using the add_onchain_message extrinsic.

Searched for Related Issues

  • I have done a search for related issues and either found none, or noted them

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions