{"id":21658938,"url":"https://github.com/chainpoint/chainpoint-cli","last_synced_at":"2026-01-12T05:51:41.220Z","repository":{"id":57196712,"uuid":"94481779","full_name":"chainpoint/chainpoint-cli","owner":"chainpoint","description":"A Command Line Interface (CLI) for creating and verifying Chainpoint proofs.","archived":false,"fork":false,"pushed_at":"2020-06-17T21:49:01.000Z","size":722,"stargazers_count":59,"open_issues_count":0,"forks_count":11,"subscribers_count":12,"default_branch":"master","last_synced_at":"2023-12-27T10:10:13.121Z","etag":null,"topics":["api-client","bitcoin","chainpoint","command-line","cryptography","ethereum","hash","proof","sha256"],"latest_commit_sha":null,"homepage":"https://chainpoint.org/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chainpoint.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-15T21:54:54.000Z","updated_at":"2023-10-13T06:18:56.000Z","dependencies_parsed_at":"2022-09-16T17:00:52.319Z","dependency_job_id":null,"html_url":"https://github.com/chainpoint/chainpoint-cli","commit_stats":null,"previous_names":[],"tags_count":16,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chainpoint%2Fchainpoint-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chainpoint%2Fchainpoint-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chainpoint%2Fchainpoint-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chainpoint%2Fchainpoint-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chainpoint","download_url":"https://codeload.github.com/chainpoint/chainpoint-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226305076,"owners_count":17603732,"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":["api-client","bitcoin","chainpoint","command-line","cryptography","ethereum","hash","proof","sha256"],"created_at":"2024-11-25T09:30:05.216Z","updated_at":"2026-01-12T05:51:41.214Z","avatar_url":"https://github.com/chainpoint.png","language":"JavaScript","readme":"# Important:\n\nThe package is for the Chainpont v4 Network. If you are looking to work with the older Chainpoint v3 Network (chainpoint-services), use version 1.6.1.\n\n# Chainpoint CLI\n\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![npm](https://img.shields.io/npm/v/chainpoint-cli.svg)](https://www.npmjs.com/package/chainpoint-cli)\n\nA Command Line Interface (CLI) for creating and verifying Chainpoint proofs. See https://chainpoint.org\n\nThe Chainpoint CLI lets you submit hashes to a Chainpoint Gateway on the Chainpoint Network. Gateways periodically aggregate hashes and send data to Chainpoint Core for anchoring the hash to public blockchains.\n\nThe CLI lets you retrieve and verify a Chainpoint proof. Each proof cryptographically proves the integrity and existence of data at a point in time.\n\nThe CLI also maintains a simple local database that keeps track of\nevery hash you submit, and stores and manages Chainpoint proofs\nlocally for easy retrieval, export, and verification.\n\nThe CLI includes an interface for interacting with a [Bitcoin Header Node](https://github.com/chainpoint/bitcoin-header-node)\nwhich can be used for verifying btc anchors locally rather than relying on an external service.\n\n## Installation\n\n### Easy Install\n\nGit tagged releases are automatically built as a single-file binary and uploaded as Github releases. Binaries are compiled for:\n\n- Alpine Linux (x64)\n- Linux (x64)\n- macOS (x64)\n\nYou can find the most current releases at [https://github.com/chainpoint/chainpoint-cli/releases](https://github.com/chainpoint/chainpoint-cli/releases)\n\nThese binaries are created with the [pkg](https://github.com/zeit/pkg#readme) tool and have no pre-requisites. It is _not_ necessary to install even Node.js as it is packaged in the binary. Installation is a simple matter of downloading the appropriate file, giving it execute permissions, and running it from a location on your `PATH`.\n\n#### Install \u0026 Run\n\n```\n$ npm install -g chainpoint-cli\n\n$ chp\nUsage: chp \u003ccommand\u003e [options] \u003cargument\u003e\n...\n```\n\n## Usage\n\nYou can get an overview of the CLI usage by typing the command (`chp`). The Gateway that the CLI will\ncommunicate with will be chosen from those advertised as healthy on the network.\n\nOn first use, the CLI will create a `~/.chainpoint/cli` directory\nwhere it will store its `chainpoint-v4-proofs.db`\nfile. The database file will be managed for you and it is not recommended to\nmodify it yourself. The database stores a record of every hash\nyou submit, which Gateway it was submitted to, and a copy of the\nproofs. You can create a `cli.config` file in this directory\nwith a `CHAINPOINT_GATEWAY_BASE_URI=` value if you'd like to\npermanently specify a Gateway of your own choosing.\n\n```\n$ chp\nUsage: chp \u003ccommand\u003e [options] \u003cargument\u003e\n\nCommands:\n  submit    submit a hash to be anchored\n  update    retrieve an updated proof for your hash(es), if available\n  verify    verify a proof's anchor claims\n  evaluate  evaluate and display a proof's anchor claims\n  export    export a proof\n  list      display the status of every hash in the local database\n  show      show the proof for a proof_id\n  delete    delete a hash from the local database\n  version   show the CLI version\n\nOptions:\n  -g, --gateway-uri  specify uri of chainpoint gateway                      [string]\n  -q, --quiet   suppress all non-error output                               [boolean]\n  -j, --json    format all output as json                                   [boolean]\n  -b, --btc     display btc specific information where applicable           [boolean]\n  --help        show help                                                   [boolean]\n\nYou must specify a command.\n```\n\n### Submitting a hash\n\nFirst you'll need to generate a hash of a local file or data\nof your choice. We recommended using the [SHA256](https://en.wikipedia.org/wiki/SHA-2) one-way cryptographic hash function. Other hash types will also be accepted as long as they are hex strings between 40 and 128 hex characters (`[0-9a-fA-F]`) in length.\n\nThe Chainpoint Network only sees a hash of your data, never the\noriginal. It is not possible for us to learn anything about your\ndata from the hash.\n\nTo submit a hash, simply call:\n\n```\nchp submit 2e75eaf17b8345c67234dfa92e867541ef41dda08baa6f8d5464fac432950794\n52eb62c0-f556-11e7-bcf8-016fed1c55ad | 2e75eaf17b8345c67234dfa92e867541ef41dda08baa6f8d5464fac432950794 | submitted\n```\n\nThe output returned consists of three parts:\n\nThe `proof_id` is `52eb62c0-f556-11e7-bcf8-016fed1c55ad` in this example. This type 1 UUID serves as a handle to retrieve a proof.\n\nThe original hash you submitted (`2e75eaf17b8345c67234dfa92e867541ef41dda08baa6f8d5464fac432950794`) is echoed back.\n\nThe action that occurred, `submitted` in this case, is returned.\n\nYou can also submit multiple hashes at once by calling `submit` with multiple hashes.\n\n```\nchp submit \u003chash\u003e \u003chash\u003e \u003chash\u003e\n```\n\n### Updating a Proof\n\nOnce a hash has been submitted, it will first be anchored to the `Calendar` and a proof will be generated. A proof that anchors your hash to the Calendar is generally available within ten seconds or less.\n\n```\nchp update 52eb62c0-f556-11e7-bcf8-016fed1c55ad\n52eb62c0-f556-11e7-bcf8-016fed1c55ad | updated | cal\n```\n\nYou can see that you call `chp update` and just pass the `proof_id` as well.\n\nYou'll see echoed back to you the status, where the `cal` at the end indicates that the proof is anchored to the `Calendar`. Later you will see other blockchain anchors become available, such as `btc` to indicate that a\nhash was anchored to the Bitcoin blockchain.\n\nYou can also call `chp update --all` to update all proofs locally stored.\n\n### Verifying a Proof\n\nVerifying a proof submits it to the Node for cryptographic verification that the hash captured in the proof is anchored all the way up to either the Calendar or to public blockchains. The Calendar contains all of the information needed to verify a proof.\n\n```\nchp verify 52eb62c0-f556-11e7-bcf8-016fed1c55ad\n52eb62c0-f556-11e7-bcf8-016fed1c55ad | verified | cal\n```\n\nYou can see here that the proof represented by the `proof_id` provided is anchored to the Calendar (`cal`) level.\n\n### Viewing a Proof\n\nYou can of course view a proof in its entirety by asking\nto see the proof associated with a `proof_id`.\n\n```\nchp --gateway-uri http://3.136.178.15 show 5e0433d0-46da-11ea-a79e-017f19452571 | jq\n\n{\n  \"@context\": \"https://w3id.org/chainpoint/v4\",\n  \"type\": \"Chainpoint\",\n  \"hash\": \"ffff27222fe366d0b8988b7312c6ba60ee422418d92b62cdcb71fe2991ee7391\",\n  \"proof_id\": \"5e0433d0-46da-11ea-a79e-017f19452571\",\n  \"hash_received\": \"2020-02-03T23:10:28Z\",\n  \"branches\": [\n    {\n      \"label\": \"aggregator\",\n      \"ops\": [],\n      \"branches\": [\n        {\n          \"label\": \"cal_anchor_branch\",\n          \"ops\": [\n            {\n              \"l\": \"nistv2:1580771400:d5aa7ffdada5f6b9c6743ffd245c1d2b2ca32c68eca35576181c882f77cecda3a304d8ea4f9a0293831095187f6b5a0bfda1bd79d93da2badd45edf406b5691d\"\n            },\n            {\n              \"op\": \"sha-256\"\n            },\n            {\n              \"anchors\": [\n                {\n                  \"type\": \"tcal\",\n                  \"anchor_id\": \"7159fe850b6ddb51ff50dc4d44b1aa363128e52ad49f21fd68b1cd0c77afa64d\",\n                  \"uris\": [\n                    \"http://3.135.54.225/calendar/7159fe850b6ddb51ff50dc4d44b1aa363128e52ad49f21fd68b1cd0c77afa64d/data\"\n                  ]\n                }\n              ]\n            }\n          ],\n          \"branches\": [\n            {\n              \"label\": \"btc_anchor_branch\",\n              \"ops\": [\n                {\n                  \"r\": \"f472ed9ff3018dfd499d7b2cd8f1fc7905c4b7204bac2bd7050b153391987ca6\"\n                },\n                {\n                  \"op\": \"sha-256\"\n                },\n                {\n                  \"l\": \"ba707b57f9eadb627d9393417df9b28e382ad9efec15e48ecc8d96fa87ba2079\"\n                },\n                {\n                  \"op\": \"sha-256\"\n                },\n                {\n                  \"l\": \"0100000001161056cfe33bb565f50cff84e30b5d14720d4a7172ab246be96f3d28ba22b8810000000000ffffffff020000000000000000226a20\"\n                },\n                {\n                  \"r\": \"08e0ee0500000000160014a2ae5c0fec0e93b33d25909f42b24877376d25cc00000000\"\n                },\n                {\n                  \"op\": \"sha-256-x2\"\n                },\n                {\n                  \"l\": \"7cac66fad58fb08cacd6776a8a0809d9021fcebe2d5c0213c896efceda5bf36a\"\n                },\n                {\n                  \"op\": \"sha-256-x2\"\n                },\n                {\n                  \"l\": \"30da4ce3b26c504efbea5fb9f4b2ec8f90e813903d60571fe66a0024f3cd8bf9\"\n                },\n                {\n                  \"op\": \"sha-256-x2\"\n                },\n                {\n                  \"r\": \"d2fb192142c66f660fe90289f3348e359d77961f74eec41c0dc4b807bbc2b91e\"\n                },\n                {\n                  \"op\": \"sha-256-x2\"\n                },\n                {\n                  \"r\": \"43272a988b0fadf0c1bcebed5fd7e9bd7997e42fa8f363ca319a150ec70b24d4\"\n                },\n                {\n                  \"op\": \"sha-256-x2\"\n                },\n                {\n                  \"r\": \"83dc9a9f490a8590bd7e213b9e4383be3f7b31e23d54c811aca00fe4eec9f939\"\n                },\n                {\n                  \"op\": \"sha-256-x2\"\n                },\n                {\n                  \"r\": \"272e88bfa321f02d2b4c1a16b71daa04048cb643fc4b8b6b581488f0b6a9845f\"\n                },\n                {\n                  \"op\": \"sha-256-x2\"\n                },\n                {\n                  \"r\": \"7eeb158ac9fdec5b3c69b0218eeb2632a1e77307197f159499d195fae34756f8\"\n                },\n                {\n                  \"op\": \"sha-256-x2\"\n                },\n                {\n                  \"r\": \"d05416db085e08e0bfd3bdad3195f1e94d49db825007c662777d825d37951c56\"\n                },\n                {\n                  \"op\": \"sha-256-x2\"\n                },\n                {\n                  \"r\": \"a1db66df5ca62af0c0fc5bcd28116b4d2d4a47f8c18a9fe08209cb358fba0f6c\"\n                },\n                {\n                  \"op\": \"sha-256-x2\"\n                },\n                {\n                  \"anchors\": [\n                    {\n                      \"type\": \"tbtc\",\n                      \"anchor_id\": \"1664848\",\n                      \"uris\": [\n                        \"http://3.135.54.225/calendar/1eedc4483110bc656cf21e39a8b77041798ef49b8b0a5cd266f3060d81087fb7/data\"\n                      ]\n                    }\n                  ]\n                }\n              ]\n            }\n          ]\n        }\n      ]\n    }\n  ]\n}\n```\n\nYou can see in this case I piped the output of the `show` sub-command to the `jq` program. This is just for viewing convenience so we can see the pretty-printed version of the proof.\n\n### Evaluating a proof\n\n`evaluate \u003chash_id\u003e` calculates and displays the expected values for each anchor in the proof.\nAdding `--btc` or `-b` will return the txid of the anchor transaction.\n\n```\nchp evaluate b640f9f0-3661-11e9-9c57-018b108544a2\n\nb640f9f0-3661-11e9-9c57-018b108544a2 | cal | 2755298 | ab1dc08a1950ade9d4d603c90d655307eb765905148f6e18eddeb64ca241b7b4\nb640f9f0-3661-11e9-9c57-018b108544a2 | btc | 564116 | af81bc00748ed3beab4f08ad16b33bb88aefdc0a283eb4446cf8d83b38ea7133 | 7cdcefb56c2ec3230b2edb2ff5d1adf4a8acf4525850e1f0248b803cfe96dd02\n\n```\n\n### Other commands\n\n`list` will show you a list of all hash IDs and hashes that have been submitted from this CLI client.\n\n`export` allows you to export a proof in either JSON or binary file formats.\n\n`delete \u003chash_id\u003e` allows you to manually delete any hash from your local DB.\n\nYou can also get JSON output by passing in the `--json` flag. For example:\n\n```\nchp verify --json 52eb62c0-f556-11e7-bcf8-016fed1c55ad\n```\n\n### Interacting with a Bitcoin Header Node (BHN)\n\nFollowing the `chp` command with `bhn` will pass along any commands and options to the Bitcoin Header Node Interface.\nAll data associated the instance of bhn is stored by default in the `/.chainpoint/bhn` data directory. As with the\nprimary `chp` command, you can see a list of `bhn` options by simply typing `chp bhn`\n\n```\n$ chp bhn\n\nUsage: bhn \u003ccommand\u003e [options...]\n\nCommands:\n  chp bhn execute \u003cmethod\u003e          fire an arbitrary rpc method to\n  [options..]                          the bitcoin header node. e.g.\n                                       `chp bhn execute getpeerinfo`\n  chp bhn get \u003cblock-height\u003e        get the header for a block at a\n  [header node options...]             certai block. Must point to a\n                                       running bhn server\n  chp bhn info [header node         get info about a bitcoin header\n  options...]                          node. With no options set it\n                                       will check locally and indicate\n                                       if none is running\n  chp bhn start [header node        start a bitcoin header node\n  options...]                          locally\n  chp bhn stop [header node         stop a bitcoin header node\n  options...]\n\nOptions:\n  --version       Show version number                         [boolean]\n  -g, --gateway-uri  specify uri of chainpoint gateway        [string]\n  -q, --quiet     suppress all non-error output               [boolean]\n  -j, --json      format all output as json                   [boolean]\n  --bhn-uri       full uri of bitcoin header node. If no port is given,\n                  assumed default RPC port for Bitcoin Mainnet (8332)\n  --bhn-api-key   api key if target node requires authentication\n  --bhn-host      host of target bitcoin header node\n                                                 [default: \"localhost\"]\n  --bhn-port      port of target bitcoin header node if different from\n                  default bitcoin RPC port\n  --bhn-network   Bitcoin network the target node is running on. This\n                  option is useful if want to target default ports.\n                  (--network also works)              [default: \"main\"]\n  --bhn-protocol  protocol where target bitcoin header node is running\n                                                     [default: \"http:\"]\n  --help          Show help                                   [boolean]\n\n```\n\n### Starting BHN\n\nBefore you can verify btc anchors locally, you need to sync up a bhn node.\nBy default a mainnet node will be started with no api key, and at the Chainpoint starting height\nof Block #337022. All of these can be customized with the above options.\n\n```bash\n$ chp bhn start\n```\n\nYour terminal will output the connection configuration for your node and prompt for a confirmation\nbefore starting up. Note that bhn currently takes up the current process and you will need to open another\nterminal session to interact with it.\n\n### Proof verification against local node\n\nLocal verification happens automatically if you have a node already running.\nNote that you shouldn't pass the `bhn` prefix for this, just make sure to pass in any\nnecessary connection configs such as API key or host information when running the `verify` command.\nYou can even verify against a node you have running remotely and will work against normal bcoin Full or\nSPV Nodes too.\n\nIf no node matching the configs can be connected to, then the CLI will fallback to using Chainpoint Gateways.\n\n```bash\n$ chp verify -a\n```\n\n### Other interactions\n\nHere are some other useful commands you can run in another terminal window once your node is running\n\nTo get running info of your node, including sync status:\n\n```bash\n$ chp bhn info\n```\n\nTo get a block header at a specific height:\n\n```bash\n$ chp bhn get 500000\n```\n\nTo execute arbitrary rpc commands:\n\n```bash\n# this gets the block your node started syncing from\n$ chp bhn execute getstartheader\n# and this gets information about the peers you're connected to\n$ chp bhn execute getpeerinfo\n```\n\nCheck out the [bcoin api documentation](http://bcoin.io/api-docs/index.html#rpc-calls-node)\nfor more avaialable RPC commands.\n\n### Help\n\nYou should note that each of the sub-commands also has its own help screen.\n\n```\n$ chp submit --help\nUsage: submit [options] (\u003chash\u003e \u003chash\u003e... | \u003chash\u003e,\u003chash\u003e,... )\n\nOptions:\n  -g, --gateway-uri  specify uri of chainpoint gateay\n                                  [string] [default: \"http://GATEWAY_URI\"]\n  -q, --quiet   suppress all non-error output                          [boolean]\n  -j, --json    format all output as json                              [boolean]\n  --help        show help                                              [boolean]\n```\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchainpoint%2Fchainpoint-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchainpoint%2Fchainpoint-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchainpoint%2Fchainpoint-cli/lists"}