Commit
Last updated
Last updated
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.
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.
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.
assetCid
The Nid of the asset file.
string
assetTreeCid
string
assetTreeSha256
The sha256sum of the AssetTree file.
string
assetTreeSignature
The EIP-191 signature signed by the asset's author.
signature
abstract
Commit message. This should describe the purpose of the commit and is different from the abstract in the AssetTree.
string
author
The wallet address of the person who writes the assetTree content.
string
committer
The wallet address which sends the transaction.
string
action
The Nid of the IPFS file which describes the action performed to the asset.
string
actionName
string
actionResult
The result URI of the performed action.
string
provider
The Cid/Nid of the IPFS file which describe the information of the service provider.
string
attachment
The Cid/Nid of the attachment file.
string
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
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:
action-initial-registration-jade
<asset-address>
Initial registration of assets on Numbers Mainnet
action-initial-registration-avalanche
<asset-address>
Initial registration of assets on Avalanche C-Chain
action-initial-registration-iota
<asset-address>
Initial registration of assets on IOTA
action-license-to
(Update Soon)
<url-to-wallet>
License asset to a wallet owner
action-composition
(Update Soon)
<source-asset-or-the-list-of-source-url>
Showing other assets that are used to create the current asset
action-used-by
(Update Soon)
<website-or-new-asset-url>
Showing how the current asset is used by other assets or referred by a website
action-mint-erc721-nft-jade
<nft-transaction-address>
Mint ERC721 NFT on Numbers Mainnet
action-mint-erc721-nft-ethereum
<nft-transaction-address>
Mint ERC721 NFT on Ethereum network
action-mint-erc721-nft-avalanche
<nft-transaction-address>
Mint ERC721 NFT on Avalanche network
action-mint-erc721-nft-polygon
<nft-transaction-address>
Mint ERC721 NFT on Polygon network
action-mint-erc721-nft-thundercore
<nft-transaction-address>
Mint ERC721 NFT on ThunderCore network
action-commit
<url-related-to-commit-result>
You may also find the list of pre-defined actions on GitHub.
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:
Create a JSON object following the action spec
Save it to a file and pin the file on IPFS
Get the action file Nid (you can also use this API to execute step 1, 2, 3 together)
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.
The Nid of the file.
The name of the action in plain text. More details about action
and actionName
see the below.
General commit messages of the asset, also the default action if you use to commit.