Skip to content
Bofu Chen edited this page Sep 20, 2022 · 8 revisions

Nit

Nit borrows Git's design concepts, and the two core concepts are

  1. Asset Tree: The update of the Asset.
  2. Commit: An on-chain record including the reference of the linked Asset Tree.

There are some roles in Asset Tree and Commit:

  1. Asset Creator: Who created the asset.
  2. Author: Who creates the Asset Tree.
  3. Committer: Who registers the Commit on chain.
  4. Provider: The integrity service provider who provides smart contracts and APIs.

Schema

Refer to here for the latest stable schema.

Creation Licenses

Here are some commonly used licenses for creations:

licenses: {
  "cc-by": {
    "name": "Creative Commons Attribution 4.0 International",
    "document": "https://creativecommons.org/licenses/by/4.0/"
  },
  "cc-by-sa": {
    "name": "Creative Commons Attribution-ShareAlike 4.0 International",
    "document": "https://creativecommons.org/licenses/by-sa/4.0/"
  },
  "cc-by-nd": {
    "name": "Creative Commons Attribution-NoDerivatives 4.0 International",
    "document": "https://creativecommons.org/licenses/by-nd/4.0/"
  },
  "cc-by-nc": {
    "name": "Creative Commons Attribution-NonCommercial 4.0 International",
    "document": "https://creativecommons.org/licenses/by-nc/4.0/"
  },
  "cc-by-nc-sa": {
    "name": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International",
    "document": "https://creativecommons.org/licenses/by-nc-sa/4.0/"
  },
  "cc-by-nc-nd": {
    "name": "Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International",
    "document": "https://creativecommons.org/licenses/by-nc-nd/4.0/"
  },
  "mit": {
    "name": "mit",
    "document": "https://opensource.org/licenses/MIT"
  },
  "public": {
    "name": "public-domain",
    "document": "https://opensource.org/licenses/MIT"
  }
}

Commit Database

Commit Database is an optional cache layer on top of the blockchains for speeding up the access of Commits. Instead of retrieving the Commits on-chain directly, we provide a default Commit Database. You can also create your own by following the interface below.

Numbers Commit Database

Base URLs

  1. Mainnet: https://node.numbersprotocol.io/api/1.1/wf
  2. Testnet: https://node.numbersprotocol.io/version-test/api/1.1/wf

Endpoints

  1. commitdb_update
    1. Request Commit Database to synchronize the Commits of the given Asset CID.
  2. commitdb_amount
    1. Get the current Commit amount of the given Asset CID in the Commit Database.
  3. commitdb
    1. Write on-chain Commits into the Commit Database. Only the Commit Database has the permission to call it.

Examples

  1. Update an Asset CID
curl --location --request POST 'https://node.numbersprotocol.io/api/1.1/wf/commitdb_update' \
--header 'Content-Type: application/json' \
--data-raw '{
  "assetCid": "bafybeie7yzw2afoi36enyuk6hdxgll3y52g3yqeuvehutoxxkxssvbzqre",
  "dbEndpointUrl": "https://node.numbersprotocol.io/version-test/api/1.1/wf/commitdb"
}'
Clone this wiki locally