Commit

In Numbers Protocol, "Commits" serve as a mechanism for tracking the evolution of a digital asset throughout its lifecycle. Similar to the design of Git, a widely-used version control system, Commits in Numbers Protocol allows developers to easily monitor changes made to Web3 assets and view their full history.

When a commit is created, it serves as a historical record of a specific alteration made to an asset, including information such as the updated assetTree file, the action performed, and the identity of the person who made the change. These changes may include modifications to the asset's metadata, the addition of new files, or any other type of update. By reviewing the commit messages, users can access important information about an asset, such as the date and time of the change, the user who made the change, and a detailed description of the change, allowing for full transparency and traceability.

Commit Contract

To ensure the interoperability and decentralization of the digital media indexing system, the Commit contract implemented on the Numbers blockchain, and on any network indexed by the Numbers engine should follow the reference design suggested by the EIP-7053 standard.

The Commit contract serves as a vital component in generating Commit Messages, which play a pivotal role in establishing the authenticity and provenance of digital media assets within the digital-media ecosystem.

Commit Message

In most cases, when Commit or Commits are mentioned in the documentation, it refers to "Commit Messages" which generated by the Commit contract. All Commit messages should include:

  • One immutable on-chain message and

  • An AssetTree pinned on IPFS

Creating a Commit message allows for the association of metadata with the asset and the ability to track the entire history of the asset.

It should be noted that the original asset, such as an image or video, is NOT stored on the blockchain, but is converted to a Nid and kept on IPFS. This allows for efficient storage and fast retrieval of the asset, while still maintaining a tamper-proof history of the asset on the blockchain.

The process of viewing this history is straightforward:

  • First, by querying the asset's Nid, which serves as a unique identity

  • By locating and viewing the associated Commits to see the changes made

  • Check AssetTree files linked to the Commits and finds changes of the assets over time.

By having a clear and transparent record of all modifications, changes, and other related activities, it is possible to understand the context of an asset and make informed decisions about its value and use.

Specification for Commit message:

The DBDiagram describes the relationship between Commit and AssetTree tables. More tools to create and read commits can be found on the Developer pages. You may also refer to the nit open-source project for more examples of how to create AssetTree and Commit.

Note:

  • The goal of the Commit is to ensure the integrity of the raw asset and its derivatives, such as metadata, and possibly the major asset.

  • One asset can have multiple commits and all of those commits will be tracked here. It will include the details of the asset tree file and the metadata, who created and registered this asset

Actions

An action refers to a specific type of transaction that occurs on the Numbers network. It represents an instruction to the network to perform a specific task, such as initial registration, minting NFT, licensing the asset, showing the asset is composed of other assets, committing log messages or other custom actions.

These actions are verified and recorded on the blockchain, ensuring the immutability and integrity of the data. The following table shows the pre-defined actions in the Numbers Network:

You may also find the list of pre-defined actions on GitHub.

Action specification

{
  "networkActionName": <unique-name>,
  "blockchain": <name-of-blockchain-network>,
  "tokenAddress": <address-of-payment-token>,
  "provider": <nid-of-provider-description>,
  "abstract": <short-description-of-this-action>,
  "type": "new"
}

Create custom Action

A custom action allows developers to extend the functionality of the Numbers network and create solutions for their specific use cases. By creating a custom action, developers can add unique logic, automate processes, and interact with other smart contracts on the blockchain. This enables them to build more sophisticated applications and provide additional value to their users.

If you are interested in creating a custom action, here are the steps:

  1. Create a JSON object following the action spec

  2. Save it to a file and pin the file on IPFS

  3. Get the action file Nid (you can also use this API to execute step 1, 2, 3 together)

  4. Update action.ts and submit PR on GitHub

The nit repository maintainer will review your PR and proceed with the follow-up actions on GitHub.

Last updated