Language

Choose a language

/build/rpc / cosign / discussion

cosign.verify_discussion_proof

cosign.verify_discussion_proof "utxo_ref" "address" "message" "signature" claimed_units Verify a BIP-322 discussion proof using strict rules (confirmed UTXOs, bestblock chain binding). Message format: TENSORCASH_DISCUSS:v1:<network>:<scope_type>:<scope_id>:<nostr_pubkey>:<expiry_height> Arguments: 1. utxo_ref (string, required) UTXO reference in 'txid:vout' format 2. address (string, required) Bitcoin address controlling the UTXO 3. message (string, required) Signed message (TENSORCASH_DISCUSS:v1:...) 4. signature (string, required) BIP-322 signature 5. claimed_units (numeric, required) Minimum units the proof must cover Result: { (json object) "verified" : true|false, (boolean) Whether the proof passed all checks "error" : "str", (string, optional) Error description if verification failed "actual_units" : n, (numeric) Actual units in the UTXO "bestblock" : "str", (string) Best block hash at time of verification "network" : "str", (string, optional) Extracted network from message "scope_type" : "str", (string, optional) Extracted scope type from message "scope_id" : "str", (string, optional) Extracted scope ID from message "nostr_pubkey" : "str", (string, optional) Extracted Nostr pubkey from message "expiry_height" : n (numeric, optional) Extracted expiry block height from message } Examples: > bitcoin-cli cosign.verify_discussion_proof "txid:0" "addr" "TENSORCASH_DISCUSS:v1:regtest:model_prealert:abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef:1000" "sig" 10000

Signature

cosign.verify_discussion_proof(utxo_ref: string, address: string, message: string, signature: string, claimed_units: number) → any

Code samples

curl --user "$RPC_USER:$RPC_PASS" \
  --data-binary '{"jsonrpc":"1.0","id":"docs","method":"cosign.verify_discussion_proof","params":["\"<utxo_ref>\"","\"<address>\"","\"<message>\"","\"<signature>\"",0]}' \
  -H 'content-type: text/plain;' \
  http://127.0.0.1:8332/

Parameters

NameTypeReq.Description
utxo_refstringyesUTXO reference in 'txid:vout' format
addressstringyesBitcoin address controlling the UTXO
messagestringyesSigned message (TENSORCASH_DISCUSS:v1:...)
signaturestringyesBIP-322 signature
claimed_unitsnumberyesMinimum units the proof must cover

Result

Type:  any

{ (json object) "verified" : true|false, (boolean) Whether the proof passed all checks "error" : "str", (string, optional) Error description if verification failed "actual_units" : n, (numeric) Actual units in the UTXO "bestblock" : "str", (string) Best block hash at time of verification "network" : "str", (string, optional) Extracted network from message "scope_type" : "str", (string, optional) Extracted scope type from message "scope_id" : "str", (string, optional) Extracted scope ID from message "nostr_pubkey" : "str", (string, optional) Extracted Nostr pubkey from message "expiry_height" : n (numeric, optional) Extracted expiry block height from message }

Source: services/core-node/bcore/src/rpc/cosign.cpp:3591

C++ symbol: cosign_verify_discussion_proof