Author

Topic: Random Address generator and balance checker (Read 1515 times)

legendary
Activity: 1442
Merit: 1186
August 08, 2016, 09:27:38 PM
#6
Here you go. Don't run this more than 100 times in 5 minutes or you'll get the ban hammer from Blockchain.

http://phpfiddle.org/lite/code/4q2m-6sga

Code:
$counter 0;
while(
$counter 5){
//gen new key pair
$url "https://blockchain.info/q/newkey";
$content file_get_contents($url);
$arrEx explode(" "$content);

$bitcoin_address $arrEx[0];
$privKey $arrEx[1];
//check the balance
$jsondata json_decode(file_get_contents("https://blockchain.info/address/$bitcoin_address?format=json"), true);
$totRec $jsondata["total_received"];
echo "Address: ".$bitcoin_address;
echo "
Key: "
.$privKey;
echo "
Bal: "
.$totRec ."

"
;
$counter++;
}
?>

newbie
Activity: 17
Merit: 0
You don't necessarily need to generate Bitcoin addresses to get your point across. Just show them the math and the probabilities. The number of possible addresses is 2^160.

If you actually do want to write a program to do this, then you could use python, but it probably won't be very well optimized. Just use python with openssl and have openssl generate the keys. Then do the base58check encoding on the public key in order to get the Bitcoin address. Lastly, you can use it with cURL to send api requests to whatever REST API you want to use.

Yes I know it is impossible and I found really useful infographics and graphs. but if it is not hard for me, i want to show this matrix lines Smiley. Thanks for advice, i will check.
newbie
Activity: 17
Merit: 0
Electrum (which is a desktop wallet in case you don't know) is written in Python. I'm pretty sure you could start from there for what comes to generating addresses , as for checking the balances If you can't run bitcoind on your own server , you can simply use the Blockchain.info API , there is a lot of tutorials out there.

Thanks. I will check.
staff
Activity: 3458
Merit: 6793
Just writing some code
You don't necessarily need to generate Bitcoin addresses to get your point across. Just show them the math and the probabilities. The number of possible addresses is 2^160.

If you actually do want to write a program to do this, then you could use python, but it probably won't be very well optimized. Just use python with openssl and have openssl generate the keys. Then do the base58check encoding on the public key in order to get the Bitcoin address. Lastly, you can use it with cURL to send api requests to whatever REST API you want to use.
staff
Activity: 3500
Merit: 6152
Electrum (which is a desktop wallet in case you don't know) is written in Python. I'm pretty sure you could start from there for what comes to generating addresses , as for checking the balances If you can't run bitcoind on your own server , you can simply use the Blockchain.info API , there is a lot of tutorials out there.
newbie
Activity: 17
Merit: 0
Hi,

Nowadays I am planing to give a talk about bitcoin and blockchain and want to show about address security. So I want to code a script which randomly (and if possible a vocabulary attack) generates bitcoin address and check their balances. When I tell people it is really secure, they didn't get it. And my plan is showing them actually how is strong while I talk.
 
I don't have enough technical background but I had learned some python in ccodecademy.com.

Thanks for help.
Jump to: