signrawtransactionwithkey (22.0.0 RPC) blockchain getbestblockhash getblock getblockchaininfo getblockcount getblockfilter getblockhash getblockheader getblockstats getchaintips getchaintxstats getdifficulty getmempoolancestors getmempooldescendants getmempoolentry getmempoolinfo getrawmempool gettxout gettxoutproof gettxoutsetinfo preciousblock pruneblockchain savemempool scantxoutset verifychain verifytxoutproof control getmemoryinfo getrpcinfo help logging stop uptime generating generateblock generatetoaddress generatetodescriptor mining getblocktemplate getmininginfo getnetworkhashps prioritisetransaction submitblock submitheader network addnode clearbanned disconnectnode getaddednodeinfo getconnectioncount getnettotals getnetworkinfo getnodeaddresses getpeerinfo listbanned ping setban setnetworkactive rawtransactions analyzepsbt combinepsbt combinerawtransaction converttopsbt createpsbt createrawtransaction decodepsbt decoderawtransaction decodescript finalizepsbt fundrawtransaction getrawtransaction joinpsbts sendrawtransaction signrawtransactionwithkey testmempoolaccept utxoupdatepsbt signer enumeratesigners util createmultisig deriveaddresses estimatesmartfee getdescriptorinfo getindexinfo signmessagewithprivkey validateaddress verifymessage wallet abandontransaction abortrescan addmultisigaddress backupwallet bumpfee createwallet dumpprivkey dumpwallet encryptwallet getaddressesbylabel getaddressinfo getbalance getbalances getnewaddress getrawchangeaddress getreceivedbyaddress getreceivedbylabel gettransaction getunconfirmedbalance getwalletinfo importaddress importdescriptors importmulti importprivkey importprunedfunds importpubkey importwallet keypoolrefill listaddressgroupings listdescriptors listlabels listlockunspent listreceivedbyaddress listreceivedbylabel listsinceblock listtransactions listunspent listwalletdir listwallets loadwallet lockunspent psbtbumpfee removeprunedfunds rescanblockchain send sendmany sendtoaddress sethdseed setlabel settxfee setwalletflag signmessage signrawtransactionwithwallet unloadwallet upgradewallet walletcreatefundedpsbt walletdisplayaddress walletlock walletpassphrase walletpassphrasechange walletprocesspsbt zmq getzmqnotifications signrawtransactionwithkey "hexstring" ["privatekey",...] ( [{"txid":"hex","vout":n,"scriptPubKey":"hex","redeemScript":"hex","witnessScript":"hex","amount":amount},...] "sighashtype" ) Sign inputs for raw transaction (serialized, hex-encoded). The second argument is an array of base58-encoded private keys that will be the only keys used to sign the transaction. The third optional argument (may be null) is an array of previous transaction outputs that this transaction depends on but may not yet be in the block chain. Arguments: 1. hexstring (string, required) The transaction hex string 2. privkeys (json array, required) The base58-encoded private keys for signing [ "privatekey", (string) private key in base58-encoding ... ] 3. prevtxs (json array, optional) The previous dependent transaction outputs [ { (json object) "txid": "hex", (string, required) The transaction id "vout": n, (numeric, required) The output number "scriptPubKey": "hex", (string, required) script key "redeemScript": "hex", (string) (required for P2SH) redeem script "witnessScript": "hex", (string) (required for P2WSH or P2SH-P2WSH) witness script "amount": amount, (numeric or string) (required for Segwit inputs) the amount spent }, ... ] 4. sighashtype (string, optional, default="DEFAULT") The signature hash type. Must be one of: "DEFAULT" "ALL" "NONE" "SINGLE" "ALL|ANYONECANPAY" "NONE|ANYONECANPAY" "SINGLE|ANYONECANPAY" Result: { (json object) "hex" : "hex", (string) The hex-encoded raw transaction with signature(s) "complete" : true|false, (boolean) If the transaction has a complete set of signatures "errors" : [ (json array, optional) Script verification errors (if there are any) { (json object) "txid" : "hex", (string) The hash of the referenced, previous transaction "vout" : n, (numeric) The index of the output to spent and used as input "scriptSig" : "hex", (string) The hex-encoded signature script "sequence" : n, (numeric) Script sequence number "error" : "str" (string) Verification or signing error related to the input }, ... ] } Examples: > bitcoin-cli signrawtransactionwithkey "myhex" "[\"key1\",\"key2\"]" > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "signrawtransactionwithkey", "params": ["myhex", "[\"key1\",\"key2\"]"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/