SIGHASH_NONE implies that entry 2 will only spend if entry 1 is included in the transaction.
Entry 2 is basically a blank check.
SIGHASH_NONE does not sign any of the outputs (no matter where the BTC goes), and
SIGHASH_ANYONECANPAY sign only entry 2 (I do not care who else participates in the show.This basically creates an entry which, if you give it to someone else, equals "Here's a blank check for X BTC, do what you want with it".
Are they able to pass the 1 entry (the SIGHASH_SINGLE) in another transaction without the included 2 entry?
As the entry 1 is signed with
SIGHASH_SINGLE, only the exit 1 is signed under this one. However, the
SIGHASH_ANYONECANPAY flag means that only entry 1 is also signed, which completely dissociates it from entry 2.
Now, if you had to remove the
SIGHASH_ANYONECANPAY flag of entry 1, you end up with a tx capable of spending up
entrance 1 + entrance 2 BTC, but it's only expenses
exit 1. In this scenario, the input of expenditure 1 also depends on the input of expenditure 2. However, since the input 1 is
SIGHASH_SINGLEand entry 2 is
SIGHASH_NONEAnyone with whom you share the fax is able to add their own outputs, but not add other entries.
Moreover, since entry 2 is
SIGHASH_NONE | SIGHASH_ANYONECANPAY, anyone with whom you share the recipient can extract only the entry 2 and reuse it in a completely different transmitter without requiring entry 1. The way to counter this would be to delete
SIGHASH_ANYONECANPAY , so that it is at least locked to be used with and only with input 1.
What can I do to lock these two inputs together, with one of the entries also being locked on an output, while allowing users to add entries to the transaction?
You can switch to a single exit, then create a new partial receipt with this single exit spent with the destination and the required amount, and sign it with
SIGHASH_SINGLE | SIGHASH_ANYONECANPAY