Language

Choose a language

/build/rpc / adaptor

adaptor.extract_secret

adaptor.extract_secret "psbt" Recover adaptor secrets from a finalized PSBT that spent Taproot inputs (key-path or annotated script-path) using adaptor signatures. Arguments: 1. psbt (string, required) Base64-encoded PSBT Result: { (json object) "secrets" : [ (json array) Recovered adaptor secrets { (json object) "index" : n, (numeric) Input index "secret" : "hex" (string) Adaptor secret (32-byte hex) }, ... ] } Examples: > bitcoin-cli adaptor.prepare "psbt_base64"

Signature

adaptor.extract_secret(psbt: string) → any

Code samples

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

Parameters

NameTypeReq.Description
psbtstringyesBase64-encoded PSBT

Result

Type:  any

{ (json object) "secrets" : [ (json array) Recovered adaptor secrets { (json object) "index" : n, (numeric) Input index "secret" : "hex" (string) Adaptor secret (32-byte hex) }, ... ] }

Source: services/core-node/bcore/src/wallet/rpc/adaptor.cpp:3835

C++ symbol: adaptor_extract_secret