I find another proposed use of CODESEPARATOR here: https://lists.linuxfoundation.org/pipermail/lightning-dev/2016-March/000455.html OP_CHECKSIG OP_IF OP_ELSE OP_CSV OP_DROP OP_CODESEPARATOR OP_ENDIF OP_CHECKSIG It is actually 2 scripts: S1: OP_CHECKSIGVERIFY OP_CHECKSIG S2: OP_CSV OP_DROP OP_CHECKSIG Under taproot, we could make Q = P + H(P||S2)G, where P = MuSig(KeyA, KeyB) S1 becomes a direct spending with Q, and there is no need to use OP_IF or CODESEPARATOR in S2 at all. ================== If it is only to force R reuse, there is no need to use CODESEPARATOR: Input: Script: 2DUP EQUAL NOT VERIFY 2 PICK SWAP CAT DUP TOALTSTACK CHECKSIGVERIFY CAT FROMALTSTACK CHECKSIG But using CODESEPARATOR will save 3 bytes Input: Script: OVER SWAP CAT DUP TOALTSTACK CHECKSIGVERIFY CODESEPARATOR SWAP CAT FROMALTSTACK CHECKSIG However, a much better way would be: Input: Script: SWAP CAT CHECKSIG The discrete log of R could be a shared secret between A and B. If the purpose is to publish the private key to the whole world, R = G could be used. > On 24 Dec 2018, at 8:01 PM, ZmnSCPxj wrote: > > Good morning, > >> Could anyone propose a better use case of CODESEPARATOR? > > Long ago, aj sent an email on Lightning-dev about use of CODESEPARATOR to impose Scriptless Script even without Schnorr. It involved 3 signatures with different CODESEPARATOR places, and forced R reuse so that the signatures to claim the funds revealed the privkey. > > The script shown had all CODESEPARATOR in a single branch. > > I cannot claim to understand the script, and am having difficulty digging through the mailinglist > > Regards, > ZmnSCPxj