Commit via API
Before performing commits, the initial registration should have been performed in order to make sure the accessibility of the content file from the decentralized web.
Creating commits via API is the simplest way to preserve the asset history. Here is an example of how you can use the curl command to make a POST request using your Capture Token and the Nid of the asset you want to commit. If you do not already have a Capture Token yet, please follow the instruction provided to create one. The Utilities and Scripts page shows more examples of how to create commits via API.
If you opt to use the API for committing, the committer will be the wallet of the Numbers Protocol, 0x51130dB91B91377A24d6Ebeb2a5fC02748b53ce1
. However, if you prefer to have a custom committer, you can commit via nit
module. This flexibility allows you to tailor your commit process to best suit your needs.
The author will still be your Capture Wallet. Anyone can trust that you created the Asset Tree by verifying the Asset Tree sha256 checksum and signature, which will result in your Capture Wallet address being displayed as the verification result.
The Numbers API is a pay-as-you-go system, which means you only pay for the API calls you make. This is a cost-effective way to use the API and it allows you to control your expenses. Make sure to top up and ensure sufficient funds in your wallet in the form of Credits or NUM to cover the cost. Payment for services is processed using NUM; if you want to know how much it costs in USD, you can check CoinGecko or CoinMarketCap.
The request body follows the spec of AssetTree. More examples can be found below:
Note:
All fields are in string format except for
assetTimestampCreated
andnftChainID
which are in integer format andtestnet
in boolean format.If
licenseName
orlicenseDocument
are not provided, both will be set to null, i.e. no license is specified.custom
field must be a valid JSON object.assetSourceType
field is determined by signature and service name associated with API key and theassetSourceType
put incustom
field will be ignored.If
author
is not provided, it will be set to the Integrity Wallet of the user who calls the API .The API endpoints for other blockchains
Avalanche (cost: 2.5 NUM): https://eox7ryteolf6eh2.m.pipedream.net
NEAR (cost: 1 NUM): https://eof6acukpt2bka5.m.pipedream.net
Defining Provenance
The following table lists the key fields of the API which define the asset information.
abstract
Asset description or asset caption
255 characters
My first Web3.0 asset
assetCreator
Creator of the asset
21 characters
Alice Wu
integrityCid
The metadata Cid
IPFS Cid
bafkreifkyltf4sfduwp5mghyxckq7invzjwl3pl4mksiorshr7lm2y2n2y
assetTimestampCreated
Creation timestamp
Unix timestamp
1674556617
custom: generatedBy
AI model which generated the asset
21 characters
Dall-E
Attaching More Metadata
If you have more metadata or provenance data that needs to be associated with the asset, you may create an IPFS metadata file and send the Cid in the integrityCid
field. More metadata fields can be found on this page. You can also visit here to see the metadata example.
Action
An action, in the context of Numbers system, is the Cid or Nid (Numbers ID) that points to the profile of an action performed to an asset. By providing the right action, one can track and record all updares performed to an asset, providing transparency and accountability.
The default action of this API is action-commit, more pre-defined actions can be found here. You may also use nit to define your custom action.
API To Commit To Other Blockchain
Avalanche: https://eox7ryteolf6eh2.m.pipedream.net
Last updated