signmldsatransactionwithwallet
- workflowpost-quantum-signing·step 4 of 4Workflow: post-quantum-signing · step 4 of 4
signmldsatransactionwithwallet "hexstring" [{"txid":"hex","vout":n,"scriptPubKey":"hex","amount":amount},...] ( "sighashtype" ) Sign ML-DSA transaction inputs using keys from wallet. This RPC automatically looks up ML-DSA signing data in the wallet for all ML-DSA (witness v2) inputs. Arguments: 1. hexstring (string, required) The raw transaction hex string 2. prevtxs (json array, required) Previous transaction outputs being spent [ { (json object) "txid": "hex", (string, required) Transaction ID "vout": n, (numeric, required) Output index "scriptPubKey": "hex", (string, required) scriptPubKey of output "amount": amount, (numeric or string, required) Output value in BTC }, ... ] 3. sighashtype (string, optional, default="ALL") The sighash type (ALL, NONE, SINGLE, etc.) Result: { (json object) "hex" : "hex", (string) The signed transaction hex "complete" : true|false, (boolean) Whether the transaction is fully signed "errors" : [ (json array, optional) Signing errors { (json object) "input_index" : n, (numeric) Input index that failed "error" : "str" (string) Error message }, ... ] } Examples: > bitcoin-cli signmldsatransactionwithwallet "<hex>" '[{"txid":"...","vout":0,"scriptPubKey":"...","amount":0.01}]' > curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "signmldsatransactionwithwallet", "params": ["<hex>", [{"txid":"...","vout":0,"scriptPubKey":"...","amount":0.01}]]}' -H 'content-type: application/json' http://127.0.0.1:8332/
Signature
signmldsatransactionwithwallet(hexstring: string, prevtxs: array, sighashtype?: string) → any Code samples
curl --user "$RPC_USER:$RPC_PASS" \
--data-binary '{"jsonrpc":"1.0","id":"docs","method":"signmldsatransactionwithwallet","params":["\"<hexstring>\"",[],"ALL"]}' \
-H 'content-type: text/plain;' \
http://127.0.0.1:8332/ Parameters
| Name | Type | Req. | Description |
|---|---|---|---|
| hexstring | string | yes | The raw transaction hex string |
| prevtxs | any[] | yes | Previous transaction outputs being spent [ { (json object) "txid": "hex", (string, required) Transaction ID "vout": n, (numeric, required) Output index "scriptPubKey": "hex", (string, required) scriptPubKey of output "amount": amount, (numeric or string, required) Output value in BTC }, ... ] |
| sighashtype | string | — | The sighash type (ALL, NONE, SINGLE, etc.) |
Result
Type: any
{ (json object) "hex" : "hex", (string) The signed transaction hex "complete" : true|false, (boolean) Whether the transaction is fully signed "errors" : [ (json array, optional) Signing errors { (json object) "input_index" : n, (numeric) Input index that failed "error" : "str" (string) Error message }, ... ] }
Source: services/core-node/bcore/src/wallet/rpc/pq.cpp:488
C++ symbol: signmldsatransactionwithwallet