Skip to content

MellowYarker/Observer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Observer

This software is designed to derive bitcoin addresses from non-random or poorly generated random private keys. These types of private keys are considered to be weak; any bitcoin associated with these types of addresses are at risk of being stolen.

See why randomness matters.

Purpose

Find and move bitcoin secured by weak keys before others with nefarious intentions try to, then offer the owner an easy and reliable way to reclaim the funds.

Observer will

  • Generate and store a massive amount of weak private keys. Tool Nearly Complete
  • Watch the bitcoin network to see if any of the addresses in our database have funds. Complete
  • Move any discovered funds and offer the owner a way to reclaim them (at a new secure address). (Not started)

WARNING

Do not send bitcoin to addresses generated by this software.

How does it work?

Generating

You provide "seeds" that are turned into private keys. You can find lots of examples in src/100kseeds.txt (a collection of common passwords). The private keys are used to generate P2PKH, P2SH_P2WPKH, and P2WPKH addresses, which are stored in a database along with the respective seed and private key.

You can easily add methods that convert seeds into private keys. See the wiki for more details.

Observing

Observer subscribes to Blockchain's websocket api to get a stream of unconfirmed transactions. Each transaction is parsed for its outputs, if any are spendable they are added to the spendable table in Observer's database.

Dependencies

This software depends on libbtc (Bitcoin library written in C), libbloom (C implementation of a bloom filter), and libwebsockets. They've all been added to this repo as git subtrees.

Additionally, you will need a version of cmake >= 2.8 (this is for libwebsockets)

Build

sudo sh configure.sh
cd src
make

The configure script will take a while, it needs to compile and install several libraries. You'll be asked if you want to store all addresses that have been used in the first ~580k blocks, this can be useful if you're less interested in moving funds and more interested in just looking at the distribution of weak addresses or something.

Note: The download will take a while (it's nearly 20GB), however, inserting the records to the database will take even longer. Over 520 million records need to be inserted.

See the Makefile in src for more options.

Usage

Generating keys

You can generate key sets using the gen_keys program.

./gen_keys <input file>

For example

$ ./gen_keys 100kseeds.txt

Generating seeds

If you want to generate seeds to feed to ./gen_keys, you can use python3 build_seed_list.py. You'll be prompted for a word, once you enter one, a bunch of related words will be found and added to seeds.txt.

$ python3 build_seed_list.py
Press ctrl + c to exit.

Collect words related to: bitcoin
Found 222 words related to 'bitcoin'.
Added 'bitcoin' to words.txt
Words related to 'bitcoin' have been added to seeds.txt
$ ./gen_keys seeds.txt

Key sets are stored in an sqlite3 table, here's a quick example of querying the database.

$ cd db
$ sqlite3 observer.db
SQLite version 3.16.0 2016-11-04 19:09:39
Enter ".help" for usage hints.
sqlite> .mode columns
sqlite> .headers on
sqlite> select * from keys where seed like 'password';
privkey                           seed        P2PKH                               P2SH                                P2WPKH
--------------------------------  ----------  ----------------------------------  ----------------------------------  ------------------------------------------
000000000000000000000000password  password    194Gw5oZnHWNoC1eg2EJSpkYPqT55fmT8L  3DGDdvVL49bZreL8r59ZdBF8nSV1kqT3Nv  bc1qtp0cmn9ug0pyz8ncky8uew2rtvv37a4z2y5nn6
password000000000000000000000000  password    1U44rmtsDPjV1CsrZ9JXh3WFLUTkFD99E   3C5EdoQzkF7N1ESMKpQGZFVirftx9DCKo7  bc1qq5wu5ml0xe7djvha6y00sz8qxunwlxw6glkudg

Watching the Mempool

The reader program connects to blockchain.com and gets a stream of unconfirmed transactions in real time. If any transactions contain output addresses that are in your database, reader will find them and store the output in your database.

Note: You'll need to generate addresses before you can run the reader program, its purpose is to watch the network for addresses that you can control.

To watch the network, just run ./reader

About

A search for bitcoin secured by weak addresses

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published