Skip to content

7. Nit, Native Protocol Tool

shc261392 edited this page Oct 5, 2023 · 21 revisions

About Nit

  • Nit represents the Numbers Protocol git, the git for Web 3.0 assets.
  • What Numbers Protocol do is to collect the history of Web 3.0 assets and build a Tree Structure so that if you can find the root and histories along the way.

References

Asset Tree & Commits

Screenshot 2022-05-17 160157
  • An Asset Tree is a JSON file stored on IPFS which contains the important information such as content ID of the asset, creator information, creation timestamp, license, NFT records, etc.
  • A set of Commits represent the on-chain history of Web 3.0 Asset.
  • All Commits are indexed by the Asset CID of the First Commit.
  • You can create your own Asset Tree file or use nit tool to create default Asset Tree files.

Tools & API

Nit API

DESCRIPTION

This API registers digital media (photo or video) to the Numbers Network. Registration includes the generation of a unique asset ID and NFT Token. Please note, the default option is ThunderCore blockchain as it is cost-effective for most users, however, you may also change the NFT network to other preferred networks such as Ethereum, Polygon or Avalanche. Successful registration to Numbers Network will yield asset ID and NFT Token ID.

NOTE: Minting process will take around 3 - 5 minutes. Initial NFT Token response will be pending. Can leverage Get Asset Status API endpoint to retrieve registration status.

EXAMPLE

curl --location --request POST 'https://node.numbersprotocol.io/api/1.1/wf/register_asset' \
--form 'file="{FILE_URL}"' \
--form 'token="{NUMBERS_SEAL_API_AUTH_TOKEN}"' \
--form 'api_key="{NUMBERS_SEAL_API_KEY}"' \
--form 'blockchain_name="thundercore"'

SAMPLE RESULT

{
    "status": "success",
    "response": {
        "asset_id": "bafkreicnlhhnbd33h2dvv5azj23zywtklvr2cfec7fl7ebwvsq4owuf65e",
        "nft_token": "pending"
    }
}

AUTHORIZATION

  • API Key: None

HEADERS

  • Content-Type: multipart/form-data

BODY (formdata)

Parameter Type Sample Data Default Value Description
file Required //s3.amazonaws.com/test.jpeg N/A URL of File
token Required N/A N/A Numbers SEAL API Auth Token. Create an account with Numbers Seal API
api_key Required N/A N/A Acquire Numbers SEAL API KEY to get access to mint NFT
blockchain_name Required thundercore N/A Mint NFT on ThunderCore blockchain

Nit Asset Status

DESCRIPTION

This API retrieves Numbers Network asset registration status and returns asset ID and asset status (registered or pending). Typically successful asset registration (unique id and NFT Token) will take 3 - 5 minutes to complete.

EXAMPLE

curl --location --request POST 'https://node.numbersprotocol.io/api/1.1/wf/get_asset_status' 
--form 'asset_id="{ASSET_ID}"' \
--form 'token="{NUMBERS SEAL API AUTH TOKEN}"'

SAMPLE RESULT

{
    "status": "success",
    "response": {
        "asset_id": "bafkreicnlhhnbd33h2dvv5azj23zywtklvr2cfec7fl7ebwvsq4owuf65e",
        "nft_status": "registered"
    }
}

AUTHORIZATION

  • API Key: None

HEADERS

  • Content-Type: multipart/form-data

BODY (formdata)

Parameter Type Sample Data Default Value Description
asset_id Required bafkreicnlhhnbd33h2dvv5azj23zywtklvr2cfec7fl7ebwvsq4owuf65e N/A Web3.0 ID of Numbers Network
token Required N/A N/A Numbers SEAL API Auth Token. Create an account with Numbers Seal API

Nit Commit

DESCRIPTION

This API registers a Commit to the Numbers integrity blockchain. For usage and example, see the Commit via API document. The API also provides alternative endpoints for committing on Avalanche and NEAR blockchain.

To check the Commit transactions, you can use the explorer URLs below.

  • Numbers Mainnet Explorer: https://mainnet.num.network/tx/<tx-hash>
  • Numbers Testnet Explorer: https://testnet.num.network/tx/<tx-hash>
  • Avalanche Mainnet Explorer: https://snowtrace.io/tx/<tx-hash>
  • Near Mainnet Explorer: https://explorer.aurora.dev/tx/<tx-hash>

Nit getBlocks

DESCRIPTION

This API returns the block numbers of the indicated Asset's Commits.

EXAMPLE

curl --location --request POST 'https://node.numbersprotocol.io/api/1.1/wf/getblocks' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--form 'assetCid="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"'

SAMPLE RESULT

{
    "status": "success",
    "response": {
        "blocks": [
            "7236185",
            "7236445",
            "7236954",
            "7407876",
            "7423045",
            "7469003",
            "7538985",
            "7539490",
            "7551265",
            "7552354",
            "7552623",
            "7552739"
        ]
    }
}

AUTHORIZATION

  • API Key: Please acquire your API key from Numbers Protocol

HEADERS

  • Content-Type: multipart/form-data

BODY (formdata)

Parameter Type Sample Data Default Value Description
assetCid Required aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa N/A Asset's CIDv1

Nit getCommit

DESCRIPTION

This API returns the Commit data of the indicated block number.

EXAMPLE

curl --location --request POST 'https://node.numbersprotocol.io/api/1.1/wf/getcommit' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--form 'assetCid="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"' \
--form 'blockNumber="7551265"'

SAMPLE RESULT

{
    "status": "success",
    "response": {
        "commit": "{\"assetTreeCid\":\"bafkreiaiazqeq6kmvkwjtrwri6srksp6qhj2upagwk4ts2bqnuy6lforqq\",\"assetTreeSha256\":\"08066048794caaac99c6d147a51549fe81d3aa3c06b2b93968306d31e595d184\",\"author\":\"bafkreihkrnjvjeijjhalozcfpgrgb46673dlt4e3qm5bmvzzb4if423wse\",\"committer\":\"bafkreiawlexbf67kvwavwkntyt6v7phgtla2creqxrvomz7a3kat7w2mya\",\"action\":\"testAction\",\"actionResult\":\"testActionResult\",\"provider\":\"bafkreigtmno2wacf4ldb6ewbkboe7oojedsp3dky35djytor6guwzhbdpa\",\"abstract\":\"Committed by bafkreiawlexbf67kvwavwkntyt6v7phgtla2creqxrvomz7a3kat7w2mya, integrity service provided by bafkreigtmno2wacf4ldb6ewbkboe7oojedsp3dky35djytor6guwzhbdpa\",\"timestampCreated\":1647791177}"
    }
}

AUTHORIZATION

  • API Key: Please acquire your API key from Numbers Protocol

HEADERS

  • Content-Type: multipart/form-data

BODY (formdata)

Parameter Type Sample Data Default Value Description
assetCid Required aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa N/A Asset's CIDv1
blockNumber Required 7551265 N/A The target block containing the Commit data.

Nit Create Asset

DESCRIPTION

This API creates an Asset on Numbers Decentralised Photo Network and returns the Commit transaction hash, Asset CID, and Asset Tree CID.

If you provide NFT metadata, this API will also creates a NFT for the Asset.

EXAMPLE

curl --location --request POST 'https://node.numbersprotocol.io/api/1.1/wf/nit_create_asset' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--form 'assetCid="bafybeif3ctgbmiso4oykvwj6jebyrkjxqr26bfrkesla5yr2ypgx47wgle"' \
--form 'assetMimetype="application/zip"' \
--form 'assetSha256="4fd764f575dcab7c6ff47e031b58bd04934dfe201bc96a39bf4a707c55b7ee4f"' \
--form 'license="{\"name\":\"Starling License\",\"document\":\"https://starlinglab.org\"}"' \
--form 'custom="{\"assetTreeCustomKey1\":\"foo\",\"assetTreeCustomKey2\":\"bar\"}"' \
--form 'nftMetadata="{
    \"name\": \"Ukrainian Soldiers at Saber Guardian 2014\",
    \"description\": \"Ukrainian Soldiers at Saber Guardian 2014 by U.S. Army Europe is marked with CC PDM 1.0.\",
    \"image\": \"https://bafkreib4afjmjgss2q7b5hftixkq3z4ypvswldekfbtdh55ybh5bcq6puq.ipfs.dweb.link/\",
    \"external_url\": \"https://bafybeif3ctgbmiso4oykvwj6jebyrkjxqr26bfrkesla5yr2ypgx47wgle.ipfs.dweb.link\"
}
"' \
--form 'mockup="true"'

SAMPLE RESULT

{
    "status": "success",
    "response": {
        "txHash": "0xda56cf8cbe8a56d09317027da8349417fc48cc5bb353d046aca707bd25055c38",
        "assetCid": "bafybeif3ctgbmiso4oykvwj6jebyrkjxqr26bfrkesla5yr2ypgx47wgle",
        "assetTreeCid": "bafkreih7kptatqglfappcjjrd35cethzv5upp57sxfnixtjoscosk6vnaa"
    }
}

AUTHORIZATION

  • API Key: Please acquire your API key from Numbers Protocol

HEADERS

  • Content-Type: multipart/form-data

BODY (formdata)

Parameter Type Sample Data Default Value Description
assetCid Required aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa N/A Asset's CIDv1
assetMimetype Required application/zip N/A Asset's Mime type
assetSha256 Optional 917169b912cbf83ed481384f7b128e172c4e3459f798b1ae5bcfeffe7f09ccdc N/A Asset's Sha-256 hash
assetCreatorCid Optional aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa N/A Asset creator's Identity CID
assetTimestampCreated Optional 1654104978 N/A Timestamp of Asset's creation time
license Optional {"name":"My License","document":"https://mylicense.org"} N/A License in JSON
custom Optional {"assetTreeCustomKey1":"foo","assetTreeCustomKey2":"bar"} N/A Extend Asset Tree by customized key-value pairs in JSON
nftMetadata Optional { "name": "Ukrainian Soldiers at Saber Guardian 2014", "description": "Ukrainian Soldiers at Saber Guardian 2014 by U.S. Army Europe is marked with CC PDM 1.0.", "image": "https://bafkreib4afjmjgss2q7b5hftixkq3z4ypvswldekfbtdh55ybh5bcq6puq.ipfs.dweb.link/", "external_url": "https://bafybeif3ctgbmiso4oykvwj6jebyrkjxqr26bfrkesla5yr2ypgx47wgle.ipfs.dweb.link" } N/A ERC-721 NFT metadata in JSON
nftContractAddress Optional 0x4Dc5FD335fbC5614b2A1641c8A9F7e4b7cC80AE2 N/A Mint NFT using the specified NFT contract
dryRun Optional true N/A Return Commit in JSON and will not commit on blockchain
mockup Optional true N/A Use mockup Asset instead of real Asset to commit

Nit Get Identity

DESCRIPTION

This API returns Identity of user's account.

EXAMPLE

curl --location --request POST 'https://node.numbersprotocol.io/api/1.1/wf/nit_get_identity' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--form 'walletAddress="0x76557Ea1C655CeACc79f2dd920DFF50b296808eB"'

SAMPLE RESULT

{
    "status": "success",
    "response": {
        "identity": "{\n  \"name\": \"Starling Lab\",\n  \"wallet\": \"0x76557Ea1C655CeACc79f2dd920DFF50b296808eB\",\n  \"profile\": \"https://www.starlinglab.org/\",\n  \"type\": \"ngo\",\n  \"information\": {\n    \"description\": \"The Starling Lab for Data Integrity prototypes tools and principles to bring historians, legal experts and journalists into the new era of Web3.\"\n  }\n}\n",
        "identityCid": "bafkreiayk7eoi3wivgu2fvur7vwo4dewyshg4x755uuq3vzwehc3hdfvsa",
        "walletAddress": "0x76557Ea1C655CeACc79f2dd920DFF50b296808eB"
    }
}

AUTHORIZATION

  • API Key: Please acquire your API key from Numbers Protocol

HEADERS

  • Content-Type: multipart/form-data

BODY (formdata)

Parameter Type Sample Data Default Value Description
walletAddress Required aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa N/A user's wallet address

Nit Update Identity

DESCRIPTION

This API helps user to update Identity.

EXAMPLE

curl --location --request POST 'https://node.numbersprotocol.io/api/1.1/wf/nit_update_identity' \
--header 'Authorization: Bearer b77f41b2a6ec803123d6c23d5772b15e' \
--form 'identity="{
  \"name\": \"numdev-testnet\",
  \"wallet\": \"0x63B7076FC0A914Af543C2e5c201df6C29FCC18c5\",
  \"profile\": \"bafkreidedkuz2mim2pfetxkhy2ysq75ooqe73bnuz5izhs6wzxoi567hua\",
  \"social\": {
    \"website\": \"https://numbersprotocol.io\",
    \"twitter\": \"https://twitter.com/numbersprotocol\"
  },
  \"type\": \"provider\",
  \"information\": \"Numbers Dev Team.\"
}
"' \
--form 'walletAddress="0x63B7076FC0A914Af543C2e5c201df6C29FCC18c5"'

SAMPLE RESULT

{
    "status": "success",
    "response": {
        "identity": "{\n  \"name\": \"numdev-testnet\",\n  \"wallet\": \"0x63B7076FC0A914Af543C2e5c201df6C29FCC18c5\",\n  \"profile\": \"bafkreidedkuz2mim2pfetxkhy2ysq75ooqe73bnuz5izhs6wzxoi567hua\",\n  \"social\": {\n    \"website\": \"https://numbersprotocol.io\",\n    \"twitter\": \"https://twitter.com/numbersprotocol\"\n  },\n  \"type\": \"provider\",\n  \"information\": \"Numbers Dev Team.\"\n}\n",
        "identityCid": "bafkreigzixvzu2tbxbvmvwcvlz2zwoagmb6c2q5egaq4lmd5sesyopmmx4",
        "walletAddress": "0x63B7076FC0A914Af543C2e5c201df6C29FCC18c5"
    }
}

AUTHORIZATION

  • API Key: Please acquire your API key from Numbers Protocol

HEADERS

  • Content-Type: multipart/form-data

BODY (formdata)

Parameter Type Sample Data Default Value Description
walletAddress Required aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa N/A user's wallet address
identity Required { "name": "numdev-testnet", "wallet": "0x63B7076FC0A914Af543C2e5c201df6C29FCC18c5", "profile": "bafkreidedkuz2mim2pfetxkhy2ysq75ooqe73bnuz5izhs6wzxoi567hua", "social": { "website": "https://numbersprotocol.io", "twitter": "https://twitter.com/numbersprotocol" }, "type": "provider", "information": "Numbers Dev Team." } N/A user's Identity in JSON