You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: bip-0300.mediawiki
+11-3Lines changed: 11 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -226,7 +226,7 @@ A sidechain fails to activate if:
226
226
227
227
Otherwise, the sidechain activates (Active is set to TRUE).
228
228
229
-
In the block in which the sidechain activates, the coinbase MUST include at least one 0-valued OP_TRUE. This output becomes the initial CTIP for the sidechain.
229
+
In the block in which the sidechain activates, the coinbase MUST include at least one 0-valued OP_DRIVECHAIN output. This output becomes the initial CTIP for the sidechain.
230
230
231
231
232
232
@@ -394,7 +394,7 @@ Every time a deposit/withdrawal is made, the old CTIP is spent and a new one is
394
394
395
395
Every M5 is valid, as long as:
396
396
397
-
* It has at least one OP_TRUE output -- this becomes the new CTIP.
397
+
* It has at least one OP_DRIVECHAIN output -- this becomes the new CTIP.
398
398
* The new CTIP has '''more''' coins in it, than before.
399
399
400
400
@@ -405,16 +405,24 @@ We come, finally, to the critical matter: where users can take their money *out*
405
405
M6 is invalid if:
406
406
407
407
* The blinded hash of M6 does NOT match one of the approved Bundle-hashes. (In other words: M6 must first be approved by 13,150 upvotes.)
408
-
* The first output of M6 is NOT an OP_TRUE. (This OP_TRUE becomes the new CTIP. In other words: all non-withdrawn coins are paid back to the sidechain.)
408
+
* 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.)
409
409
* The second output is NOT an OP_RETURN script of exactly 10 bytes, of which 8 bytes are a serialized Bitcoin amount.
410
410
* The txn fee of M6 is NOT exactly equal to the amount of the previous bullet point.
411
411
412
412
Else, M6 is valid.
413
413
414
414
(The point of the latter two bullet points, is to allow the bundle hash to cover the L1 transaction fee.)
415
415
416
+
===OP_DRIVECHAIN===
416
417
418
+
This proposal adds a single new opcode, OP_DRIVECHAIN, which has strict semantics for usage.
419
+
OP_NOP5 (0xb4) is redefined as OP_DRIVECHAIN if and only if the entire script is OP_DRIVECHAIN followed by a single-byte push and OP_TRUE (exactly 4 bytes).
420
+
The single-byte push contains the sidechain number.
421
+
Note that this is not a "script number", and cannot be OP_1..OP_16 or any other kind of push; it is also unsigned, and must not be padded even if over sidechain number 127.
422
+
The final OP_TRUE is to ensure this change remains a softfork:
423
+
without it, sidechain numbers 0 and 128 would cause the legacy script interpreter to fail.
417
424
425
+
If an OP_DRIVECHAIN input is spent, the additional rules for M5 or M6 (see above) must be enforced.
0 commit comments