A simple command-line tool for managing Decentralized Identifiers (DIDs), issuing Verifiable Credentials (VCs), and creating/verifying Verifiable Presentations (VPs) on Hedera using Ethereum-compatible JSON-RPC.
- Node.js (v18+ recommended)
- A Hedera-compatible JSON-RPC endpoint
- A
.envfile with the following variables:
PRIVATE_KEY=your-private-key
HEDERA_RPC=https://your-hedera-jsonrpc-endpointgit clone https://github.com/anmol-73/did-cli.git
cd did-cli
npm installEnsure your .env file is correctly set up before using the CLI.
Run the CLI using:
node index.js <command> [options]Or add executable permissions and run:
chmod +x index.js
./index.js <command> [options]Deploys a new DID Registry smart contract.
./index.js deployRegisters a new DID on the deployed registry. You can optionally specify a DID; otherwise, a random one is generated.
./index.js did:create -r <registry-address> [did]Fetches the controller address associated with a DID.
./index.js did:get-controller -r <registry-address> <did> Updates the controller of a DID to a new address. If a new controller is not specified, a random one is generated.
./index.js did:update-controller -r <registry-address> <did> [newController] Issues a new Verifiable Credential (VC).
./index.js vc:issue -s <subject-did> -r <registry-address> --claims-file '<path-to-json-containing-credential>'Lists all the verifiable credentials stored in the local wallet
./index.js vc:listCreates a Verifiable Presentation (VP) bundling one or more VCs.
./index.js vp:create --reveal-file 'path-to-json-with-information-about-fields-to-reveal'Verifies a Verifiable Presentation (VP).
./index.js vp:verify -p <path-to-json-with-vp> -r <registry-address>Make sure your .env file contains:
PRIVATE_KEY=your-private-key
HEDERA_RPC=https://your-hedera-jsonrpc-endpoint