Numbers Protocol
  • 📓Introduction
    • Numbers Protocol
      • Defining Web3 Assets
        • Assetization Process
        • Numbers ID (Nid)
        • Non-Fungible Tokens
        • Commit
        • AssetTree
          • integrityCid
          • digitalSourceType
          • miningPreference
          • nftRecord
        • Commit and AssetTree example
      • Glossary
      • Solution Stack
      • Use Cases
      • Roadmap & Milestones
      • Principles & Standards
    • Whitepaper
    • NUM Token
      • Get NUM
      • Bridge to Multiple Chains
      • Stake NUM
      • Liquidity Providers
      • NUM Utility
      • Token Allocation
      • Deflationary Token Economy
      • Audit Report
      • Distribution and Other Activities
      • Manage your NUM in Cold Wallet
      • 🛠️Developer Tools
    • NumbersDAO
      • Roles & Responsibilities
      • Become A DAO Member
      • Governance & Voting Rules - v2.0
      • [Deprecated] Governance Rules v1.0
    • Weekly Summary
      • 2023
        • 13 Jan 2023
        • 20 Jan 2023
        • 27 Jan 2023
        • 3 Feb 2023
        • 10 Feb 2023
        • 17 Feb 2023
        • 24 Feb 2023
        • 3 Mar 2023
        • 10 March 2023
        • 17 Mar 2023
        • 24 Mar 2023
        • 31 Mar 2023
        • 7 Apr 2023
        • 14 Apr 2023
        • 21 Apr 2023
        • 28 Apr 2023
        • 5 May 2023
        • 12 May 2023
        • 19 May 2023
        • 26 May 2023
        • 2 June 2023
        • 9 June 2023
        • 16 June 2023
        • 23 June 2023
        • 30 June 2023
        • 7 July 2023
        • 14 July 2023
        • 21 July 2023
        • 28 July 2023
        • 4 Aug 2023
        • 11 Aug 2023
        • 18 Aug 2023
        • 25 Aug 2023
        • 01 Sep 2023
        • 08 Sep 2023
        • 15 Sep 2023
        • 22 Sep 2023
        • 29 Sep 2023
        • 6 Oct 2023
        • 13 Oct 2023
        • 20 Oct 2023
        • 27 Oct 2023
        • 3 Nov 2023
        • 10 Nov 2023
        • 17 Nov 2023
        • 24 Nov 2023
        • 1 Dec 2023
        • 8 Dec 2023
        • 15 Dec 2023
        • 22 Dec 2023
        • 29 Dec 2023
      • 2024
        • 5 Jan 2024
        • 12 Jan 2024
        • 19 Jan 2024
        • 26 Jan 2024
        • 2 Feb 2024
        • 9 Feb 2024
        • 16 Feb 2024
        • 23 Feb 2024
        • 1 Mar 2024
        • 8 Mar 2024
        • 15 Mar 2024
        • 22 Mar 2024
        • 29 Mar 2024
        • 5 Apr 2024
        • 12 Apr 2024
        • 19 Apr 2024
        • 26 Apr 2024
        • 3 May 2024
        • 10 May 2024
        • 17 May 2024
        • 24 May 2024
        • 31 May 2024
        • 7 June 2024
        • 14 June 2024
        • 21 June 2024
        • 28 June 2024
        • 5 July 2024
        • 12 July 2024
        • 19 July 2024
        • 26 July 2024
        • 2 Aug 2024
        • 9 Aug 2024
        • 16 Aug 2024
        • 23 Aug 2024
        • 30 Aug 2024
        • 6 Sep 2024
        • 13 Sep 2024
        • 20 Sep 2024
        • 27 Sep 2024
        • 4 Oct 2024
        • 11 Oct 2024
        • 18 Oct 2024
        • 25 Oct 2024
        • 1 Nov 2024
        • 8 Nov 2024
        • 15 Nov 2024
        • 22 Nov 2024
        • 29 Nov 2024
        • 6 Dec 2024
        • 13 Dec 2024
        • 20 Dec 2024
        • 27 Dec 2024
      • 2025
        • 3 Jan 2025
        • 10 Jan 2025
        • 17 Jan 2025
        • 24 Jan 2025
        • 31 Jan 2025
        • 7 Feb 2025
        • 14 Feb 2025
        • 21 Feb 2025
        • 28 Feb 2025
        • 7 Mar 2025
        • 14 Mar 2025
        • 21 Mar 2025
        • 28 Mar 2025
        • 4 Apr 2025
        • 11 Apr 2025
    • Community Wiki
    • FAQ
      • What is provenance and how does it work?
      • What is C2PA and why do we need it?
      • What's the role of Numbers in AI?
      • What's the difference between Numbers and NFT
      • What's the difference between Numbers and C2PA
      • How can Numbers assist songwriters and artists?
      • Why Numbers needs its own blockchain?
      • Why Numbers Mainnet is permissioned?
      • Does Numbers support other blockchain?
      • How is the Nid generated?
      • Should I mint NFT or commit with "license-to" action?
      • Environmental impact of Numbers Mainnet
      • How do I get or bridge Mainnet/BEP-20/ERC-20 NUM?
      • What is Numbers Protocol's role in the AI space?
    • Partnership Programs
      • Creative Origins
      • Creative Innovators
      • Provenance Pioneers
  • 🌐Applications
    • User Tutorials
    • Verify Engine
      • Support Status
      • Search UI Interface
      • Asset Profile
      • Advanced Search & URL Parameters
    • Capture
  • 🛠️Developers
    • Numbers Blockchain
      • Testnet (Snow)
        • Testnet Launch PR
      • Mainnet (Jade)
      • Contract Overview
      • Commit Contract
        • How Commit Contract Works
        • assetTree File
        • On-chain Commit Logs
        • When Should You Use Commit Contract?
      • NFT Contract
    • Initial Asset Registration
    • Verify Engine API
      • Asset Search
      • NFT Search
      • Theft Detection
      • Support Status
    • Nit - Git for Media Files
      • Getting Started
      • Nit Bubble Plugin
    • Read Asset History
      • Read commits with Asset Profile
        • Embed social media into asset profile
      • Read commits via API
      • Read commits via nit module
      • Read commits via Bubble plugin
      • Get the merged AssetTree
    • Commit Asset History
      • Support Status
      • Commit via API
      • Commit via Nit module
      • Commit via Bubble plugin
    • More Tools
      • [NUM] Fetch NUM balance
      • [NUM] Transfer NUM from Custodial Wallet
      • [NUM] Check Staked Amount
      • [IPFS] Cat metadata from Nid/Cid
      • [IPFS] Create Metadata on IPFS
      • [IPFS] Check Nid/Cid on IPFS
      • [IPFS] Unpin Nid/Cid from IPFS
      • XMP parser
    • Working With Us
      • Job Opportunity
      • Reporting Security Vulnerability
Powered by GitBook
On this page
  • Defining Provenance
  • Attaching More Metadata
  • Action
  • API To Commit To Other Blockchain
  1. Developers
  2. Commit Asset History

Commit via API

PreviousSupport StatusNextCommit via Nit module

Last updated 9 months ago

Before performing commits, the 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 and the of the asset you want to commit. If you do not already have a Capture Token yet, please follow 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 . This flexibility allows you to tailor your commit process to best suit your needs.

The author will still be your . 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 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 or .

API Endpoint: https://eo883tj75azolos.m.pipedream.net

Cost: 0.1 NUM per API call + Gas (~0.004 NUM per transaction)

Method: POST

Header:

Authorization: token $YOUR_CAPTURE_TOKEN (required)
Content-Type: application/json

Request Body (required):
encodingFormat (string): MIME type of the asset being committed
assetCid (string): Nid of the asset being committed
assetTimestampCreated (integer): Timestamp of when the asset was created
assetCreator (string): Name of the creator of the asset 
assetSha256 (string): sha256 of the asset being committed

Request Body (optional):
testnet (bool): true to commit on Testnet
author (string): Ethereum address of the author of the commit
licenseName (string): Name of the license of the asset
licenseDocument (string): Document of the license of the asset
custom (string): Custom metadata in JSON format (optional)
nftContractAddress (string): Ethereum address of the NFT contract of the asset
nftChainID (integer): Chain ID of the NFT contract
nftTokenID (string): Token ID of the NFT
commitMessage (string): The description of this commit
action (string): The action performed. More details see below.
abstract (string): asset description or caption
headline (string, optional) Headline or the title of the content file


Example:
curl -X POST "https://eo883tj75azolos.m.pipedream.net" \
     -H "Content-Type: application/json" \
     -H "Authorization: token YOUR_CAPTURE_TOKEN" \
     -d '{
              "encodingFormat": "image/jpeg",
              "assetCid": ASSET_Nid,
              "assetTimestampCreated": 1674556617,
              "assetCreator": "Example User",
              "assetSha256": "32ff5bc7ec494005c01df4a8da67f7ef5a95037de2f7863e3d463b4697447739",
              "abstract": "My first Web3.0 asset",
              "testnet": true,
              "commitMessage": "My first commit",
              "custom": {"usedBy": "https://numbersprotocol.io"}
         }'
  
Response:
{
    "txHash": string, //transaction hash of the commit
    "assetCid": string, //asset Nid
    "assetTreeCid": string, //assetTree Nid
    "explorer": string  //network explorer
}

200: Asset has been committed successfully
400: Bad Request
401: Unauthorized
403: Forbidden
500: Internal Server Error
import requests
import json

# replace YOUT_CAPTURE_TOKEN with your actual token
headers = {
    "Content-Type": "application/json",
    "Authorization": "token " + YOUT_CAPTURE_TOKEN
}
# replace YOUR_ASSET_NID with the actual asset to be committed
data = {
  "author": "0x8212099e5aF75e555A3E63da77a99CcC9527aCC1",
  "encodingFormat": "image/jpeg",
  "assetCid": YOUR_ASSET_NID,
  "assetTimestampCreated": 1674556617,
  "assetCreator": "Example User",
  "assetSha256": "32ff5bc7ec494005c01df4a8da67f7ef5a95037de2f7863e3d463b4697447739",
  "abstract": "My first Web3.0 asset",
  "commitMessage": "My first commit"
}

url = "https://eo883tj75azolos.m.pipedream.net"
# Make the request
response = requests.post(url, headers=headers, json=data)

# Get the response in json format
response_data = json.loads(response.text)

# Print the txHash
print(response_data["txHash"])
// Replace YOUR_CAPTURE_TOKEN with your actual token
const headers = {
    "Content-Type": "application/json",
    "Authorization": `token ${YOUR_CAPTURE_TOKEN}`
};

// Replace YOUR_ASSET_CID with the actual asset to be committed
const data = {
  "author": "0x8212099e5aF75e555A3E63da77a99CcC9527aCC1",
  "encodingFormat": "image/jpeg",
  "assetCid": YOUR_ASSET_NID,
  "assetTimestampCreated": 1674556617,
  "assetCreator": "Example User",
  "assetSha256": "32ff5bc7ec494005c01df4a8da67f7ef5a95037de2f7863e3d463b4697447739",
  "abstract": "My first Web3.0 asset"
};

const url = "https://eo883tj75azolos.m.pipedream.net";

fetch(url, {
    method: "POST",
    headers: headers,
    body: JSON.stringify(data)
})
    .then(response => response.json())
    .then(responseData => {
        console.log(responseData.txHash);
    })
    .catch(error => {
        console.error("Error:", error);
    });

Note:

  • All fields are in string format except for assetTimestampCreated and nftChainID which are in integer format and testnet in boolean format.

  • If licenseName or licenseDocument 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 the assetSourceType put in custom field will be ignored.

  • The API endpoints for other blockchains

Defining Provenance

The following table lists the key fields of the API which define the asset information.

Field
Description
Limitation
Sample Value

abstract

Asset description or asset caption

255 characters

My first Web3.0 asset

assetCreator

Creator of the asset

21 characters

Alice Wu

licenseName

Asset license chosen

21 characters

integrityCid

The metadata Cid

IPFS Cid

bafkreifkyltf4sfduwp5mghyxckq7invzjwl3pl4mksiorshr7lm2y2n2y

assetTimestampCreated

Creation timestamp

Unix timestamp

1674556617

custom: usedBy

How asset is used

URL

custom: generatedBy

AI model which generated the asset

21 characters

Dall-E

Attaching More Metadata

Action

API To Commit To Other Blockchain

The request body follows the spec of . More examples can be found below:

If author is not provided, it will be set to the of the user who calls the API .

Avalanche (cost: 2.5 NUM):

NEAR (cost: 1 NUM):

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 . You can also visit here to see the .

An action, in the context of Numbers system, is the Cid or 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, more pre-defined actions can be found . You may also use to define your custom action.

Near:

Avalanche:

🛠️
initial registration
Capture Token
Nid
the instruction
commit via nit module
Capture Wallet
top up
CoinGecko
CoinMarketCap
AssetTree
Integrity Wallet
https://eox7ryteolf6eh2.m.pipedream.net
https://eof6acukpt2bka5.m.pipedream.net
on this page
metadata example
Nid (Numbers ID)
action-commit
here
nit
https://eof6acukpt2bka5.m.pipedream.net
https://eox7ryteolf6eh2.m.pipedream.net
BY-NC-ND
https://www.ipcc.ch/2022/02/28/pr-wgii-ar6/