Skip to content

jgilmour/brainwallet-check

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

Brainwallet Check

Overview

Brainwallet is a concept of memorizing a passphrase to generate a bitcoin address. If not used properly (ie. not using a secure passphrase that is easily guessable), the wallet can be generated with malicious intent to steal the bitcoins in it.

More information about what a brainwallet is can be found here: https://en.bitcoin.it/wiki/Brainwallet

Brainwallet Check is a python script that allows you to specify a passphrase as an argument and will generate the private key and bitcoin address based off the passphrase. In addition, it will check blockchain.info to see if the wallet has been used before, and if it has, it will return the amount stored in the wallet.

The script could easily be modified to read from a file, which could contain multiple lines of passphrases, however blockchain.info will temp-ban you if API requests are more than one every 10 seconds.

Requirements

  • Python 3
  • Python Modules: sys, ecdsa, urllib.request, urllib.error, binascii, hashlib

Install the required ecdsa module:

pip3 install ecdsa

Usage

Usage of Brainwallet Check is pretty simple, just call the python script and pass it along the passphrase:

python3 brainwallet-check.py 'passphrase to use' 

Examples

Basic run with no parameters:

root@techsmog:~/brainwallet-check# ./brainwallet-check.py
ERROR: Provide brainwallet string as parameter
./brainwallet-check.py 'Satoshi Nakamoto'

Basic run with a valid address, but nothing in the wallet:

root@techsmog:~/brainwallet-check# ./brainwallet-check.py  'Satoshi Nakamoto'
-----------------------------------------------------
brainwallet string: Satoshi Nakamoto
private key: a0dc65ffca799873cbea0ac274015b9526505daaaed385155425f7337704883e
bitcoin address: 1JryTePceSiWVpoNBU8SbwiT7J4ghzijzW
First seen according to blockchain.info: 1322885134
Wallet amount: 0
-----------------------------------------------------

Basic run with an address that hasn't been used yet:

root@techsmog:~/brainwallet-check# ./brainwallet-check.py 'gimme da loot'
-----------------------------------------------------
brainwallet string: gimme da loot
private key: f7d3dc8e32903ea6052ad28c347d7e0f3139150676b0a0d8f59d37699249bac3
bitcoin address: 1AYmvzSbZrdhV5S39S2Ce1u3xBqAhJUYaG
[ADDRESS ISN'T IN USE ACCORDING TO BLOCKCHAIN.INFO]
-----------------------------------------------------

Credit

A vast amount of this code is from JeromeS on bitcointalk.org forums. Specifically this thread: https://bitcointalk.org/index.php?topic=84238.0

Questions/Comments/etc ?

Feel free to fork!

Changelog

December 2025

  • Updated to Python 3 compatibility
  • Replaced urllib2 with urllib.request and urllib.error
  • Removed dependency on libpcre3-dev and external GET command
  • Changed API calls to use HTTPS instead of HTTP
  • Fixed integer division for Python 3 (/= to //=)
  • Added proper string encoding for hashlib operations
  • Added error handling for API connection failures

March 23, 2013

  • Initial release

About

Generates a bitcoin address and private key according to a 'brainwallet' string, then checks to see if the wallet is active

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages