bip-0300: Forbid extraneous OP_DRIVECHAIN outputs in M5/M6

This commit is contained in:
Luke Dashjr 2023-07-26 19:59:59 +00:00
parent accaee0f33
commit badaf01360

View File

@ -398,7 +398,7 @@ Every time a deposit/withdrawal is made, the old CTIP is spent and a new one is
Every M5 is valid, as long as:
* It has at least one OP_DRIVECHAIN output -- this becomes the new CTIP.
* It has exactly one OP_DRIVECHAIN output -- this becomes the new CTIP.
* The new CTIP has '''more''' coins in it, than before.
@ -412,6 +412,7 @@ M6 is invalid if:
* The first output of M6 is NOT an OP_DRIVECHAIN. (This OP_DRIVECHAIN becomes the new CTIP. In other words: all non-withdrawn coins are paid back to the sidechain.)
* The second output is NOT an OP_RETURN script of exactly 10 bytes, of which 8 bytes are a serialized Bitcoin amount.
* The txn fee of M6 is NOT exactly equal to the amount of the previous bullet point.
* There are additional OP_DRIVECHAIN outputs after the first one.
Else, M6 is valid.