Verifiable Credentials
This document is a comprehensive listing of CLI commands for interacting with Chia VCs.
Reference
add_proof_reveal
Functionality: Add a series of proofs that will combine to a single proof hash
Usage: chia wallet vcs add_proof_reveal [OPTIONS]
Options:
Short Command | Long Command | Type | Required | Description |
---|---|---|---|---|
-wp | --wallet-rpc-port | INTEGER | False | Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml |
-f | --fingerprint | INTEGER | False | Set the fingerprint to specify which key to use |
-p | --proof | TEXT | True* | A flag to add as a proof |
-r | --root-only | None | False | If this flag is set, do not add the proofs to the DB, just output the root from the specified proofs [Default: not set] |
-h | --help | None | False | Show a help message and exit |
Example 1
Add two proofs:
chia wallet vcs add_proof_reveal -f 2108245669 --proof test_proof1 --proof test_proof2
Response:
Proofs added to DB successfully!
Example 2
Get the root hash of the tree created from adding two proofs:
chia wallet vcs add_proof_reveal -f 2108245669 --proof test_proof1 --proof test_proof2 --root-only
Response:
Proof Hash: f063e22557705b14425b8fca60018796b4364eb6354f45d0b99431a71d3043e5
get
Functionality: Get a list of existing VCs
Usage: chia wallet vcs get [OPTIONS]
Options:
Short Command | Long Command | Type | Required | Description |
---|---|---|---|---|
-wp | --wallet-rpc-port | INTEGER | False | Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml |
-f | --fingerprint | INTEGER | False | Set the fingerprint to specify which key to use |
-s | --start | INTEGER | False | The index to start the list at [default: 0] |
-c | --count | INTEGER | False | How many results to return [default: 50] |
-h | --help | None | False | Show a help message and exit |
Example
chia wallet vcs get -f 2108245669
Response:
Proofs:
Launcher ID: 89a4ff17372dd3a8814712c0988b87b508a04cd7fa61d0228ce54b74111e7160
Coin ID: 72e522fecc64b539f8979b89e4cf2ffbcf8ba985faf4b701bcc882c6aec9e040
Inner Address: txch1at35qwx6djmadnh9v77a72z8vcaxsle36ke3dj26gcpt2fnh654qsqecnj
get_proofs_for_root
Functionality: Get the stored proof flags for a given proof hash
Usage: chia wallet vcs get_proofs_for_root [OPTIONS]
Options:
Short Command | Long Command | Type | Required | Description |
---|---|---|---|---|
-wp | --wallet-rpc-port | INTEGER | False | Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml |
-f | --fingerprint | INTEGER | False | Set the fingerprint to specify which key to use |
-r | --proof-hash | TEXT | True | The root to search for |
-h | --help | None | False | Show a help message and exit |
Note that if the root is not currently stored in the VC, the command will fail.
Example
Search for a hash currently stored in the VC:
chia wallet vcs get_proofs_for_root -f 2108245669 --proof-hash f063e22557705b14425b8fca60018796b4364eb6354f45d0b99431a71d3043e5
Response:
Proofs:
- test_proof1
- test_proof2
mint
Functionality: Mint a VC
Usage: chia wallet vcs mint [OPTIONS]
Options:
Short Command | Long Command | Type | Required | Description |
---|---|---|---|---|
-wp | --wallet-rpc-port | INTEGER | False | Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml |
-f | --fingerprint | INTEGER | False | Set the fingerprint to specify which key to use as the issuing wallet |
-d | --did | TEXT | True | The DID of the VC's proof provider. Must be owned by the issuing wallet |
-t | --target-address | TEXT | False | The address to send the VC to once it's minted [Default: send to minting wallet] |
-m | --fee | TEXT | False | Blockchain fee for mint transaction, in XCH |
-h | --help | None | False | Show a help message and exit |
Example
A DID is required in order to mint a new VC. If the proof provider does not already have a DID, use the did create
command to create one. For example:
chia wallet did create -f 2108245669 -n Provider_DID -m 0.0001
Response:
Successfully created a DID wallet with name Provider_DID and id 2 on key 2108245669
Successfully created a DID did:chia:1n2s77g7rer2v62xzrvd0at6tgx8m4g8t6encghs375r64lc6e5mssdkap3 in the newly created DID wallet