signature – Is it possible to sign a pair of inputs and outputs while adding outputs? Can you combine several SIGHASHES to do it?

The SIGHASH_ALL signature signs all inputs and locks all outputs.

The SIGHASH_SINGLE signature locks the entry on the output.

Is there a way to lock multiple entries on multiple outlets while allowing additions to the transaction?

For example:

The input A (in color) provides 0.000001 BTC.
The B input provides 0.000001 BTC.

Output A is an OP_RETURN specifying the movement of color pieces from input A to output C.
Output B must receive 1.0 BTC.
Output C is empty

Someone else could provide 0.999998 BTC for the transaction to be processed. They could also receive color parts based on the data contained in OP_RETURN, assigned to a C output.

I hope to achieve this by combining several sighashes.

In private, you can do the following:

  • You sign the "Entry A – Exit A" part of the transaction above with "SIGHASH_SINGLE".
  • You sign the "Entry B – Outbound B" part of the transaction above with "SIGHASH_SINGLE".
  • You add a third dust entry, "Enter C" and sign with "SIGHASH_NONE". This signs all the inputs, effectively linking A and B together.

You make this signature public. Now, to spend these coins, someone needs to provide a D input with 0.999998 BTC. With SIGHASH_NONE, they can also add an output C where they receive the colored parts specified in OP_RETURN.