Skip to main content
Version: v4 (next)

Update a Credential Schema

MOD-CS-MSG-2

Update the validity periods attached to an existing credential schema. This operation is delegable. It does not change the JSON Schema itself or the onboarding modes; it only adjusts how long validations remain effective for each role.

Prerequisites

This is a delegable transaction executed on behalf of a Corporation. Before running it you need:

  1. A Corporation (policy_address) that controls the Ecosystem owning this schema — see Create a Corporation.
  2. The policy funded with uvna for fees.
  3. An operator granted authorization for /verana.cs.v1.MsgUpdateCredentialSchema via Grant Operator Authorization.

Sign with --from <operator> and pass the corporation's policy_address with the --corporation flag.

Message Parameters

NameDescriptionMandatory
idID of the credential schema to updateyes
--issuer-grantor-validation-validity-periodDays an issuer-grantor validation remains validno
--verifier-grantor-validation-validity-periodDays a verifier-grantor validation remains validno
--issuer-validation-validity-periodDays an issuer validation remains validno
--verifier-validation-validity-periodDays a verifier validation remains validno
--holder-validation-validity-periodDays a holder validation remains validno

Each flag takes the wrapped-integer form '{"value":N}'. A value of 0 means never expires.

Required Environment Variables

CORPORATION=verana1f6fyc0ptxh7padqr3hnrw6sm8wjfr93w6cgv39jwm00nd6kh08esdak22l
OPERATOR=verana1qrdyvgf74jpu5kxufg0gczz5rfv0ws646t3kw4
SCHEMA_ID=1
CHAIN_ID=vna-testnet-1
NODE_RPC=https://rpc.testnet.verana.network

Post the Message

Usage

veranad tx cs update [id] \
--corporation <policy_address> \
[--issuer-grantor-validation-validity-period '{"value":N}'] \
[--verifier-grantor-validation-validity-period '{"value":N}'] \
[--issuer-validation-validity-period '{"value":N}'] \
[--verifier-validation-validity-period '{"value":N}'] \
[--holder-validation-validity-period '{"value":N}'] \
--from <operator> --chain-id <chain-id> --keyring-backend test --fees <amount> --gas auto --node $NODE_RPC

The --from flag is the operator (transaction signer); --corporation is the policy_address of the Corporation that controls the ecosystem owning this schema.

Example

veranad tx cs update $SCHEMA_ID \
--corporation $CORPORATION \
--issuer-grantor-validation-validity-period '{"value":365}' \
--verifier-grantor-validation-validity-period '{"value":365}' \
--issuer-validation-validity-period '{"value":180}' \
--verifier-validation-validity-period '{"value":180}' \
--holder-validation-validity-period '{"value":90}' \
--from $OPERATOR --chain-id $CHAIN_ID --keyring-backend test --fees 750000uvna --gas auto --node $NODE_RPC

Example response

The transaction emits an update_credential_schema event echoing the new validity periods:

code: 0
events:
- type: message
attributes:
- key: action
value: /verana.cs.v1.MsgUpdateCredentialSchema
- key: module
value: cs
- type: update_credential_schema
attributes:
- key: credential_schema_id
value: "1"
- key: ecosystem_id
value: "3"
- key: corporation
value: verana1f6fyc0ptxh7padqr3hnrw6sm8wjfr93w6cgv39jwm00nd6kh08esdak22l
- key: operator
value: verana1qrdyvgf74jpu5kxufg0gczz5rfv0ws646t3kw4
- key: issuer_grantor_validation_validity_period
value: "365"
- key: verifier_grantor_validation_validity_period
value: "365"
- key: issuer_validation_validity_period
value: "180"
- key: verifier_validation_validity_period
value: "180"
- key: holder_validation_validity_period
value: "90"
gas_used: "95271"
txhash: 497FB6ED9CA9822444366FB56DE495991E6244E1F7768A1C47A95DEEEC531015

Verify the update

Query the schema and inspect the validity fields:

veranad query cs get-schema $SCHEMA_ID --node $NODE_RPC --output json | jq

Notes

  • Validity values must be within the module parameter limits (see Module Parameters).
  • You cannot change onboarding modes with this command; create a new schema if you need different modes.
  • Only an operator authorized by the Corporation that controls the ecosystem owning the schema can update it.