And in this case, you can simply use Signet, because it is deployed here.
Yes, but the idea is to use real Bitcoins

I'll look into OP_CAT though. Perhaps that stuff could be tested first on BCH or some other chain which offers it.
This opcode does not exist.
If you have this opcode, then it is like having OP_CAT.
Lol! Thanks for pointing that out. I already suspected it a bit that the AI was hallucinating here ... should have insisted. Anyway you wrote that the "cheat" is indeed possible.
Regarding "controlling the block height", I meant to prevent that cheat by "testing" the block height in the header, and I don't see how CLTV can help with that (if not by a long chain of proofs that a CLTV transaction was spent in the block with the header ...). The CSV part is quite clear to me. What I want to understand is the "react to difficulty" part.
DLCs (Discreet Log Contracts)
Thanks. Yes, I'm aware of DLCs. But I would have preferred a way without an oracle, be it trustless or not.
No, if you bisect instead of dumping the whole chain on-chain:
Ah, that makes sense, thanks. So basically I understand that with OP_CAT the idea with PoW puzzles should be possible, but without OP_CAT, it is not.
In my edit of the second post, I came up with an idea based on @athanred's first interesting method with the two CLTV (timestamp based and blockheight based) outputs. I would like to develop this idea a bit further:
Let's say Alice and Bob want to enter a contract: In 2 difficulty periods in the future, if the difficulty is
10 or higher, then Alice has the right to spend 1 BTC. (I intentionally am simplifying the numbers of course

).
Let's say the difficulty periods are: period 0 (current one), period 1, and period 2 (target period of the contract).
At the start the difficulty is at 9. The idea is to have a chain of two transactions: Transaction 1 gets signed by both (via multisig) and can be also spent by both after the start of Period 1, and the second one is the one that actually "divides" the money according to the contract rules: if Alice wins, she can spend the coins. Transaction 2 is to be signed at the start of the difficult period 2, so it can react to the real difficulty of the target period.
- Transaction 1 does the following (in pseudocode): It contains different timestamps and a block height when the spending transaction could be spent if the difficulty is higher than the values inmediately over 9 (I ignore values over 12, but they could also be added with similar branches).
OP_IF
<multisig_addr1> <timestamp corresponding to difficulty 12 or higher>
OP_ELSE OP_IF
<multisig_addr2> <timestamp corresponding to difficulty 11 or higher>
OP_ELSE OP_IF
<multisig_addr3> <timestamp corresponding to difficulty 10 or higher>
OP_ELSE
<multisig_addr4> <blockheight period 1 start> OP_CHECKLOCKTIMEVERIFY
OP_ENDIF OP_ENDIF OP_ENDIF OP_CHECKLOCKTIMEVERIFY OP_DROP OP_CHECKSIG
This means basically: if the difficulty in the next period is higher than the current period, then one of the timestamp based transactions can be signed first.
I hope the idea becomes clear. Depending on the timestamp, the coins "land" on a different multisig address after Period 1 has started.
Now you also pre-sign a similar Transaction 2 for every multisig address with the following code:
OP_IF
<Alice's key> <timestamp corresponding to difficulty 10 or higher>
OP_ELSE
<Bob's key> <block height period 2 start>
OP_ENDIF
OP_CHECKLOCKTIMEVERIFY OP_DROP OP_CHECKSIG
So Bob can move the coins once the period starts.
You need the different multisig addresses, because the timestamp for difficulty 10+ will differ, depending on the difficulty of the previous period.
I have one doubt though: Transaction 1 seems only to work if the difficulty keeps the same or increases (i.e. if block times are becoming shorter, so the timestamp based conditions are triggered).
And Transaction 2 also only works this way if the difficulty at the start of period 1 had been 9 or lower.
But maybe instead of the block height of the period start we could choose a block height already some blocks inside the new difficulty period (e.g. "period start + 100 blocks"), so we can add timestamps for lower difficulties too.
Am I missing something?