You could do this with cron, python & electrum.
Do you know cron and python?
reply
I know cron and electrum, but not Python.
reply
Ironically, your question was asked nearly identically on the Bitcoin Stack Exchange:
How to "Autoforward" incoming BTC using Electrum https://bitcoin.stackexchange.com/questions/114615
Unfortunately, nobody has shared a script there that is ready to go that does that.
I see this article, ... a how-to if you are running bitcoin core, which you could then create a script to do it:
There's also this article which may be of help, for someone writing a script. Different from above in that it uses some third party API service.
Send bitcoin from your wallet using JavaScript https://blog.logrocket.com/sending-bitcoin-with-javascript/
And finally, maybe some of these scripts will help you in some way.
Various shell scripts, mainly to be used together with Bitcoin Core (bitcoind or bitcoin-qt) wallet. https://github.com/kristapsk/bitcoin-scripts
reply
Just a caveat ... it's not that hard for a script to do something you didn't intend for it to do. Bitcoin transactions are non-reversible, as you likely know, ... so a script doing something dumb like forgetting to calculate the change amount properly would result in the change going to the miner.
So, ... use testnet if you are developing a script, and have a second set of eyes on a script before you run it live on bitcoin main.
reply
Well, you wouldn't have to learn very much python to do it. Might be half a dozen lines code to figure out.
A small bounty would probably get you 90% there. If somebody knew the electrum API, I'm sure it's like a half hour chore for them. But, could be 12h+ for a n00b.
Is the list of keys static? Or manually maintainable?
If I wasn't traveling this week, I could do it for you.
reply
The list is manually maintainable. That is the only thing that would need maintenance, besides OS upgrades. I could pay you via lightning for assistance whenever you are done traveling, no rush or pressure.
reply
I got something partially functional, kicking the tires on the API tonight. It's not as straightforward to use the electrum API as I thought.
Deploying & configuring could turn into a bigger challenge than I initially thought too.
100% possible. Not sure if I'll have enough time. I'll try to circle back on this 2 weeks from now.
reply
300 sats \ 1 reply \ @jeff 7 Aug 2022
@tech5, I got it to work on testnet. Here is a guide for you.

Pre-amble

The instructions are written to target testnet. You can get testnet bitcoins from a faucet on google. Remove --testnet from all commands after you have something functioning on your machine.
I tested it with 1, 2 and 3 funded addresses on testnet. Note that the fee is static. I'm sure it'll work with infinite addresses.

1 Setup Server

  1. Install your fav linux distro (I did this on Ubuntu).
  2. Install python 3, optionally in a virtual environment
  3. Install electrum
  4. Install jq (Eg. sudo apt-get install jq)
Hopefully the above is easy enough for you. There are plenty of guides online for these.
Depending on your build, you may need to run the following.
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
Electrum will give you errors if you need this.

2 Configure Electrum

2 B - Daemon

Use Electrum docs & CLI to configure the daemon.
This will involve at the very least, setting a static port. Choose ports that aren't in use. No need to expose these ports externally, unless you know what you're doing.
electrum setconfig rpcport 7776 --offline --testnet
And mainnet, change the port to 7777.

2 - B Use Electrum UI to Setup your Wallet

electrum --testnet
Follow the prompts to setup your wallet with a password. Import the private keys you have into the wallet using the UI. Shut down the UI.

3 Run the Daemon

electrum daemon -d --testnet

4 Configure your Environment

export FEE=0.00001 # in BTC export DEST_ADDRESS=tb1qun6lw4f6mdqy97q373gs75m00etdklyrjjs2h2 export PASSWORD=pass export WALLET=~/.electrum/testnet/wallets/default_wallet_testnet

5 Load the wallet

electrum load_wallet -w $WALLET -W $PASSWORD --testnet

6 Get Addresses with Balances, Sweep & Broadcast

Run the following. It will list the addresses with balances, pull out the private keys, format them ready for the sweep command, prepare and sign a transaction, then broadcast it.
electrum listaddresses --funded -w $WALLET --testnet | electrum getprivatekeys - -w $WALLET -W $PASSWORD --testnet | jq -c | sed 's/[^a-zA-Z0-9:]/ /g' | electrum sweep - $DEST_ADDRESS --testnet -f $FEE | electrum signtransaction - -w $WALLET -W $PASSWORD --testnet | electrum broadcast - --testnet

7 Schedule

Add the command in step 5 to a cron schedule. So long as the electrum daemon and the wallet is unlocked the command will work.

8 Reboot

Run the commands from 3, 4 and 5 on startup of the server. Alternatively, you can run them before each command, but you would need to shut down the daemon if you did that.
reply
Wow that’s awesome!! I will give it a try. Thank you for sharing!
reply
You could limit your search space by sweeping private keys generated by non random seed phrases.
Some people think they're being clever and choose their own seed words that are easily remembered.
Or you could identify a flaw in some popular BTC wallet software's random number generator and search the keys likely to be generated from it.
reply
Their site will index any range of private keys you specify and it shows the current balance as well as the balance transfers.
Your key is on there too. But you shouldn't search for it directly (obviously) just tab through enough pages until you find it. Good luck!
reply
This always boggles my mind. I get the math, but still I feel that there's a chance that I find a key with coins in it. Or that someone guesses my key. It's a infinitesimally small chance, but there's a chance. If someone is lucky enough, they might stumble on it.
reply
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.
reply
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
или на ключ сатоши.)))
reply
скам сайт...
reply
👍🏻
reply
I’ve thought through this a bit. If you’re talking about checking wallets for balances by enumerating private keys, you’d need to generate public keys and check it against the ledger as you enumerate through the list of all possible seed phrases. Keep in mind a private key can generate numerous public keys.
If you run that bot on the world’s best computers, you might get lucky after a few thousand years. But probably not.
reply
How would I create a bot to sweep the keys derived from a seed phrase once an hour?
reply
Kinda hard to answer that without writing the code to create the bot, but the summarized steps are in the original comments.
You’re not going to be able to generate all private keys, so you’d have to check them as they’re enumerated. Most likely would need a loop function that generates a private key, then the public keys, then searches for the public key in the ledger, and repeats for all possible private keys.
reply
  1. put all keys in a csv os text file
  2. Open Electrum and sweep them from the file Done
reply
возьми все адреса с балансом 0.000001 и выше. и даже те адреса на которых были переводы. и проверяй ключи во времени. все просто. но на это уйдёт 100ккк лет
reply