When the network sees a block appear with enough difficulty nodes can detect this as potentially the longest valid chain allowing the blocks miner to officially claim the block reward via coinbase transaction. Is it possible to create a Bitcoin output that is locked to the same difficulty conditions but is not a coinbase transaction? For example I could calculate the difficulty in 10 blocks and lock Bitcoin until a block with that difficulty is mined at which point the miner who wins the block will have priority to include a transaction claiming these Bitcoins.

1 Answer 1


No, there are currently no Script opcodes that access information about the difficulty. There has been discussion about a proposal called OP_DIFFICULTY in the past.

In a similar direction, I saw some people discussing an idea to create a betting market where funds would be locked up to a shared address of two Bitcoin users, Alice and Bob, with a script that can be spent in two ways: either at a given blockheight to Alice, or at a given median time passed to Bob. Depending on whether mining is faster or slower than expected, either one or the other would come to pass earlier. I can’t find the discussion at the moment, though.

Vojtěch Strnad pointed out in the comments this paper on Blockrate Binaries.

  • Thanks I would appreciate link to the discussion if you ever remember where it was. In theory could the logic for such a script be represented with simplicity or CTV?
    – Poseidon
    Aug 20, 2023 at 16:45
  • 1
    You probably mean Blockrate Binaries: github.com/blockrate-binaries/paper/blob/master/… Aug 20, 2023 at 17:36
  • 2
    @Poseidon Bitcoin Script, in general, cannot observe anything that isn't part of the transaction data or committed to by it; this isn't something script additions can change (without fundamental design change). The way to add something like this would be to add some kind of assertion in the transaction (like nLockTime for absolute time and nSequence for relative time) first, and then possibly make that assertion observable by a script opcode (like OP_CHECKLOCKTIMEVERIFY and OP_CHECKSEQUENCEVERIFY for locktime/sequence respectively). Aug 21, 2023 at 13:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.