Language

Choose a language

/build/rpc / assets / governance_rotation

validate_ballot

validate_ballot "template_psbt" "ballot_psbt" Validate a single ballot PSBT before merging. Checks UTXO existence, signature validity, and proposal binding. Prevents malicious/invalid ballots from wasting issuer's time. Arguments: 1. template_psbt (string, required) Base64-encoded template PSBT 2. ballot_psbt (string, required) Base64-encoded ballot PSBT to validate Result: { (json object) "valid" : true|false, (boolean) Whether ballot is valid "error" : "str", (string, optional) Error message if invalid "ballot_units" : n, (numeric, optional) Voting units if valid "issues" : [ (json array, optional) List of validation issues "str", (string) Issue description ... ] } Examples: > bitcoin-cli validate_ballot "cHNidP8..." "cHNidP8..."

Signature

validate_ballot(template_psbt: string, ballot_psbt: string) → any

Code samples

curl --user "$RPC_USER:$RPC_PASS" \
  --data-binary '{"jsonrpc":"1.0","id":"docs","method":"validate_ballot","params":["\"<template_psbt>\"","\"<ballot_psbt>\""]}' \
  -H 'content-type: text/plain;' \
  http://127.0.0.1:8332/

Parameters

NameTypeReq.Description
template_psbtstringyesBase64-encoded template PSBT
ballot_psbtstringyesBase64-encoded ballot PSBT to validate

Result

Type:  any

{ (json object) "valid" : true|false, (boolean) Whether ballot is valid "error" : "str", (string, optional) Error message if invalid "ballot_units" : n, (numeric, optional) Voting units if valid "issues" : [ (json array, optional) List of validation issues "str", (string) Issue description ... ] }

Source: services/core-node/bcore/src/wallet/rpc/assets.cpp:7961

C++ symbol: validate_ballot