@choiceproof/cli
v2.2.1
Published
CLI for offline verification of enterprise-held receipts against portable ChoiceProof commitments.
Downloads
152
Maintainers
Readme
@choiceproof/cli
The ChoiceProof CLI independently verifies enterprise-held receipts and Evidence v2 artifacts. Offline verification does not require a ChoiceProof API or a ChoiceProof-controlled RPC endpoint.
Release status
The stable 2.2.1 release is published on npm's latest channel. Run
the exact version with:
pnpm dlx @choiceproof/[email protected] --helpThe package is ESM-only and requires Node.js 20 or newer.
The active current-product commands are:
commitment verifyfor enterprise-local receipt/commitment verification;evidence verifyfor explicit local Evidence v2 artifacts and trust policy;evidence gateway bundlefor public checkpoint-bundle readback;evidence gateway publishfor guarded public-only artifact publication;evidence finality collect-base,verify-base, andattest-basefor explicit Base RPC observation, offline transcript verification, and signed external-finality statements.
Policy, quote, receipt-bundle, challenge, and demo commands remain historical prototype tooling; they are not the active commitment or Evidence v2 flow.
Build
Prerequisites are Node.js 20 or newer and Corepack. From the repository root:
corepack enable
corepack pnpm install --frozen-lockfile
corepack pnpm --filter @choiceproof/sdk build
corepack pnpm --filter @choiceproof/cli build
node packages/cli/dist/index.js --helpRun the Evidence v2 offline quickstart
From the repository root, the SDK example builds an enterprise-local event and envelope, signed checkpoint, inclusion proof, explicit trust policy, and offline verification report:
corepack pnpm quickstart:evidence-v2The default run makes no network request and writes no application file. See
docs/EVIDENCE_V2_QUICKSTART.md for
the fixed vector and the separately guarded public Gateway publish/readback
mode. Use evidence verify --artifacts <file> --policy <file> when verifying
your own persisted local artifact set.
Create local receipt-commitment quickstart artifacts
The SDK example generates an in-memory temporary signer, a private local receipt, and a separate public commitment:
git check-ignore -q .choiceproof/quickstart/receipt.private.json
corepack pnpm exec tsx packages/sdk/examples/receipt-commitment.tsDo not continue if git check-ignore fails. The complete receipt must not be
committed or uploaded.
Offline verification
node packages/cli/dist/index.js commitment verify \
--receipt .choiceproof/quickstart/receipt.private.json \
--commitment .choiceproof/quickstart/commitment.public.jsonWithout --rpc, the command performs no network request. It validates the
commitment envelope, recomputes the canonical Keccak-256 hashes, verifies the
enterprise EIP-712 signature, and reports
anchor.status = "not_requested".
The JSON report separates core cryptographic validity from optional chain readback. Exit status is:
0when every required check passes;1for malformed input, hash or signature failure, an invalid domain, an anchor mismatch, or an unmet--require-anchorcondition.
Optional verifier-selected Base Sepolia readback
The verifier may select an RPC directly:
node packages/cli/dist/index.js commitment verify \
--receipt .choiceproof/quickstart/receipt.private.json \
--commitment .choiceproof/quickstart/commitment.public.json \
--rpc https://your-base-sepolia-rpc.exampleRequire a confirmed anchor as part of the exit status only when an RPC is also provided:
node packages/cli/dist/index.js commitment verify \
--receipt .choiceproof/quickstart/receipt.private.json \
--commitment .choiceproof/quickstart/commitment.public.json \
--rpc https://your-base-sepolia-rpc.example \
--require-anchorThe complete receipt stays on the verifier's machine. Only the public hash key is used for direct contract readback. Base Sepolia is a testnet and does not constitute a production-mainnet guarantee.
License
Apache-2.0.
