3

If I have a bulk wallet with, say 100000 key pairs (address/private key) and I have received payments on any, say 1000 of them, how can I sweep all the coins to a new address? It would be even better if I can do it from the command line, for example > sweep keypairs.txt 1Q7nrZ7PGWTtKVkQk1mLZovbJKEfLubXtv and all the available coins are transacted to the destination address. The format is for example:

1,"1E4MuBWjv2qZeJH5ti9ig5XMoJHQF63cdX","5JmLyBtdFEaKefsFXPd9E9PmbvT8JogG1V6Yer5jmZ9MX6bXP88"
2,"1BhJsijfGxwbzKgkQj5hRLDnBkmX2Y1RNN","5K5BBepZgaq8n9sJrsoM5inEWCX7W8bh7U8fr2wSP1PAkseasdQ"
3,"1ATP4LHYxqCZhDva661SLWJoN3vdNE2u1J","5JchXy3Y97F3TjaHsMJmyaaik1Gd4DpLP15PegbcvcZ5u2HBJg7"
...
100000,"17GX2ZFSpDip3BR6jMYP5He53tPMZqpSSG","5JyZsU9K2kokXzJQjg5F7mormCcwiPBcBjD3UZXHNwMSPuDGCNK"
1

A script exists on GitHub by the name of coinsweep.

0

One way is to use Blockchain's import function, although they have a limit of 400 private keys per wallet.

Really you want to use the importprivkey function from the official Bitcoin client and loop through the file line by line:

cat privates | while read key; do bitcoind importprivkey $key; done

This is assuming the file consists of only lines each containing nothing more than a private key. Your example formatting would thus need to have the count, public keys and quotation marks removed.

  • I just realized that this will only import the keys but not, like you ask, sweep them into one address. – jorijnsmit Jul 20 '14 at 1:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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