MIP - Standardized JSON Structure, Explorer and API Enhancements for Inscriptions

Abstract

This MIP proposes a new JSON standard for managing inscriptions on the MultiversX blockchain. It is designed to provide a streamlined, efficient, and flexible structure for inscription data, emphasizing simplicity, flexibility, and interoperability. The proposal includes specifications for a JSON structure, schema for validation, and enhancements to the API to support efficient indexing and handling of inscriptions.

This Improvement Proposal seeks to take inscriptions beyond the hype and make them an essential part of the developer experience on MultiversX.

Motivation

The current system for managing inscriptions on MultiversX lacks a standardized structure, leading to inefficiencies and inconsistencies in data management and retrieval. A standardized JSON structure along with enhanced API behavior is necessary to improve the integrity, efficiency, and interoperability of inscriptions across the ecosystem.

Specification

JSON Structure for Inscriptions

{
  "prev": "hash_of_the_previous_inscription", // (optional) previous transaction hash
  "v": "2024-01", // Version of JSON schema
  "scope": "myproject", // Custom scope of a category or project
  "type": "text/plain", // MIME type of data
  "data": "VGhpcyBpcyBteSBmaXJzdCBpbnNjcmlwdGlvbi4=", // base64-encoded data
  "meta": {
    "field1": "value1" // Arbitrary meta data (optional)
  }
}

Schema Reference (v1 – 2024-01)

The JSON Schema for inscriptions adhering to this standard is accessible at the following URL:

Inscription Schema 2024-01

This schema ensures compliance and validation for inscriptions, maintaining the structure and integrity of the data as outlined in this proposal.

Inscription Example

For a practical example of an inscription following this standard, refer to this transaction on the MultiversX blockchain:

Inscription Transaction Example

This link leads to an inscription’s details, showcasing its structure, content, and associated metadata.

Encoding Requirements for Inscriptions

Inscriptions should be minified and base64 encoded for efficiency. Ensure the data field is also base64 encoded to handle various content types uniformly.

Deployments, Upgrades, and Transfers

Deployments:

  • Initial Deployment: When an inscription is initially created, it is considered a deployment. The transaction for a deployment should have the sender address equal to the receiver address, indicating that the creator is publishing a new inscription.
  • No “prev” Field: Initial deployments will not contain a “prev” field, as they do not reference a previous inscription.

Upgrades:

  • Upgrading an Inscription: To upgrade or update an inscription, the “prev” field must be included, referencing the hash of the previous version.
  • Sender = Receiver: For an upgrade, the transaction should have the sender address equal to the receiver address, similar to the initial deployment. This indicates that the current owner is updating the inscription.

Transfers and Transfer-Upgrades:

  • Transfers: When an inscription is transferred from one owner to another, the sender and receiver addresses will be different.
  • Transfer-Upgrades: If an inscription is being updated and transferred simultaneously (a transfer-upgrade), it will have a “prev” field, and the sender and receiver addresses will differ, indicating the change in ownership along with the update.

Authenticity and Provenance

The authenticity of an inscription, including its ID (the transaction hash), creator (sender of deployment), current owner (last receiver), and provenance (chain of inscription), can be reliably derived from the blockchain’s immutable transaction history. Each inscription’s transactional record, particularly the ‘prev’ field linkage and the transaction metadata (sender/receiver addresses and timestamps), provides a verifiable trail of ownership and changes. This ensures a tamper-proof, auditable history of each inscription, supporting trust and reliability in the system.

Explorer Enhancements for Inscriptions

Blockchain explorers can be enhanced to recognize and display inscriptions based on the new standard. Features include:

  • Inscription Detection: Automatically identify and label transactions containing inscriptions.
  • Content Display: Render the content of inscriptions based on their MIME type, including text, images, and links to multimedia.
  • Metadata Visualization: Present any additional ‘meta’ data associated with the inscription in a structured format.
  • Dedicated Inscription Page: Offer a dedicated view for each inscription, detailing its content, metadata, and transaction history.

API Enhancements

To support the new JSON structure for inscriptions, we propose the following API enhancements:

  1. Grouping: Utilize scopes via the “scope” field to group inscriptions, similar to NFTs are grouped by collection.
  2. Duplication Handling: Implement mechanisms for detecting and handling duplicate or fraudulent inscriptions, by ignoring all inscription deviations other than the first value one in the inscription chain.
  3. Retrieval and Update: Enable efficient retrieval of inscriptions by ID and scope, and support version history through the “prev” field. Ensure smooth handling of updates or upgrades linked to previous versions.
  4. Deployment and Upgrade Rules: Recognize initial deployments (where sender equals receiver and no “prev” field) and upgrades (with a “prev” field), as well as handle transfers and transfer-upgrades appropriately, ensuring accurate ownership and version tracking.

MultiversX-native IPFS Alternative

For some use cases, the proposed inscription standard serves as a native alternative to IPFS, tailored for efficiency and integration within the MultiversX ecosystem.

Conclusion

This MIP represents a significant step forward in the standardization and management of inscriptions on MultiversX. By introducing a streamlined, efficient, and flexible JSON structure, coupled with API enhancements for improved handling and indexing, we elevate inscriptions from mere data entries to powerful tools for developers and users alike.

The proposed enhancements in standardization, format, explorer integration, and transactional handling are designed with simplicity, flexibility, and interoperability at their core, ensuring that inscriptions can be an integral and efficient part of the MultiversX ecosystem.

4 Likes

This is a good one. Standardised structures are great for integraitons.

1 Like