├── .gitignore ├── LICENSE ├── README.md ├── requirements.txt ├── run.sh ├── server.py ├── static └── main.css └── templates ├── error.html ├── home.html ├── key.html ├── lottery.html └── page.html /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | 28 | # PyInstaller 29 | # Usually these files are written by a python script from a template 30 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 31 | *.manifest 32 | *.spec 33 | 34 | # Installer logs 35 | pip-log.txt 36 | pip-delete-this-directory.txt 37 | 38 | # Unit test / coverage reports 39 | htmlcov/ 40 | .tox/ 41 | .coverage 42 | .coverage.* 43 | .cache 44 | nosetests.xml 45 | coverage.xml 46 | *.cover 47 | .hypothesis/ 48 | 49 | # Translations 50 | *.mo 51 | *.pot 52 | 53 | # Django stuff: 54 | *.log 55 | local_settings.py 56 | 57 | # Flask stuff: 58 | instance/ 59 | .webassets-cache 60 | 61 | # Scrapy stuff: 62 | .scrapy 63 | 64 | # Sphinx documentation 65 | docs/_build/ 66 | 67 | # PyBuilder 68 | target/ 69 | 70 | # Jupyter Notebook 71 | .ipynb_checkpoints 72 | 73 | # pyenv 74 | .python-version 75 | 76 | # celery beat schedule file 77 | celerybeat-schedule 78 | 79 | # SageMath parsed files 80 | *.sage.py 81 | 82 | # dotenv 83 | .env 84 | 85 | # virtualenv 86 | .venv 87 | venv/ 88 | ENV/ 89 | 90 | # Spyder project settings 91 | .spyderproject 92 | .spyproject 93 | 94 | # Rope project settings 95 | .ropeproject 96 | 97 | # mkdocs documentation 98 | /site 99 | 100 | # mypy 101 | .mypy_cache/ 102 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Bitcoin private key database 2 | A database of all Bitcoin private keys 3 | 4 | **Note:** This is an open-source clone of directory.io for my personal educational-purpose. 5 | 6 | This website contains all the possible Bitcoin private key. 7 | 8 | A private key it's just a number chosen randomly from a range, 9 | if this range (called key-space) is big enough it won't be possible 10 | to list all the keys in feasible times. 11 | 12 | Bitcoin private keys range from 1 to 115792089237316195423570985008687907852837564279074904382605163141518161494336 13 | 14 | The key-space it's too big to index all the keys ([http://redd.it/1rurll](http://redd.it/1rurll)), but you can however generate private keys on demand. 15 | 16 | For this reason I have developed this on-demand database and also a Lottery that will take a random private key from the key-space and tell you if it has some bitcoin available. ;) 17 | 18 | ## Installation 19 | 20 | pip3 install -r requirements.txt 21 | 22 | ## Usage 23 | 24 | chmod +x ./run.sh 25 | ./run.sh 26 | 27 | ### Donate 28 | BTC: 1EhJyJwzbp7v2ixPT4heM2caUsmWcX36mc 29 | Monero: 47Yk8KgtYyaV2RvzJLQKuuMzhiZD5ktdbNzP6jxsjkdSKD8j81uLRCYXKLFVFtsCbLjbyamGBES58Mi4r8wHEGht8ofEVu7 -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | Flask==0.12.1 2 | pycoin==0.80 -------------------------------------------------------------------------------- /run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export FLASK_APP=server.py 4 | flask run -------------------------------------------------------------------------------- /server.py: -------------------------------------------------------------------------------- 1 | from flask import Flask, render_template 2 | from pycoin.key import Key 3 | import math 4 | import random 5 | 6 | app = Flask(__name__) 7 | 8 | MAX_EXPONENT = 115792089237316195423570985008687907852837564279074904382605163141518161494336 9 | KEYS_PER_PAGE = 127 10 | 11 | def max_pages(): 12 | m = MAX_EXPONENT//(KEYS_PER_PAGE+1) 13 | return m if MAX_EXPONENT%(KEYS_PER_PAGE+1)==0 else m+1 14 | 15 | def page_range(page_num): 16 | from_sec = (page_num - 1) * (KEYS_PER_PAGE + 1) 17 | to_sec = (page_num - 1) * (KEYS_PER_PAGE + 1) + KEYS_PER_PAGE 18 | if to_sec > MAX_EXPONENT: 19 | to_sec = MAX_EXPONENT 20 | return range(from_sec+1,to_sec+1) 21 | 22 | def secret_to_address(secret_exponent): 23 | k = Key(secret_exponent=secret_exponent) 24 | addr = k.address(use_uncompressed=True) 25 | caddr = k.address() 26 | wif = k.wif(use_uncompressed=True) 27 | return secret_exponent, wif, addr, caddr 28 | 29 | @app.route('/') 30 | def hello_world(): 31 | return render_template('home.html') 32 | 33 | @app.route('/key/') 34 | def show_address(secret_exponent): 35 | if secret_exponent < 1 or secret_exponent > MAX_EXPONENT: 36 | return render_template('error.html', error='Invalid Key, not in range 1-{} '.format(MAX_EXPONENT)) 37 | sec, wif, addr, caddr = secret_to_address(secret_exponent) 38 | return render_template('key.html', sec=sec, compressed_addr=caddr, addr=addr, private_key=wif) 39 | 40 | @app.route('/key/') 41 | @app.route('/key/') 42 | def default_key(foo=1): 43 | return render_template('error.html', error='Invalid Key') 44 | 45 | @app.route('/page/') 46 | def show_page(page_num): 47 | max_p = max_pages() 48 | if page_num < 1: 49 | page_num = 1 50 | if page_num > max_p: 51 | page_num = max_p 52 | p = [secret_to_address(i) for i in page_range(page_num)] 53 | return render_template('page.html', page=page_num, page_elements=p, max_pages=max_p) 54 | 55 | @app.route('/page/') 56 | @app.route('/page/') 57 | def default_page(foo=1): 58 | return show_page(foo) 59 | 60 | @app.route('/lottery') 61 | def lottery(): 62 | return render_template('lottery.html') 63 | 64 | @app.route('/gen_pair') 65 | def gen_pair(): 66 | sec_exp = random.randint(1, MAX_EXPONENT) 67 | _, priv, addr, _ = secret_to_address(sec_exp) 68 | return '{} {}'.format(priv, addr) 69 | 70 | @app.errorhandler(404) 71 | def not_found(error): 72 | return render_template('error.html', code=404, error='File not found'), 404 -------------------------------------------------------------------------------- /static/main.css: -------------------------------------------------------------------------------- 1 | body{font-size: 9pt; font-family: sans-serif;} 2 | table{font-family: monospace;} 3 | td{padding: 0px 5px;} 4 | a{text-decoration: none} 5 | a:hover {text-decoration: underline} 6 | thead tr th { background: #9fd8ef; } 7 | table tr:hover td { background: #f0f0f0; } 8 | tr:target { background: #ccffcc; } -------------------------------------------------------------------------------- /templates/error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Error 5 | 6 | 7 | 8 | Error {{code}} {{ error }} 9 |
10 | Return to the homepage or go back 11 | 12 | -------------------------------------------------------------------------------- /templates/home.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Bitcoin private key database 5 | 6 | 7 | 8 |

Bitcoin private key database

9 |

10 | Note: This is an open-source clone of directory.io for my personal educational-purpose.
11 | Don't try to scrape/download this website. Download the source code and run it youself

12 | This website contains all the possible Bitcoin private key.

13 | A private key it's just a number chosen randomly from a range, 14 | if this range (called key-space) is big enough it won't be possible 15 | to list all the keys in feasible times.

16 | Bitcoin private keys range from 1 to 115792089237316195423570985008687907852837564279074904382605163141518161494336

17 | The key-space it's too big to index all the keys (http://redd.it/1rurll), but you can however generate private keys on demand.

18 | For this reason I have developed this on-demand database and also a Lottery that will take a random private key from the key-space and tell you if it has some bitcoin available. ;)
19 |

20 | Take me to the Lottery
21 | Take me to the Database
22 |
23 | Original directory.io FAQ
24 |

25 |
26 |

27 | Source code
28 | Donate BTC: 1EhJyJwzbp7v2ixPT4heM2caUsmWcX36mc
29 | Monero: 47Yk8KgtYyaV2RvzJLQKuuMzhiZD5ktdbNzP6jxsjkdSKD8j81uLRCYXKLFVFtsCbLjbyamGBES58Mi4r8wHEGht8ofEVu7 30 |

31 | 32 | -------------------------------------------------------------------------------- /templates/key.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Private Key: {{private_key}} 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |
Secret Exponent:{{ sec }}
Private Key:{{ private_key }}
Address:{{ addr }}
Compressed Address:{{ compressed_addr }}
26 |
27 |

28 | Return to the homepage or go back 29 |

30 |

31 | Source code
32 | Donate BTC: 1EhJyJwzbp7v2ixPT4heM2caUsmWcX36mc
33 | Monero: 47Yk8KgtYyaV2RvzJLQKuuMzhiZD5ktdbNzP6jxsjkdSKD8j81uLRCYXKLFVFtsCbLjbyamGBES58Mi4r8wHEGht8ofEVu7 34 |

35 | 36 | -------------------------------------------------------------------------------- /templates/lottery.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Bitcoin private key lottery 5 | 6 | 7 | 8 |

Bitcoin private key lottery

9 |

10 | 11 |

12 |

13 |
14 |

15 | Source code
16 | Donate BTC: 1EhJyJwzbp7v2ixPT4heM2caUsmWcX36mc
17 | Monero: 47Yk8KgtYyaV2RvzJLQKuuMzhiZD5ktdbNzP6jxsjkdSKD8j81uLRCYXKLFVFtsCbLjbyamGBES58Mi4r8wHEGht8ofEVu7 18 |

19 | 63 | 64 | -------------------------------------------------------------------------------- /templates/page.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Page: {{page}} 5 | 6 | 7 | 8 |

Bitcoin private key database

9 |

Page {{page}} of {{max_pages}}

10 |

11 | previous - next 12 |

13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | {% for row in page_elements %} 21 | 22 | 23 | 24 | 25 | 26 | {% endfor %} 27 | 28 |
Private KeyAddressCompressed Address
{{ row[1] }}{{ row[2] }}{{ row[3] }}
29 |

30 | previous - next 31 |

32 |
33 |

34 | Return to the homepage or go back 35 |

36 |

37 | Source code
38 | Donate BTC: 1EhJyJwzbp7v2ixPT4heM2caUsmWcX36mc
39 | Monero: 47Yk8KgtYyaV2RvzJLQKuuMzhiZD5ktdbNzP6jxsjkdSKD8j81uLRCYXKLFVFtsCbLjbyamGBES58Mi4r8wHEGht8ofEVu7 40 |

41 | 42 | --------------------------------------------------------------------------------