hamdi (OP)
|
|
March 12, 2012, 08:05:40 AM |
|
hi.
how can i generate a valid address + key in PHP without any extra tools?
so that i can save the adress+key on the server and later import these into "Armory"
i want a website to receive BTC without actually steadily connecting to a bitcoind.
thanks for any directions!
|
|
|
|
BurtW
Legendary
Offline
Activity: 2646
Merit: 1137
All paid signature campaigns should be banned.
|
|
March 12, 2012, 08:22:43 AM |
|
You can generate as many key pairs as your heart desires at https://www.bitaddress.orgYou can download the script and run it on a computer totally disconnected from the internet. It will also print out the key pairs to create paper wallets.
|
Our family was terrorized by Homeland Security. Read all about it here: http://www.jmwagner.com/ and http://www.burtw.com/ Any donations to help us recover from the $300,000 in legal fees and forced donations to the Federal Asset Forfeiture slush fund are greatly appreciated!
|
|
|
ThomasV
Legendary
Offline
Activity: 1896
Merit: 1353
|
|
March 12, 2012, 09:12:40 AM |
|
hi.
how can i generate a valid address + key in PHP without any extra tools?
so that i can save the adress+key on the server and later import these into "Armory"
i want a website to receive BTC without actually steadily connecting to a bitcoind.
thanks for any directions!
you should not generate private keys on your server, that's not safe. with Electrum, you can generate new Bitcoin addresses without storing private keys on your server. This is possible because it uses a "type 2" deterministic wallet, where all your addresses are generated from a public master key. if an attacker get access to the public master key, they can know the addresses that you use, but they cannot steal your coins. see this demo: http://ecdsa.org/remote.php
|
Electrum: the convenience of a web wallet, without the risks
|
|
|
hamdi (OP)
|
|
March 15, 2012, 11:50:47 PM |
|
thanks you all!
|
|
|
|
cjp
|
|
March 16, 2012, 05:48:26 PM |
|
I'd also advice against keeping private keys on your server. Your server is online 24h/day, and it is probably visible that it's doing something with Bitcoin, so it's an obviously attractive target for hackers. So: just generate your key pairs on a different computer (in advance), and save only the public part (the Bitcoin address) on the server. I did it this way, on the donation page of my website: http://www.ultimatestunts.nl/index.php?page=12Please note that my website appears to have functionality that creates new addresses. This is fake: in reality, these "new" addresses are already present on the server (only the public part, as I adviced). I just have a pre-calculated pool of addresses, and whenever the server needs a new address, it takes a new one from the pool. Maybe that's also an interesting option for you.
|
|
|
|
hamdi (OP)
|
|
May 12, 2012, 06:26:59 PM |
|
i still want to create the addresses via PHP i would create the address and send the private key to another server. is there an example how to create a valid btc address + private key in php? basically i just want what www.bitaddress.org ´s javascript does in php.
|
|
|
|
kjj
Legendary
Offline
Activity: 1302
Merit: 1026
|
|
May 21, 2012, 05:45:14 AM |
|
I got it working. You need a library for EC math and the curve definition for SEC p256k1.
You generate the private key yourself, and converting it to a WIF is pretty simple. To get the public key, you multiply G (the generator from the p256k1 curve) by the private key. From there, creating an address is simple too.
I'm using the LGPL ECC library from Matyas Danter, but it took some effort.
|
17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8 I routinely ignore posters with paid advertising in their sigs. You should too.
|
|
|
Realpra
|
|
June 04, 2012, 08:43:48 AM Last edit: June 06, 2012, 01:44:59 PM by Realpra |
|
* So if I download that HTML/javascript code here www.bitaddress.org, it will work yes? (Did a quick test myself, just wondering if it is also working correctly) * Has someone extensively tested that these addresses work and are not sent to the operator of that site or some hardware disc location? * Say someone makes a bad script is it possible to create non-valid addresses/key pairs (ie if I transfer money there they get locked forever). Can I test addresses somehow? * Is the script dependent on your OS and java updates, could it fail if run on a clean Ubuntu install? I ask all of this as I am about to transfer a decent pile of cash to addresses I want to generate offline on a live cd running Ubuntu.
|
|
|
|
weex
Legendary
Offline
Activity: 1102
Merit: 1014
|
|
June 04, 2012, 10:01:18 AM |
|
* So if I download that HTML/javascript code here www.bitaddress.org, it will work yes? (Did a quick test myself, just wondering if it is also working correctly) I have used this method to generate addresses so I think it's reasonable. I actually used vanitygen to generate addresses and modified the code to accept my private key. The current version of bitaddress.org actually accepts private keys but I can't say it did when I worked on it. What's nice is the private key vanitygen gives you yields the same address on bitaddress.org as shown by vanitygen. You could use this as a way to double check. * Has someone extensively tested that these addresses work and are not sent to the operator of that site or some hardware disc location?
You can go offline after downloading the web page but for the super-paranoid you want to be mindful of a couple of possibilities. Someone could hack bitaddress.org and place their own malicious code there that: a) generates bad addresses b) sends them to a server c) instead generates them all from a seed that is stored by a server. * Say someone makes a bad script is it possible to create non-valid addresses/key pairs (ie if I transfer money there they get locked forever). Can I test addresses somehow?
You can test this process by generating an address however you want to and sending 0.01 BTC to it. Then creating a new wallet at blockchain.info and importing the private key into that My Wallet. Finally, send the coins back to a known-good address of yours. If the transactions is confirmed, your process works (barring security concerns). * Is the script dependable on your OS and java updates, could it fail if run on a clean Ubuntu install?
I ask all of this as I am about to transfer a decent pile of cash to addresses I want to generate offline on a live cd running Ubuntu.
I guess you mean dependent. Every script needs some sort of environment in which to run. PHP can be made pretty well machine independent. Python too. I'm actually looking at trimming down pywallet.py to create a utility that has the minimum amount of code required to generate a new address and private key and print them to the screen.
|
|
|
|
Realpra
|
|
June 06, 2012, 01:46:35 PM |
|
Thanks.
Yes I meant dependent.
I suppose I can look through the code for how its seeded.
I'll report back if I find anything suspicious.
|
|
|
|
weex
Legendary
Offline
Activity: 1102
Merit: 1014
|
|
June 06, 2012, 04:03:56 PM |
|
Ok, in case it is of use to anyone, I have gotten some help from Joric to create a script that generates keys in only python. This could be called from your PHP. Inside it supports generating keys from a passphrase or from a known private key and more. https://github.com/weex/addrgen
|
|
|
|
dooglus
Legendary
Offline
Activity: 2940
Merit: 1333
|
|
June 06, 2012, 08:15:31 PM |
|
Ok, in case it is of use to anyone, I have gotten some help from Joric to create a script that generates keys in only python. This could be called from your PHP. Inside it supports generating keys from a passphrase or from a known private key and more. https://github.com/weex/addrgenVery nice, thanks. If you're aiming for minimal, none of set_privkey(), set_pubkey(), get_privkey() seem to be used at all.
|
Just-Dice | ██ ██████████ ██████████████████ ██████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████ ██████████████ ██████ | Play or Invest | ██ ██████████ ██████████████████ ██████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████ ██████████████ ██████ | 1% House Edge |
|
|
|
weex
Legendary
Offline
Activity: 1102
Merit: 1014
|
|
June 06, 2012, 10:37:10 PM |
|
If you're aiming for minimal, none of set_privkey(), set_pubkey(), get_privkey() seem to be used at all.
Thanks, removed.
|
|
|
|
Stephen Gornick
Legendary
Offline
Activity: 2506
Merit: 1010
|
|
June 15, 2012, 09:21:23 AM |
|
|
|
|
|
|
bitfreak!
Legendary
Offline
Activity: 1536
Merit: 1000
electronic [r]evolution
|
|
September 08, 2012, 08:08:12 PM |
|
Bitcoin SCI (PHP): process transactions yourself!That project contains all the tools necessary for generating bitcoin addresses with only PHP. It started as a simple effort to generate new bitcoin addresses in PHP but I decided to go that extra step and create a sort of private bitcoin payment gateway. It allows for generation of new addresses and confirmation of bitcoin transactions without having bitcoind installed on the server. Or to provide a potentially simpler alternative solution, there's also the PHP Bitcoin Address Creator which is PHP script designed to execute a variant of the bitcoin-off-the-grid bash script. However the bash script has multiple dependencies so it's not exactly plug-and-play in all cases, and that's why I opted to design a pure PHP solution.
|
XCN: CYsvPpb2YuyAib5ay9GJXU8j3nwohbttTz | BTC: 18MWPVJA9mFLPFT3zht5twuNQmZBDzHoWF Cryptonite - 1st mini-blockchain altcoin | BitShop - digital shop script Web Developer - PHP, SQL, JS, AJAX, JSON, XML, RSS, HTML, CSS
|
|
|
scintill
|
|
September 08, 2012, 09:40:57 PM |
|
Bitcoin SCI (PHP): process transactions yourself!That project contains all the tools necessary for generating bitcoin addresses with only PHP. It started as a simple effort to generate new bitcoin addresses in PHP but I decided to go that extra step and create a sort of private bitcoin payment gateway. It allows for generation of new addresses and confirmation of bitcoin transactions without having bitcoind installed on the server. Or to provide a potentially simpler alternative solution, there's also the PHP Bitcoin Address Creator which is PHP script designed to execute a variant of the bitcoin-off-the-grid bash script. However the bash script has multiple dependencies so it's not exactly plug-and-play in all cases, and that's why I opted to design a pure PHP solution. Man, where were all these implementations when I looked last week to see if it had been done? (mostly for curiousity, not a personal need at this point.) It's hard to search for, because "xyz php" always seems to match any page about "xyz" written in PHP. Anyways, Bitcoin SCI looks nice, and thanks for the RobKohr link too! Edit: Oh, missed the fact that RobKohr's code is not actually native PHP, if that matters to people.
|
1SCiN5kqkAbxxwesKMsH9GvyWnWP5YK2W | donations
|
|
|
|