Minimalistic and simple Bitcoin address generation by xpub. Use with python or php
-
Installing requirements
sudo apt update && apt install python3 python3-pip -y
sudo apt-get install python3-pip
pip3 install bitcoin
pip install git+https://github.com/primal100/pybitcointools.git@master
if errors, you can try:
bash requirements.sh
(not tested!) -
CLI python usage
-
python3 btc_by_xpubindex.py
Please enter your xpub: [YOUR-XPUB]
Please enter the index number: [ANY-NUMBER]
[outputs address] -
python3 list_by_xpub.py
Please enter your xpub: [YOUR-XPUB]
[outputs list of 100 btc addresses]
-
-
PHP usage
-
if you dont have lamp (php, mysql) installed, use this simple line
sudo apt install lamp-server^
-
copy all files to your local server e.g. /var/www/html/
-
simply create config database using
bash create_config_db.sh
enter your database's username, password and give a name to a new db -
configure 'db.php' file. enter database's username, password and name of created db
-
goto localhost from ur favorite browser
-
Index page will show first bitcoin address. Updating page will output next address.
-
goto localhost/manual_input.php to manualy enter xpub and select address, you wanna see.
!!! remember that 0 = first address !!!- To use it for assignment personal address on user registration:
edit
index.php
: comment, or remove this line:echo $xpub_address;
I guess, your index file should content anything other: you should rename sourceindex.php
, e.g.getbtc.php
sudo mv index.php getbtc.php
add linerequire_once('getbtc.php');
in your registration file and $xpub_address should output a new address every time.
-