EC parameters - how to make sure two TX will be bundled and forged

Hi devs, a discussion started how it would be possible to ensure that two transactions will be forged, i.e. one will only be forged if the other is forged, too.

The idea to use a "always-valid" EC parameter was brought up, however my understanding is that this would not help, i.e. it would be valid on both forks if it happened that one TX got bundled in one block and the other a block later on a fork. So my understanding is that "always-valid" EC parameter would be equally helpful as no EC parameter at all.

What would be a good design pattern to ensure that two transactions are forged together? Phasing?

Indeed, you can achieve that using phased transactions.

One simple approach is to use phasing by secret. You submit both transactions as phased by the same secret (same approval model) and same finish height. Then you can just send the approval transaction disclosing the secret and referencing both transactions. This approach requires three transactions.

Another approach that only requires two transactions is to use phasing by transaction hash. You generate transaction B without broadcasting it. Then you send transaction A as phased linked to the transaction B hash. In this case you need to be careful about the finish height of the phased transaction and the deadline of the second transaction to prevent including the second transaction after the first one has expired.

Related to this discussion there's also the referenced transaction feature of all transactions, but that only allows to link one transaction to another so if B references A you can be sure that B will only be included if A is also included. But it doesn't guarantee the other way around.