{"id":15031169,"url":"https://github.com/numbersprotocol/nit","last_synced_at":"2025-05-13T17:09:32.621Z","repository":{"id":41287987,"uuid":"483568026","full_name":"numbersprotocol/nit","owner":"numbersprotocol","description":"Git of Web3 assets","archived":false,"fork":false,"pushed_at":"2025-03-24T07:59:42.000Z","size":561,"stargazers_count":4325,"open_issues_count":14,"forks_count":9,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-04-24T01:51:18.194Z","etag":null,"topics":["erc-7053","nit"],"latest_commit_sha":null,"homepage":"https://docs.numbersprotocol.io/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/numbersprotocol.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-04-20T08:21:14.000Z","updated_at":"2025-04-15T11:47:36.000Z","dependencies_parsed_at":"2024-01-10T18:26:30.100Z","dependency_job_id":"e78bdc9c-8c14-43d7-ac3e-e32212ecbe96","html_url":"https://github.com/numbersprotocol/nit","commit_stats":{"total_commits":146,"total_committers":4,"mean_commits":36.5,"dds":0.06849315068493156,"last_synced_commit":"c7d43d33ebf59031e85a7b6fce2c370aa74ac1a8"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numbersprotocol%2Fnit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numbersprotocol%2Fnit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numbersprotocol%2Fnit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numbersprotocol%2Fnit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/numbersprotocol","download_url":"https://codeload.github.com/numbersprotocol/nit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253990468,"owners_count":21995774,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["erc-7053","nit"],"created_at":"2024-09-24T20:15:02.657Z","updated_at":"2025-05-13T17:09:27.602Z","avatar_url":"https://github.com/numbersprotocol.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nit\n\nNit is git for web3 digital asset and helps user to commit an asset's activities (chronicle) to blockchain. Please note, this repository is for nit open-source tools. If you are looking for accessing nit via API services, please visit [here](https://docs.numbersprotocol.io/developers/commit-asset-history/commit-via-api) for more details.\n\n## Why Nit\n\nTo make digital assets trustworthy and traceable, Nit leverages web3 technologies and Git core concepts. Everyone can chronicle their assets by creating on-chain records so that we can productively debate, narrate, and analyse. All asset histories are written on chain and are searchable by asset CID. A sample transaction can be found [here](https://snowtrace.io/tx/0x3ba2c36f7b0aeefc954041899a099c228e052a791a59f9922ab53ef9630f4a87).\n\nCase study\n\n1. [A crypto-based dossier could help prove Russia committed war crimes](https://edition.cnn.com/2022/06/10/tech/ukraine-war-crimes-blockchain/index.html), CNN\n2. [Starling Lab and Hala Systems file Cryptographic Submission of Evidence of War Crimes in Ukraine to the International Criminal Court](https://dornsife.usc.edu/cagr-news/news/2022/06/33571-starling-lab-and-hala-systems-file-cryptographic-submission-evidence-war-crimes), CAGR\n\n## Commit \u0026 Asset Tree\n\nnit adopt similar design as git. \n\n* When there is an update to the asset, such as updating creator information or updating content itself to create a child asset, there should be a new commit attach the asset itself.\n\n* Every asset has a Tree file in IPFS to describe the property of the asset, including creator, creation time, license, etc. The asset tree CID is included in the on-chain message. Here is the example of the [asset tree](https://bafkreigbl7262jgwykk6ce47gbzvh4udr3rtzkpgd3b465664gzxma6zfi.ipfs.dweb.link/). \n\nThe  db diagram can be found [here](https://dbdiagram.io/d/6220e69c54f9ad109a54c3a5). In this diagram, you will find tables of `commit` and `assetTree` with the explanation of each data field\n\n## Installation\n\n```shell\nyarn global add @numbersprotocol/nit\n```\n\n## Example: Initial Registration\n\nIf it's your first time to run `nit`, initialize Nit with default configuration:\n\n```\nnit init\n```\n\nand provide personal information. The details of the Nit configuration format is in the [Configuration](#configuration) section below.\n\n```\nnit config -e\n```\n\nThe default integrity register (smart contract) is running on Avalanche Fuji (Testnet) and will migrate to Numbers mainnet in the future. You need to get some testing tokens from the [Fuji faucet](https://faucet.avax-test.network) for paying transaction fee.\n\nCreate a working directory for the targeting asset:\n\n```\nmkdir ~/temp \u0026\u0026 cd ~/temp\n```\n\nCreate the Asset Tree of the targeting asset. Example:\n\n```\nnit add \u003casset-filepath\u003e -m \"First registration.\"\n```\n\nTo access the file of the CID, you can use browser to open the URL: `https://\u003ccid\u003e.ipfs.dweb.link`\n\nDouble check the Commit information meets your expectation:\n\n```\nnit status\n```\n\nRegister the Commit on blockchain:\n\n```\nnit commit -m \"commit description\"\n```\n\nYou can check the Commit on blockchain by following the explorer URL returned by Nit.\n\n## Get On-Chain Information\n\n### Get on-chain block numbers of an Asset\n\n```shell\nnit log \u003casset-cid\u003e --blocks\n```\n\nExample command of the mockup Asset\n\n```shell\nnit log aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa --blocks\n```\n\nCommit block numbers and indices\n\n```\nTotal Commit number: 74\nIndex: 0, Block number: 7236185\nIndex: 1, Block number: 7236445\n...\nIndex: 71, Block number: 10849040\nIndex: 72, Block number: 10849133\nIndex: 73, Block number: 11040035\n```\n\n### Get Commits of an Asset\n\nYou can specify the starting and ending indices of block numbers:\n\n```shell\nnit log \u003casset-cid\u003e --from-index 3 --to-index 5\n```\n\nYou will get the Commits from the block numbers associated to index 3 \u0026 4.\n\nExample command of the mockup Asset\n\n```shell\nnit log aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa --from-index 71 --to-index 73\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eCommits in block 71 \u0026 72 (exclude block 73)\u003c/summary\u003e\n\n```shell\nTotal Commit number: 74\n\nblock number: 10849040\ntx: 0x6d5902173255afe379cc4ae934a6c684ecfd865679286665622de3cf10eddcbe\n{\n  \"assetTreeCid\": \"bafkreifnpykuw5g2m4k5k5wf55zxtzjmcftstzhtsarlkqytimajj3ntlq\",\n  \"assetTreeSha256\": \"ad7e154b74da6715d576c5ef7379e52c116729e4f39022b54313430094edb35c\",\n  \"assetTreeSignature\": \"0x9faf5c9d13b8d90a7a8e88aa6daf089ca89593c28dc241347c4756e83c2f1ea53ed1cb9e189f7ab81c81327527c97595f44ed71dda8e5d78ebe0dccfe9dd27081c\",\n  \"author\": \"bafkreigzixvzu2tbxbvmvwcvlz2zwoagmb6c2q5egaq4lmd5sesyopmmx4\",\n  \"committer\": \"bafkreigzixvzu2tbxbvmvwcvlz2zwoagmb6c2q5egaq4lmd5sesyopmmx4\",\n  \"provider\": \"bafkreigtmno2wacf4ldb6ewbkboe7oojedsp3dky35djytor6guwzhbdpa\",\n  \"timestampCreated\": 1655720482,\n  \"action\": \"bafkreiavifzn7ntlb6p2lr55k3oezo6pofwvknecukc5auhng4miowcte4\",\n  \"actionResult\": \"https://bafkreifnpykuw5g2m4k5k5wf55zxtzjmcftstzhtsarlkqytimajj3ntlq.ipfs.dweb.link\",\n  \"abstract\": \"Action action-initial-registration.\"\n}\n\nblock number: 10849133\ntx: 0xe383fdc0f4eaf44e8bde4737f33bcd45742dcb846f3beb890976793d7cc9358e\n{\n  \"assetTreeCid\": \"bafkreidptwydheqfybug4mmnzwzdg4rqxjvg4akl2pwjmrfxhqz33qv4tu\",\n  \"assetTreeSha256\": \"6f9db0339205c0686e318dcdb2337230ba6a6e014bd3ec9644b73c33bdc2bc9d\",\n  \"assetTreeSignature\": \"0xef547e124a9904dbdb5a418022ad03c621201b74111a3b4c5fac61b1d82350170766cef8a27737d21ca9b1bd4e04f7cdea460706b68b14e0ed17f2a3de83f9131b\",\n  \"author\": \"bafkreigzixvzu2tbxbvmvwcvlz2zwoagmb6c2q5egaq4lmd5sesyopmmx4\",\n  \"committer\": \"bafkreigzixvzu2tbxbvmvwcvlz2zwoagmb6c2q5egaq4lmd5sesyopmmx4\",\n  \"provider\": \"bafkreigtmno2wacf4ldb6ewbkboe7oojedsp3dky35djytor6guwzhbdpa\",\n  \"timestampCreated\": 1655720763,\n  \"action\": \"bafkreiavifzn7ntlb6p2lr55k3oezo6pofwvknecukc5auhng4miowcte4\",\n  \"actionResult\": \"https://bafkreidptwydheqfybug4mmnzwzdg4rqxjvg4akl2pwjmrfxhqz33qv4tu.ipfs.dweb.link\",\n  \"abstract\": \"Action action-initial-registration.\"\n}\n```\n\n\u003c/details\u003e\n\n### Get difference of Commits and Asset Trees of an Asset\n\n```shell\nnit diff \u003casset-cid\u003e --from-index 3 --to-index 5\n```\n\nExample command of the mockup Asset\n\n```shell\nnit diff aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa --from-index 71 --to-index 73\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eDiff of Commits and Asset Trees in block 71 \u0026 72 (exclude block 73)\u003c/summary\u003e\n\n```shell\nfrom: block 10849040, tx 0x6d5902173255afe379cc4ae934a6c684ecfd865679286665622de3cf10eddcbe\n  to: block 10849133, tx 0xe383fdc0f4eaf44e8bde4737f33bcd45742dcb846f3beb890976793d7cc9358e\n\nCommit difference\n{\n  \"abstract\": \"Action action-initial-registration.\",\n  \"action\": \"bafkreiavifzn7ntlb6p2lr55k3oezo6pofwvknecukc5auhng4miowcte4\",\n -\"actionResult\": \"https://bafkreifnpykuw5g2m4k5k5wf55zxtzjmcftstzhtsarlkqytimajj3ntlq.ipfs.dweb.link\",\n -\"assetTreeCid\": \"bafkreifnpykuw5g2m4k5k5wf55zxtzjmcftstzhtsarlkqytimajj3ntlq\",\n -\"assetTreeSha256\": \"ad7e154b74da6715d576c5ef7379e52c116729e4f39022b54313430094edb35c\",\n -\"assetTreeSignature\": \"0x9faf5c9d13b8d90a7a8e88aa6daf089ca89593c28dc241347c4756e83c2f1ea53ed1cb9e189f7ab81c81327527c97595f44ed71dda8e5d78ebe0dccfe9dd27081c\",\n +\"actionResult\": \"https://bafkreidptwydheqfybug4mmnzwzdg4rqxjvg4akl2pwjmrfxhqz33qv4tu.ipfs.dweb.link\",\n +\"assetTreeCid\": \"bafkreidptwydheqfybug4mmnzwzdg4rqxjvg4akl2pwjmrfxhqz33qv4tu\",\n +\"assetTreeSha256\": \"6f9db0339205c0686e318dcdb2337230ba6a6e014bd3ec9644b73c33bdc2bc9d\",\n +\"assetTreeSignature\": \"0xef547e124a9904dbdb5a418022ad03c621201b74111a3b4c5fac61b1d82350170766cef8a27737d21ca9b1bd4e04f7cdea460706b68b14e0ed17f2a3de83f9131b\",\n  \"author\": \"bafkreigzixvzu2tbxbvmvwcvlz2zwoagmb6c2q5egaq4lmd5sesyopmmx4\",\n  \"committer\": \"bafkreigzixvzu2tbxbvmvwcvlz2zwoagmb6c2q5egaq4lmd5sesyopmmx4\",\n  \"provider\": \"bafkreigtmno2wacf4ldb6ewbkboe7oojedsp3dky35djytor6guwzhbdpa\",\n -\"timestampCreated\": 1655720482\n +\"timestampCreated\": 1655720763\n}\n\nAsset Tree difference\n{\n  \"abstract\": \"\",\n  \"assetCid\": \"bafybeif3ctgbmiso4oykvwj6jebyrkjxqr26bfrkesla5yr2ypgx47wgle\",\n  \"assetCreator\": null,\n  \"assetSha256\": null,\n  \"assetTimestampCreated\": null,\n  \"assetTreeCustomKey1\": \"foo\",\n  \"assetTreeCustomKey2\": \"bar\",\n  \"encodingFormat\": \"application/zip\",\n  \"license\": {\n    \"document\": \"https://starlinglab.org\",\n    \"name\": \"Starling License\"\n  },\n +\"nftRecord\": \"bafkreielfjf7sfxigb4r7tejt7jhl6kthxoujwziywixlwxjjho32may7y\"\n}\n```\n\u003c/details\u003e\n\n## Configuration\n\nThe Nit configuration mimics the [Hardhat configuration](https://hardhat.org/config) with additional fields.\n\nThe Nit configuration is at `~/.nitconfig.json`. Linux users can open the default editor by the command below:\n\n```shell\nnit config -e\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eExample of a Nit configuration:\u003c/summary\u003e\n\n```json\n{\n  // CID of the author's profile of original Assets\n  \"author\": \"bafkreihkrnjvjeijjhalozcfpgrgb46673dlt4e3qm5bmvzzb4if423wse\",\n  // CID of the committer's profile who creates Asset Trees and Commits\n  \"committer\": \"bafkreihkrnjvjeijjhalozcfpgrgb46673dlt4e3qm5bmvzzb4if423wse\",\n  // CID of the service provider who hosts the integrity registration service\n  \"provider\": \"bafkreido4zu743f6isb5wninfkedvbirj2ngb5fkivrpdijh2xtd3s6rnu\",\n  \"defaultNetwork\": \"fuji\",\n  \"network\": {\n    \"rinkeby\": {\n      \"url\": \"https://eth-rinkeby.alchemyapi.io/v2/UO5kfog_UDJgGCuqeaSJmnE95_gKOnFN\",\n      \"gasLimit\": 200000,\n      \"accounts\": [\n        \"\u003cprivate-key\u003e\",\n      ],\n      // integrity record contract address\n      \"contract\": \"0x2Aa4e29872DE77E1Bc6cF310d647F9cB0f9a073B\",\n      \"explorerBaseUrl\": \"https://rinkeby.etherscan.io/tx\"\n    },\n    \"avalanche\": {\n      \"chainId\": 43114,\n      \"url\": \"https://api.avax.network/ext/bc/C/rpc\",\n      \"accounts\": [\n        \"\u003cprivate-key\u003e\",\n      ],\n      \"contract\": \"0x1970aFD0831E9233667fb9484910926c2b18BCb4\",\n      \"explorerBaseUrl\": \"https://snowtrace.io/tx\"\n    },\n    \"fuji\": {\n      \"url\": \"https://api.avax-test.network/ext/bc/C/rpc\",\n      \"chainId\": 43113,\n      \"gasLimit\": 200000,\n      \"accounts\": [\n        \"\u003cprivate-key\u003e\",\n      ],\n      \"contract\": \"0xA2De03bee39Fa637440909abC5621063bC5DA926\",\n      \"explorerBaseUrl\": \"https://testnet.snowtrace.io/tx\"\n    },\n    \"polygon\": {\n      \"url\": \"https://polygon-rpc.com/\",\n      \"gasPrice\": 60000000000,\n      \"accounts\": [\n        \"\u003cprivate-key\u003e\",\n      ],\n      \"contract\": \"0x2094747c6c870f20E38f701116CBb46845b5E5c1\",\n      \"explorerBaseUrl\": \"https://polygonscan.com/tx\"\n    },\n    \"moonbase\": {\n      \"url\": \"https://rpc.api.moonbase.moonbeam.network\",\n      \"accounts\": [\n        \"\u003cprivate-key\u003e\",\n      ],\n      \"contract\": \"0xfbeA33fe2b266697404Dc5D1dC0A4ee9D0eDED23\",\n      \"explorerBaseUrl\": \"https://moonbase.moonscan.io/tx\"\n    },\n    \"aurora_testnet\": {\n      \"url\": \"https://testnet.aurora.dev/\",\n      \"chainId\": 1313161555,\n      \"accounts\": [\n        \"\u003cprivate-key\u003e\",\n      ],\n      \"contract\": \"0x8e1bF90681C672e25aE880767d57f0552f6F5Cd1\",\n      \"explorerBaseUrl\": \"https://testnet.aurorascan.dev/tx\"\n    }\n  },\n  // For the ipfsadd command. We will support web3.storage soon\n  \"infura\": {\n    \"projectId\": \"aaaaaaaaaaaaaaaaaaaaaaaaaaa\",\n    \"projectSecret\": \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"\n  }\n}\n```\n\n\u003c/details\u003e\n\n## Verification\n\nVerify the integrity of an Asset Tree\n\n```shell\nnit verify --integrity-hash \u003cassetTreeSha256\u003e --signature \u003cassetTreeSignature\u003e\n```\n\nExample\n\n```shell\nnit verify --integrity-hash 6f9db0339205c0686e318dcdb2337230ba6a6e014bd3ec9644b73c33bdc2bc9d --signature 0xef547e124a9904dbdb5a418022ad03c621201b74111a3b4c5fac61b1d82350170766cef8a27737d21ca9b1bd4e04f7cdea460706b68b14e0ed17f2a3de83f9131b\n```\n\nVerification result\n\n```shell\nSigner address: 0x63B7076FC0A914Af543C2e5c201df6C29FCC18c5\n```\n\nIf the signer address is different from the Committer's wallet address, you can treat this Commit as not trustworthy.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumbersprotocol%2Fnit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnumbersprotocol%2Fnit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumbersprotocol%2Fnit/lists"}