signrawtransactionwithkey help misleading #20084

issue instagibbs opened this issue on October 5, 2020
  1. instagibbs commented at 3:21 PM on October 5, 2020: member

    "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."

    This RPC call has no concept of blockchains. Does this third argument have to be mandatory? What should the help text say?

  2. ghost commented at 11:52 PM on October 6, 2020: none

    Does this third argument have to be mandatory?

    I don't think it should be mandatory as signing the tx can be done without it. Never had issues.

    This RPC call has no concept of blockchains.

    Yes even I am unable to understand why signing a raw transaction would require this argument and if it does how would it be different if parent tx is not confirmed. I am still new to Bitcoin core so tried doing a test to confirm if I get any errors.

    Tx was still not confirmed. Tried to create a raw transaction for spending one of the outputs and sign it. Had no issues.

    <pre><code>createrawtransaction "[{\"txid\":\"98fe1985b800b87a5196c2d1d01980a9930532b0f9b8c5488bfde273cf9b1b01\",\"vout\":1}]" "[{\"tb1qlu4kjktgcdru8cjnlx47me2ha4phxgceg2v4mj\":0.01}]"</pre></code>

    <pre><code>signrawtransactionwithkey "0200000001011b9bcf73e2fd8b48c5b8f9b0320593a98019d0d1c296517ab800b88519fe980100000000ffffffff0140420f0000000000160014ff2b695968c347c3e253f9abede557ed4373231900000000" "[\"cRFMFNU3oy8H4hzgkupFkygPkTEWzKDUEQTHzqDfYNKUMP5rn29N\"]"</pre></code>

    <pre> { "hex": "02000000000101011b9bcf73e2fd8b48c5b8f9b0320593a98019d0d1c296517ab800b88519fe980100000000ffffffff0140420f0000000000160014ff2b695968c347c3e253f9abede557ed4373231902473044022058ec12316a8c1adef07e92f0c44150b6688a19954ff917bcf9d7cfcdaa1baa6402203674b52920a8ede5dd6f70ba2f7f380f81a2c6faa4dea019627400f25b67bd7d0121023d4a558a3b882a9d80c5b1752dabbff4471f50055611aaaa17156f210dd65e8300000000", "complete": true } </pre>

  3. achow101 commented at 1:39 AM on October 7, 2020: member

    Yes even I am unable to understand why signing a raw transaction would require this argument and if it does how would it be different if parent tx is not confirmed.

    It's there for transactions which has parents that aren't in either the blockchain or the mempool. Data from previous transactions is necessary for signing. Typically this RPC uses the UTXO set, but if the inputs are not in the UTXO set, the third argument can be used to provide this information.

    Does this third argument have to be mandatory?

    It isn't..

  4. instagibbs commented at 1:43 AM on October 7, 2020: member

    It isn't..

    This is a prescriptive question, not descriptive.

    That said, I didn't know the extend it was using blockchain introspection. Perhaps this can be better detailed in the help. Closing this issue for now.

  5. instagibbs closed this on Oct 7, 2020

  6. DrahtBot locked this on Feb 15, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-27 03:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me