0

For example, could you have the following transaction:

A --> B
A --> C

Where A is an input txid and index, and B and C are outputs? The reason I'm asking is because I believe with SIGHASH_SINGLE you can only sign one input and one output, so this would be a way to use the same input to spend to two outputs. It would be the equivalent of sighash 'double', if it existed.

For example, to have a transaction like this:

A --> B
A --> C
D --> E

Where the D --> E input and output could be added after the first two inputs had been signed. Is there any other way to achieve this?

1

No, this is not possible - once an outpoint is consumed by a transaction, it is considered spent, including within the same transaction.

Your only option here would be to have an intermediary transaction splitting A (or using another input), and then using the two outputs from that as inputs along with SIGHASH_SINGLE | SIGHASH_ANYONECANPAY for your flags.

A -> A1
 \-> A2

A1 -> B
A2 -> C
D  -> E

Note that SIGHASH_SINGLE signs a single output and all of the inputs. If you want someone else to be able to add inputs, you need the ANYONECANPAY flag as well

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.