Bitcoin Forum
June 08, 2024, 02:31:09 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: BTC transaction dependent on a block hash lottery  (Read 106 times)
Drawesome (OP)
Full Member
***
Offline Offline

Activity: 205
Merit: 135


View Profile
October 31, 2022, 06:48:56 PM
Merited by ABCbits (1)
 #1

Hi everyone,

I know of some developments using block hash as NRG entropy. And I was wondering if it is possible to do the following experiment using a Taproor transaction.

Imagine I want to do a ruffle among n BTC addresses depending on a particular future block hash. Can I create a taproot tx such as the address closest to that hash (defining a simple and fair distance) being able to spend the UTx0?

I'm not asking for the solution, only if it could be done just with a Tx Script or some DLC will be needed.

Thanks in advanced for any Hint.
pooya87
Legendary
*
Offline Offline

Activity: 3472
Merit: 10614



View Profile
November 01, 2022, 05:46:38 AM
Merited by ABCbits (2)
 #2

You have to already have the hash to create your Taproot script and the Taproot address to lock the coins in to be spent later. Since you aim to use a block hash that has not been created yet, it is not possible to do so. There is also no option to fetch a block hash inside the smart contract.

Additionally in bitcoin scripts we don't have the option to compare hashes as integers or otherwise so you can't do the "closest to hash" comparison inside the smart contracts either.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
Drawesome (OP)
Full Member
***
Offline Offline

Activity: 205
Merit: 135


View Profile
November 01, 2022, 05:16:02 PM
 #3

You have to already have the hash to create your Taproot script and the Taproot address to lock the coins in to be spent later. Since you aim to use a block hash that has not been created yet, it is not possible to do so. There is also no option to fetch a block hash inside the smart contract.

Additionally in bitcoin scripts we don't have the option to compare hashes as integers or otherwise so you can't do the "closest to hash" comparison inside the smart contracts either.

Thank you. So I understand some kind of DLC will be needed for the task.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!