getdefaultctvhash

Back to rawtransactions

New since v30.2

Summary

Compute the BIP119-style default OP_CHECKTEMPLATEVERIFY hash for a serialized transaction input.

Description

Compute the BIP119-style default OP_CHECKTEMPLATEVERIFY hash for a serialized transaction input. This helper is protocol-neutral: it does not construct transactions, sign inputs, or interpret application-specific fields.

Change Buckets

  • New since v30.2

Arguments

  • hexstring (STR_HEX, required): The serialized transaction hex string
  • input_index (NUM, required): The zero-based input index to commit to
  • verbose (BOOL): Return the committed field breakdown

Results

  • ctvhash (STR_HEX): The default CTV hash, hex-encoded in script byte order
  • value (OBJ): No description.
  • ctvhash (STR_HEX): The default CTV hash, hex-encoded in script byte order
  • version (NUM): The transaction version
  • locktime (NUM): The transaction lock time
  • script_sigs_hash_included (BOOL): Whether the scriptSig hash is included
  • script_sigs_hash (STR_HEX, optional): Single-SHA256 of all serialized scriptSigs
  • input_count (NUM): The number of inputs committed as uint32
  • sequences_hash (STR_HEX): Single-SHA256 of all input nSequence values
  • output_count (NUM): The number of outputs committed as uint32
  • outputs_hash (STR_HEX): Single-SHA256 of all serialized outputs
  • input_index (NUM): The committed input index

Examples

qbit-cli getdefaultctvhash "hexstring" 0
qbit-cli getdefaultctvhash "hexstring" 0 true
curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "getdefaultctvhash", "params": ["hexstring", 0, true]}' -H 'content-type: application/json' http://127.0.0.1:8352/