1
I'm creating a Bitcoin based lottery application. An entry into the lottery is a transaction spending 1BTC.
If someone guesses some arbitrary value correctly, they can claim the entry and send this 1 Btc to an address they control.
I wish to have functionality as follows: if no one guesses the correct number after 100 blocks, then I can claim it as the operator of the lottery.
Can I do this via: Entry transaction IF CHECKLOCKTIMEVERIFY payable to a correct guess ELSE Payable to my operator public key END
Then when I try to spend this entry transaction, I set the nLockTime to the current block.
Throughout I set all the sequence numbers to 0xFFF... So that the transactions are mined.
Thanks for the info. On the BIP Page Peter Todd suggests a script similar to mine though, right? https://github.com/bitcoin/bips/blob/master/bip-0065.mediawiki
– Tom Taylor – 2016-05-12T21:16:29.453Yes, his examples are similar. Just remember that
OP_CHECKLOCKTIMEVERIFYis a consequence of a condition, not the condition itself. The condition is the0or1at the end of his example redemption scripts. That's what determines ifOP_CHECKLOCKTIMEVERIFYis called. – Jestin – 2016-05-12T21:33:51.833Great, thanks. Will come back here with any further questions. – Tom Taylor – 2016-05-12T21:47:10.070