Hi,
I'm rather new to Bitcoin Protocol Development and would like to thank you in advance of any help you can offer me.
Essentially, I would like make use of SIGHASH_ANYONECANPAY hash type.
Currently, after following Ken Shirriff's blog entry on
http://www.righto.com/2014/02/bitcoins-hard-way-using-raw-bitcoin.html, I was able to get a simple transaction working which is send from one input to multiple outputs. In addition, after doing some additional research and reading, I was able to extend the knowledge and get multiple inputs and multiple outputs working.
Right now, I'm at a loss at how to implement SIGHASH_ANYONECANPAY hash type and was wondering if someone can offer me where to look in terms of sample transaction script or code. I have taken a look at the contracts wiki but still unsure about the implementation steps.
My attempts at SIGHASH_ANYONECANPAY (assuming two inputs and one output) has been the following:
- Signing the first input with SIGHASH_ALL==> ("01") and second input with SIGHASH_ALL ("01") | SIGHASH_ANYONECANPAY ("80") ==> ("81")
- Here's the breakdown of my current signed transaction that's not being accepted by the TESTNET3:
I have highlighted in RED the SIGHASH_ALL==> ("01") and SIGHASH_ALL ("01") | SIGHASH_ANYONECANPAY ("80") ==> ("81")
https://s3.amazonaws.com/research.btc/btcmisc/TxBreakdown.pngOnce again, any help would be greatly appreciated!
Thanks!