identity_verifyCredential
identity_verifyCredential
validates a zkSBT proof against issuer schemas and revocation registries, returning a verdict that can be enforced inside off-chain policy engines.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
proof | string | Yes | Base64 or hex-encoded proof generated via zk_generateProof . |
schemaId | string | Yes | Identifier of the credential schema. |
publicInputs | array | Yes | Ordered public inputs committed during proof generation. |
proveKeyRef | string | Optional | Reference to the Prove Key expected by the verifier. |
at | string | Optional | Block hash to verify state at a specific height. |
Returns
Field | Type | Description |
---|---|---|
valid | boolean | true when the proof satisfies schema constraints and revocation checks. |
reason | string | Optional error message when validation fails. |
issuer | string | DID of the issuing entity for auditing. |
revocationState | object | Snapshot of revocation data consulted during verification. |
Request Example
{
"jsonrpc": "2.0",
"method": "identity_verifyCredential",
"params": [{
"proof": "0x8f4c...",
"schemaId": "zksbt:kyc-tier2",
"publicInputs": ["0x01", "0x6f36..."],
"proveKeyRef": "ipfs://bafkreihd...",
"at": "0x3b5dcb0d26f0a21cb88d5df4fe7e88f7a8e50a6b9c6e3a57306d98e010ce4081"
}],
"id": 42
}
Usage Patterns
- Gate access to permissioned DeFi pools by requiring a valid KYC credential at execution time.
- Enforce jurisdiction limits by embedding country codes inside schema public inputs.
- Record audit logs whenever
valid
istrue
, including block hash and issuer DID for regulators.
Errors
Code | Meaning | Fix |
---|---|---|
-42001 | Proof invalid | Regenerate the proof with the latest Prove Key artifacts. |
-42002 | Credential revoked | Notify the user to re-run KYC and mint a fresh zkSBT. |
-32602 | Invalid params | Ensure publicInputs order matches schema expectations. |
Combine identity_verifyCredential
with state_getStorage
to build verifiable compliance reports per jurisdiction.