topynate

OP_CHECKBLOCKSIZEVERIFY

Jan 2nd, 2016
577
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.09 KB | None | 0 0
  1. OP_CHECKBLOCKSIZEVERIFY: a market mechanism for the block size.
  2.  
  3. How it works:
  4. A new opcode, OP_CHECKBLOCKSIZEVERIFY (henceforth CBSV) is defined which causes the transaction to fail immediately if a block at a given height is not of a given size. The opcode leaves the block height and block size on the stack; thus both are available for further manipulation by other opcodes such as OP_LESSTHAN, OP_GREATERTHAN, OP_WITHIN etc. This enables transactions which check that a block size / block height falls in some predefined range; additionally, the opcode can be implemented as a soft-fork, in the same manner as OP_CHECKLOCKTIMEVERIFY (BIP 65; henceforth CLTV). Several uses of CBSV are immediately apparent and are discussed below.
  5.  
  6. Semantics:
  7. The script fragment
  8. <block size> <block height> CBSV
  9. will continue execution with <block size> <block height> on the stack (<block height> on the top of the stack) if and only if:
  10. 1) the transaction has an nLockTime greater than or equal to <block height> and
  11. 2) the size, in bytes, of the block at height <block height> is equal to <block size>.
  12.  
  13. Example scripts:
  14. Conditional sacrifice to miner
  15. <block height> CBSV SWAP <350000> <850000> WITHIN VERIFY
  16. Spending script: <block size>
  17. The miner of the block at height <block height> may collect the sacrifice if the block is between 350KB and 850KB in size.
  18.  
  19. Sacrifice to first miner after block 500000 to create a block greater than 2MB
  20. CBSV <500000> GREATERTHAN VERIFY <2000000> GREATERTHAN VERIFY
  21. Spending script: <block size> <block height>
  22.  
  23. Sacrifice to miner only if all blocks between 450000 and 500000 are less than or equal to 1MB in size
  24. IF CBSV <450000> <500000> WITHIN VERIFY <1000000> LESSTHAN VERIFY <pubkey> CHECKSIGVERIFY ELSE <500100> CLTV ENDIF
  25. If a block is mine greater than 1MB in size, the creator of the sacrifice can recover with the following script:
  26. <signature> <block size> <block height> 1
  27. Otherwise, the miner of block 500100 can spend the sacrifice with:
  28. Spending script: 0
  29.  
  30. It is also possible to create side-bets on the block size at some height:
  31. <450000> CBSV DROP <1000000> ROT IF GREATERTHAN VERIFY <pubkey1> ELSE 2DROP <pubkey2> ENDIF CHECKSIGVERIFY
  32. This may be spent by the creator of pubkey1 if the size of block 450000 is greater than 1MB, else by the creator of pubkey2.
  33. Spending script: <signature1/signature2> <1 or 0> <block size>
  34.  
  35. The address corresponding to the above script may be funded by an ANYONECANPAY transaction with two inputs and an output equal to the total amount staked.
  36.  
  37. Discussion
  38. The new opcode CBSV enables holders of Bitcoin to commit publicly to paying miners for blocks of desired sizes. Miner decisions about what size blocks to mine, and whether to collect the sacrifices, are also publicly visible. The intended result is to make explicit what has hitherto been the subject of guesswork, namely the demand and supply curves for blocks of all sizes. A second, related effect will be to enable on-chain prediction markets on what size future blocks will be. Supplementary services, either free or paid, may appear to help clear the on-chain markets created by CBSV.
Advertisement
Add Comment
Please, Sign In to add comment