pull down to refresh
85 sats \ 2 replies \ @nullcount 31 Jul 2022 \ parent \ on: How can I create a bot to automatically sweep a list of private keys? bitcoin
The odds are orders of magnitude better to win the mega millions. You're better off buying $5 lottery tickets than spending $5 on power so your computer can make trillions of guesses for private keys. Even if you find a key, relatively few keys have multiple millions of USD worth of BTC. Many many more keys have less than 1 BTC. You're also better off putting that computational energy through an ASIC. Which is how BTC defends itself from this. But the existence of a state run lottery also helps punish those who are poor at math.
I actually have a finite list of keys I am sweeping. Only about 100 that I would like to sweep once an hour. How can I do that?
reply
Pick up a copy of @jimmysong 's Programming Bitcoin. It breaks down the math behind all the cryptography and encoding schemes.
Then you use something like electrum server to index your local copy of the Blockchain and parse all the UTXO scripts and check if any of them can be unlocked by the signatures derived from your list of private keys.
You only have to scan the whole chain once, then you check every new block.
Run your script with cron for every hour. Or set up some trigger that runs when a new block is added (that's your best bet if you want be the first to sweep it)
reply