Author

Topic: Extracting Private Key - (java or rpc) (Read 1409 times)

full member
Activity: 125
Merit: 100
April 20, 2011, 09:30:16 PM
#7
You're right. I got it installed and works great. (No small feat since I'm just good enough at linux to be dangerous).
As far as what I'm doing: I'm feeding the keys into an elliptic curve function to encrypt something else.
legendary
Activity: 1526
Merit: 1129
April 20, 2011, 01:42:08 PM
#6
What are you actually trying to achieve? Sipas patch gives you what you want if you've built software on top of the official BitCoin C++ software. If you want to stay in "pure java" land then BitCoinJ can help but as you note, it can't use the c++ clients wallets. Also if you want to buy/sell things with it, BitCoinJ is too immature for that at present. It's also dangerous to use if you aren't sure what you're doing.

You can just compile your own bitcoind with sipas patch and use a java json-rpc library.
full member
Activity: 125
Merit: 100
April 20, 2011, 12:22:01 PM
#5
Oh... I see. So its a full client replacement?
Still not sure thats going to work for me but I appreciate it.
The service I'm developing has an end user component that needs access to the keys. Requiring a different client wouldn't be optimal but if thats the only choice I have I may go that way.

If anyone happens to have a pure java version I'd be willing to pay a small amount from my meager bitcoin collection.
legendary
Activity: 1072
Merit: 1178
April 20, 2011, 12:06:03 PM
#4
It adds RPC calls dumpprivkey and importprivkey.
full member
Activity: 125
Merit: 100
April 20, 2011, 12:05:05 PM
#3
Unfortunately I would need it to work in java.
legendary
Activity: 1072
Merit: 1178
April 20, 2011, 11:58:26 AM
#2
I have a patch in my walletdump branch that can export and import private keys. It is still dangerous to do so, including a chance of corrupting your wallet if keys are used in several place at the same time.

See https://github.com/sipa/bitcoin/tree/walletdump
full member
Activity: 125
Merit: 100
April 20, 2011, 11:54:51 AM
#1
I'm developing a small bitcoin service and I've got everything working great except for one hangup: I can't for the life of me figure out how to programatically extract the private key from the wallet.
I looked at bitcoinj but it appears to use a different format than the standard client.
I'm pretty new to bitcoin so maybe I'm missing something obvious.
The only way I've been able to do this so far has been modifying bitcointools to show the whole address in a dump and parse it out by hand.
Is there code floating around to do this in java with the standard berkley db format?

Jump to: