Specify SIGHASH_ to use with signrawtransaction #1606

pull gavinandresen wants to merge 2 commits into bitcoin:master from gavinandresen:sighash changing 2 files +27 −5
  1. gavinandresen commented at 4:14 PM on July 17, 2012: contributor

    I wanted this to create a transaction on testnet that exercised all of the SIGHASH_ modes (see txid 8ccc87b72d766ab3128f03176bb1c98293f2d1f85ebfaf07b82cc81ea6891fa9 on testnet3)

    It adds a fourth optional string argument to signrawtransaction, which can be ALL / NONE / SINGLE / ALL|ANYONECANPAY / etc. It just converts the string to one of the enum SIGHASH_ constants and then uses that signing mode when signing.

    I created that testnet transaction by:

    • I manually created a raw transaction with six inputs and 7 outputs
    • I extracted the private keys (using dumpprivkey) corresponding to the six inputs
    • I called signrawtransaction six times to sign each of the six inputs separately, passing in just one of the private keys and using a different SIGHASH_ mode each time.
    • I called sendrawtransaction to broadcast the completed transaction.
  2. Give a better error message than 'type mismatch' for complex JSON arguments 18871d4785
  3. jgarzik commented at 4:20 PM on July 17, 2012: contributor

    ACK

  4. New feature for signrawtransaction: specify signature hash (ALL/NONE/etc) 3c3666d67e
  5. gavinandresen merged this on Jul 17, 2012
  6. gavinandresen closed this on Jul 17, 2012

  7. DrahtBot locked this on Sep 8, 2021

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-05-02 15:16 UTC

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