Isaacdelly / Plutus

An automated bitcoin wallet collider that brute forces random wallet addresses
1.11k stars 520 forks source link

about database #151

Closed pavankmr853 closed 1 year ago

pavankmr853 commented 4 years ago

please update the new wallet addresses in it

secretnumber commented 4 years ago

I second that. Either that, or please explain how to update the database, including getting the fresh set.

alwaysminingbtc commented 4 years ago

Agreed!!! I also think that there is untapped potential by expanding the DB with addresses that have had activity (or maybe recent activity).

ZaranTheWise commented 4 years ago

If you click on the database folder, there is a link to the process for getting the list of >$0 accounts, and Pickle looks like a well documented module. It does take forever to download the bitcoin core though.

alwaysminingbtc commented 4 years ago

If you click on the database folder, there is a link to the process for getting the list of >$0 accounts, and Pickle looks like a well documented module. It does take forever to download the bitcoin core though.

Surely there is a hero following this git that would update the DB for us....otherwise, down the rabbit hole I go to try to figure this out.

secretnumber commented 4 years ago

@alwaysminingbtc If you have the whole blockchain on your own machine, it would be a lot easier to generate the pickle files on your own -- it's more practical as you can update it yourself periodically to keep it fresh (as I do).

First, you will need to get https://github.com/graymauser/btcposbal2csv This script will only run on a linux box with python 2.7, so don't event try to get this working on windows. Not sure about OSX. Once you get your dependencies installed (took me some time to figure this out), it's as easy as running the following command:

python btcposbal2csv.py /path/to/your/chainstate /path/to/desired/addresses_with_balance.csv

This should take less than an hour on a fairly modern machine. You will get some error at the end saying some transactions can't be decoded, which is to be expected and can be ignored. As long as the generated file is about 1,3GB in size, you're good.

Next, grab this file: https://github.com/AirShark/Plutus/blob/master/database/convert_to_pickle.py and pip install all dependencies. This one should work both on python 2.7 and 3.5+ & win, linux and mac. Just change line number 13 to point to your freshly generated addresses_with_balance.csv file and create a 'db' folder. That's where the pickle files will go.

Then just run python convert_to_pickle.py or python3 convert_to_pickle.py

And that's it.

Here's the updated db from a few days ago if you still want it: https://fil.email/v4nf8trx

alwaysminingbtc commented 4 years ago

@secretnumber Awesome. Thank you very much!!!! I have some old miners (RIP GPU mining) that I've now bareboned and have them running Plutus for shits and giggles. They run at about 32w, and the dual-core processors seem to be cranking out addresses quickly.

I will follow your directions - I've been running Kali Linux on top of Windows 10, but maybe I can convert one to Ubuntu. I wonder if any of us one day will find something - all of the internet seems to think that this is a waste of time and energy....

secretnumber commented 4 years ago

@alwaysminingbtc You're welcome. I already went down the rabbit hole so you don't have to ;) The biggest pain was getting all the dependencies correctly installed for the btcposbal2csv script. There are some that are not listed iirc, mainly for the other scripts to work. You will probably need to google a bunch of error messages and how to get them resolved. Good luck.

The plutus script (as is) only works on cpu and doesn't really take that much power. It's definitely not getting hot for the work it's doing. Have you changed anything to get this to work on a gpu? I'm running this on two quad core laptops with a slightly modified script, that I'm constantly trying to improve as well for speed and efficiency

Been running this for about a month and still found nothing, and most likely won't in this lifetime.

alwaysminingbtc commented 4 years ago

@secretnumber I'm definitely a noob and haven't coded in a LONGGGGG time, so I'm still trying to wrap my head around all of the Linux and Python commands. Modifying code and getting it to work could take a lifetime for me HAHA. I'm just doing this as a hobby in my free time.

I've downloaded the file and currently working on building out the pickle files so they can be imported easily in the current Plutus code format (otherwise there's no way I will be able to get it to work!).

As for using GPUs, I know there are other tools out there that can utilize GPUs, but I'm just just trying to get this thing to run at this point LOL. I have about 10 GPUs laying around that I haven't sold off that I'd love to put to good use one day.

My original plan was to take a cracker and to build my own 6, 8, or 12 word seed private key generator from a modified Electrum Dictionary and see if I could find balances that way. I know tools like that exist, but I couldn't get any others to work! I feel like the only way to find any treasure is to look in the right spots vs completely random...but whatever, this is still fun.

EDIT: I'm an idiot. The download is already in pickle format...whoops

MisterTeo commented 4 years ago

@secretnumber try this :

https://github.com/imcmurray/Plutus-fastecdsa

Is much faster...

secretnumber commented 4 years ago

@MisterTeo That's what I currently use, sort of. I have about 6 different modifications of it and am always fiddling with it to improve the performance.

secretnumber commented 4 years ago

Here's a fresh database set for anyone who wants it (Jan 13, 2020), already in pickle format.

https://fil.email/gWihX2TC

I found another chainstate parser https://github.com/in3rsha/bitcoin-utxo-dump written in go. It's about 5x faster than btcposbal2csv -- finished parsing in less than 10 minutes as opposed to nearly an hour previously. I had to do a couple transformations first: removing empty lines and duplicate entries before dumping it into pickle format. I'll write a script to automate this when I get time and share it.

@alwaysminingbtc @MisterTeo

MisterTeo commented 4 years ago

Nice @secretnumber ... a question for you...what about issue #159 ? Comment there your oppinion...

alwaysminingbtc commented 4 years ago

@secretnumber Thanks again for uploading a current DB.

I spent this weekend immersing myself in trying to learn code - I was able create what I originally wanted, which is a wallet generator based on the BIP 39 seed dictionary (2048 words). It can be found here: https://github.com/alwaysminingbtc/plutushybid. It will randomly generate between 4 and 24 words, decode into a private key, and then match it up against the DB of known wallets with balance. Figured there's a better chance of finding something that way than just random.

Three disclaimers though:

  1. I tried matching my output with the https://iancoleman.io/bip39/#english converter and it gets an INVALID response on the few that I tried to convert to see if my code worked. My code might not be working like it should.
  2. The code isn't as efficient as it can be.
  3. The generation of seed words is SLOWWWWWWW, which probably is due to inefficient code. I ran it for a night an then realized I probably have no chance of finding anything due to disclaimer #1 :)

If anyone wants to help take a look and potentially help clean it up, that would be greatly appreciated!

johnlockejrr commented 4 years ago

@secretnumber Thanks again for uploading a current DB.

I spent this weekend immersing myself in trying to learn code - I was able create what I originally wanted, which is a wallet generator based on the BIP 39 seed dictionary (2048 words). It can be found here: https://github.com/alwaysminingbtc/plutushybid. It will randomly generate between 4 and 24 words, decode into a private key, and then match it up against the DB of known wallets with balance. Figured there's a better chance of finding something that way than just random.

Three disclaimers though:

  1. I tried matching my output with the https://iancoleman.io/bip39/#english converter and it gets an INVALID response on the few that I tried to convert to see if my code worked. My code might not be working like it should.
  2. The code isn't as efficient as it can be.
  3. The generation of seed words is SLOWWWWWWW, which probably is due to inefficient code. I ran it for a night an then realized I probably have no chance of finding anything due to disclaimer #1 :)

If anyone wants to help take a look and potentially help clean it up, that would be greatly appreciated!

1 problem: you're not generating correctly the mnemonic phrase, is not just some random 4 to 24 words, there is an algorithm to generate them, the last word is a checksum. You can do something like:

from mnemonic import Mnemonic from random import choice, seed import sys from binascii import hexlify, unhexlify

def b2h(b): h = hexlify(b) return h if sys.version < "3" else h.decode("utf8")

mnemo = Mnemonic("english") data = "".join(chr(choice(range(0, 256))) for _ in range(8 * (0 % 3 + 2))) if sys.version >= "3": data = data.encode("latin1") data = b2h(data) mnemonic_words = mnemo.to_mnemonic(unhexlify(data))

alwaysminingbtc commented 4 years ago

@johnlockejrr thanks! I attempted to insert the code and I can't get it to compile. Oh well. I'm going to just stick with running Plutus for now. I would assume even if I had working code, I would still come up empty over time just like Plutus :)

johnlockejrr commented 4 years ago

Python is an interpreted language, it doesn't compile, anyway, my code is an example, you have to "tune" it a little not just copy/paste, and should work.

johnlockejrr commented 4 years ago

@johnlockejrr thanks! I attempted to insert the code and I can't get it to compile. Oh well. I'm going to just stick with running Plutus for now. I would assume even if I had working code, I would still come up empty over time just like Plutus :)

Look, here, I did it for you: https://github.com/johnlockejrr/plutushybid Works pretty fast.

jeforson commented 4 years ago

@johnlockejrr I just pulled in your code and got it running. Quite fast! I also checked to see if it was properly working, and it is! Clearly i'm not a coder. Is there a way to tweak the code to do random seed lengths other than 12 words?

alwaysminingbtc commented 4 years ago

@johnlockejrr You are awesome. I just updated https://github.com/alwaysminingbtc/plutushybrid

johnlockejrr commented 4 years ago

@johnlockejrr I just pulled in your code and got it running. Quite fast! I also checked to see if it was properly working, and it is! Clearly i'm not a coder. Is there a way to tweak the code to do random seed lengths other than 12 words?

There is always a way. Thought of attacking blockchain.info default p2pkh because there are many old/new addresses with balance:

~/btc$ wc -l p2pkh.txt
21715862 p2pkh.txt
seperatis commented 4 years ago

Good shit guys....where to get the database files from?

The system cannot find the path specified: 'database/JAN_07_2020/

MisterTeo commented 4 years ago

@seperatis https://github.com/Isaacdelly/Plutus/issues/151#issuecomment-573555860

seperatis commented 4 years ago

@seperatis #151 (comment)

Expired link....and they want $30 to recover the file

MisterTeo commented 4 years ago

@seperatis work with old database, changing the name of database in script or database name. For your error, check old issues, open or closed, you will find the problem. HINT: Memory error. https://github.com/Isaacdelly/Plutus/issues

MisterTeo commented 4 years ago

You can delete some files, and try again..or, better, instal linux. Originaly, Plutus was built for linux OS. Works like a charm in Ubuntu or Debian. On my daily laptop, i7 with 12 GB RAM, Win 10 Home, work classic Plutus like a charm, not with fastecdsa... I use Plutus on Ubuntu linux, I don't have any problems with it. On Windows, I play only with a modifyed plutus ( Brutus ). So, Problem is from you, not from Plutus. All you can do is try to delete some files from database, and play with 15, 16 or you'l see how many files or play with linux.

tharmass commented 4 years ago

Here's a fresh database set for anyone who wants it (Jan 13, 2020), already in pickle format.

https://fil.email/gWihX2TC

I found another chainstate parser https://github.com/in3rsha/bitcoin-utxo-dump written in go. It's about 5x faster than btcposbal2csv -- finished parsing in less than 10 minutes as opposed to nearly an hour previously. I had to do a couple transformations first: removing empty lines and duplicate entries before dumping it into pickle format. I'll write a script to automate this when I get time and share it.

@alwaysminingbtc @MisterTeo


@secretnumber link to your new database has expired. Can you send a new link please? I have a problem to generate addresses myself, your new database will be useful to many people

seperatis commented 4 years ago

@tharmass

If @secretnumber doesn't upload a new link by later tonight, then I'll hop on my Linux box and create an updated pickle file database and share on here. Glad I left a full node on there...new it'd come in handy some day!

secretnumber commented 4 years ago

I'll push a new db out in a couple hours. Need to sync up with the Blockchain first and then do the pickling.

secretnumber commented 4 years ago

Ok, here it is: https://github.com/secretnumber/utxodump

This time it's on GH so the links won't expire and I'll update it from time to time. For some reason the upload takes me much longer than the previous file host I've been using, so that was the reason for the quick dump.

@seperatis @alwaysminingbtc @tharmass

seperatis commented 4 years ago

@secretnumber Thank you for updating & sharing!

Okay, so a couple of thoughts I was having..... There appears to be no internal pause & resume function in the Python script. Does the script just randomly search for private key matches or does it do so incrementally in some order?

Because if so, then wouldn't it be best to load smaller pickle file one-at-a-time, run script till complete, then load another pickle file and repeat?

Otherwise, if you run the script with /database files as-is, then every time you stop the script and start it again you're doing work again that you've already done.

Thoughts? Do I have this correct?

secretnumber commented 4 years ago

@seperatis

First, the script does indeed generate the keys randomly rather than incrementally. Most wallets are created this way and this is considered the correct way, since the numbers are not predictable and hence harder to crack. This is the function responsible for the initial random key generation:

https://github.com/Isaacdelly/Plutus/blob/master/plutus.py#L20

As to your second question, the script loads the db files into memory (ram) on startup and compares the randomly generated keys/addresses against it as it runs infinitely. This is very efficient because you're essentially only accessing ram now and it is very vary fast.

The major bottleneck in speed comes from the private_key_to_public_key(private_key) function in line 22. It converts the the random key into a corresponding private key/address doing some cpu intensive math along the way. With a modified script with fastecdsa I'm able to generate about 1200 keys/s on my i7 with 12gb of ram.

If you're looking to increase speed and efficiency, you're better off looking at a compiled language such a C, C++, Go, etc., and either rewrite the script yourself or hire someone to do it. Python is considered easy and fun, but unfortunately it isn't fast.

tharmass commented 4 years ago

@secretnumber

I have a problem and a question. I don't have enough RAM on my computer to run the whole program. I also have a problem to create a BTC address database by myself. Can you make two databases for me for Plutus, with addresses from 500 BTC to 183hmJGR ... and 1000BTC to 183hmJGR ...? I have a computer with intel I5 8250, 8GB RAM (4GB available) .. Before I buy more RAM I would like to test the operation of this program with fewer addresses .. My contact email: jara.damian13@gmail.com

Can you help?

seperatis commented 4 years ago

@tharmass Are you using Windows or Linux?

I was actually thinking about doing this. Hate to let Plutus run for a year to unlock a wallet with 0.000001 BTC in it.

tharmass commented 4 years ago

@tharmass Are you using Windows or Linux?

I was actually thinking about doing this. Hate to let Plutus run for a year to unlock a wallet with 0.000001 BTC in it.

@seperatis

I'm using Windows. I don't know Python well, rather C, C #. Downloading the blockchain database takes a long time, if someone has already done it can quickly create a database with addresses that have 500BTC-86000 BTC or 1000BTC-86000BTC ..

seperatis commented 4 years ago

@tharmass

You can always download the free version of VMware Workstation Player/Pro then run Ubuntu in the VM. The memory problem has to do with the way Python manages memory in Windows. Using Linux fixes the issues immediately.

I have blockchain synched fully, but what you're requesting won't "be quick". It actually takes a little time. I'll try to get around to it and post the new database files within the next day or two. Today is Super Bowl, so I'm not doing jack today ;-)

tharmass commented 4 years ago

@tharmass

You can always download the free version of VMware Workstation Player/Pro then run Ubuntu in the VM. The memory problem has to do with the way Python manages memory in Windows. Using Linux fixes the issues immediately.

I have blockchain synched fully, but what you're requesting won't "be quick". It actually takes a little time. I'll try to get around to it and post the new database files within the next day or two. Today is Super Bowl, so I'm not doing jack today ;-)

@seperatis

I understand. But if I give 16GB RAM and my intel i5, then Plutus will work with a full database without any problems on Windows? Rather, get ready to install Linux?

seperatis commented 4 years ago

@tharmass

Do whatever you like best, I'm only pointing out that you can have Plutus up and running in a Windows VM in like 10 minutes with the RAM that you already have.

secretnumber commented 4 years ago

@tharmass

I'm not going to generate two separate databases just for you as it takes too much time. I've updated the db in my repo: https://github.com/secretnumber/utxodump and it will probably also be the last time I do so. I've moved on to greener pastures since and consider running this scrip a fool's errand at best. If you have memory issues, you can try removing the pickle files one by one starting from the last, and it will eventually run with your limited ram.

There's couple differences in the latest dump: I've only included balances with 50000 satoshis or more (~$5) and attached coinbase addresses which were previously not seen or correctly decoded by the parser. These are the addresses with balances from mining containing round numbers (50btbtc, 100btc, etc.) and no other transaction history. The whole pickle db is ~445mb as opposed to to old one of ~813mb.

ZaranTheWise commented 4 years ago

@secretnumber Do these greener pastures come with a github link? I accept my odds of ever finding anything are just better than my odds of finding the Shaq rookie card I lost 20 years ago, but the hunt is pretty entertaining.

secretnumber commented 4 years ago

@ZaranTheWise They do, indeed! https://github.com/brichard19/BitCrack

I'm not expecting to find anything either, but my spare laptop is desperately looking to do some work and this is just perfect for it.

Not sure what numbers y'all are getting with plutus, but last time I checked it was about 300/s with 4 cpu's. I had a modified version with fastedca that ran at about 1000/s. With bitcrack, I'm currently generating ~7.5 million keys a second, a 7500‬x speed improvement. For perspective, what currently takes me 1 day would take plutus 20+ years. It works with gpu so the speed will depend on your card. Mine is just a simple built-in nvidia, but I hear some of the top current cards ca do nearly a billion keys a sec.

Good luck.

ZaranTheWise commented 4 years ago

I don't know anything about CUDA, which makes me nervous. And that script doesn't seem to be taking advantage of the UTXO, which is a little odd. Is it only attacking the bitcoin puzzle transaction? If I'm not mistaken this would just be a solo version of the LBC.

I 100% appreciate the link and I'll def look into it! I think at the moment, until I can get a better understanding of what bitcrack does and how it can be adapted, I'm going to work on bringing fastedca speed to the plutushybrid script. I know it'll never match the speed of bitcrack, but working against a set list of targets makes more sense to me that rapidly firing into the dark at a puzzle. Then again, I've barely got my head wrapped around any of this.

secretnumber commented 4 years ago

@ZaranTheWise You don't need to know anything about CUDA per se. Check if your card is cuda compatible, and if so, just install the toolkit and you're good to go. I initially ran into some issues during installation, gave up, and opted for the OpenCL version, which runs on pretty much any graphics card, including the integrated intel one. It still gave me a decent ~1.85 mil keys/s.

Bitcrack does take advantage of utxo, you just feed it a list via a command line argument and the program creates it's own bloom filter. No need for pickle files, any list with one address per line will work (which is also easier to test). It does work little differently though, which you can read about in the repo, or better yet, the issues. It has optional checkpoints, making sure you never hit the same keyspace twice (also configurable) and can resume from where you left off. In other words, it does everything that plutus does, and some more. But a lot faster.

ZaranTheWise commented 4 years ago

That sounds perfect! OK now I have a project for after work today. Thanks again for the heads up. I look forward to hopelessly looking for a microscopic needle in a near infinitely large haystack at much greater speed.

seperatis commented 4 years ago

@secretnumber @ZaranTheWise

I just switched to BitCrack and I'm getting 136,000,000 Keys/s with 2 GPUs. Apparently you have to create two separate batch files with the device ID of each and run them separately.

I don't think the program has multi-GPU support built-in.

Since I've been typing this reply, I have generated 40 billion keys. (approx 3 minutes). This shit flies!

ZaranTheWise commented 4 years ago

Enjoy your fun, boys. Looks like my neither of my macbook pros have GPUs compatible with CUDO or OPENCL (Insert Mac joke here). Remember me when you're swimming in bitcoins. It'd be tough to justify spending on an external GPU just for the fun of the hunt.

seperatis commented 4 years ago

@ZaranTheWise

You can still use the CPU...

xxBitCrack.exe --list-devices

Then use the -d flag to select which device. eg, xxBitCrack.exe -d 0

ZaranTheWise commented 4 years ago

Looks like meat's back on the menu, boys! Slower, less delicious meat, but meat nonetheless.

seperatis commented 4 years ago

@ZaranTheWise

With only my CPU I'm getting around 8m key/s. I have a Threadripper 16-core (32 thread) CPU though. Interested to know what your MacBook CPU might get.

MisterTeo commented 4 years ago

@secretnumber I have some questions for you :

secretnumber commented 4 years ago

@MisterTeo Which program are you using to parse the chainstate?