<div dir="ltr"><div>After more thought, I think I came up with a clearer description of the recursive version.<br><br>The simple definition is that the hash for the new signature opcode should simply assume that the normalized txid system was used since the beginning.  All txids in the entire blockchain should be replaced with the &quot;correct&quot; values.<br><br>This requires a full re-index of the blockchain.  You can&#39;t work out 
what the TXID-N of a transaction is without knowning the TXID-N of its 
parents, in order to do the replacement.<br><br>The non-recursive version can only handle refunds one level deep.<br><br>A:<br>from: IN<br>sigA: based on hash(...)<br><br>B:<br>from A<br>sig: based on hash(from: TXID-N(A) | &quot;&quot;)  // sig removed<br><br>C:<br>from B<br>sig: based on hash(from: TXID-N(B) | &quot;&quot;)  // sig removed<br><br>If A is mutated before being added into the chain, then B can be modified to a valid transaction (B-new).<br><br>A-mutated:<br>from: IN<br>sig_mutated: based on hash(...) with some mutation<br><br>B has to be modified to B-new to make it valid.<br><br>B-new:<br>from A-mutated<br>sig: based on hash(from: TXID-N(A-mutated), &quot;&quot;)<br><br>Since TXID-N(A-mutated) is equal to TXID-N(A), the signature from B is still valid.<br><br>Howver, C-new cannot be created.<br><br>C-new:<br>from B-new<br>sig: based on hash(from: TXID-N(B-new), &quot;&quot;)<br><br>TXID-N(B-new) is not the same as TXID-N(B).  Since the from field is not removed by the TXID-N operation, differences in that field mean that the TXIDs are difference.<br><br>This means that the signature for C is not valid for C-new.<br><br>The recursive version repairs this problem.  <br><br>Rather than simply delete the scriptSig from the transaction.  All txids must also be replaced with their TXID-N versions.<br><br>Again, A is mutated before being added into the chain and B-new is produced.<br><br>A-mutated:<br>from: IN<br>sig_mutated: based on hash(...) with some mutation<br>TXID-N: TXID-N(A)<br><br>B has to be modified to B-new to make it valid.<br><br>B-new:<br>from A-mutated<br>sig: based on hash(from: TXID-N(A-mutated), &quot;&quot;)<br>TXID-N: TXID-N(B)<br><br>Since TXID-N(A-mutated) is equal to TXID-N(A), the signature from B is still valid.<br><br>Likewise the TXID-N(B-new) is equal to TXID-N(B).<br><br>The from field is replaced by the TXID-N from A-mutated which is equal to TXID-N(A) and the sig is the same.<br><br>C-new:<br>from B-new<br>sig: based on hash(from: TXID-N(B-new), &quot;&quot;)<br><br>The signature is still valid, since TXID-N(B-new) is the same as TXID-N(B).<br><br></div>This means that multi-level refunds are possible.<br></div>