Language

Choose a language

/build/rpc / adaptor

adaptor.prepare

adaptor.prepare "psbt" ( {"pubkeys":["pubkey",...]} allow_nontaproot_signeable_values ) Prepare a Fair-Sign adaptor ceremony by attaching public nonces and commitments to a PSBT. Inputs must be Taproot spends with wallet-controlled signing keys (key-path or annotated script-path). By default, rejects PSBTs with foreign unsigned non-Taproot inputs to prevent broken multi-party ceremonies. Arguments: 1. psbt (string, required) Base64-encoded PSBT 2. musig2_config (json object, optional) Optional MuSig2 configuration for cooperative multi-sig { "pubkeys": [ (json array, required) Array of public keys to aggregate (xonly 32-byte or compressed 33-byte hex) "pubkey", (string, required) Public key: xonly (32 bytes) or compressed (33 bytes) hex ... ], } 3. allow_nontaproot_signeable_values (boolean, optional, default=false) Allow non-Taproot inputs not owned or pre-signed by this wallet (UNSAFE for multi-party contracts; breaks atomicity) Result: { (json object) "psbt" : "str", (string) Updated PSBT "nonces" : [ (json array) Per-input nonce metadata exposed for audits and recovery { (json object) "index" : n, (numeric) Input index "mode" : "str", (string) nonce origin: single | musig_pubnonce | musig_aggnonce "signer" : n, (numeric) Signer index when mode=musig_pubnonce "nonce" : "hex" (string) Encoded public nonce }, ... ] } Examples: > bitcoin-cli adaptor.prepare "psbt_base64"

Signature

adaptor.prepare(psbt: string, musig2_config?: object, allow_nontaproot_signeable_values?: boolean) → any

Code samples

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

Parameters

NameTypeReq.Description
psbtstringyesBase64-encoded PSBT
musig2_configobjectOptional MuSig2 configuration for cooperative multi-sig { "pubkeys": [ (json array, required) Array of public keys to aggregate (xonly 32-byte or compressed 33-byte hex) "pubkey", (string, required) Public key: xonly (32 bytes) or compressed (33 bytes) hex ... ], }
allow_nontaproot_signeable_valuesbooleanAllow non-Taproot inputs not owned or pre-signed by this wallet (UNSAFE for multi-party contracts; breaks atomicity)

Result

Type:  any

{ (json object) "psbt" : "str", (string) Updated PSBT "nonces" : [ (json array) Per-input nonce metadata exposed for audits and recovery { (json object) "index" : n, (numeric) Input index "mode" : "str", (string) nonce origin: single | musig_pubnonce | musig_aggnonce "signer" : n, (numeric) Signer index when mode=musig_pubnonce "nonce" : "hex" (string) Encoded public nonce }, ... ] }

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

C++ symbol: adaptor_prepare