Bitcoin Forum

Bitcoin => Wallet software => Topic started by: Anders on May 24, 2011, 05:37:51 PM



Title: Bitcoin Wallet in Java
Post by: Anders on May 24, 2011, 05:37:51 PM
Is there any Java open source code for implementing a Bitcoin wallet? I would like to develop a server-side wallet.


Title: Re: Bitcoin Wallet in Java
Post by: Anders on May 24, 2011, 05:46:38 PM
I found a Bitcoin client implementation in Java called BitcoinJ: http://code.google.com/p/bitcoinj/

But I'm not sure it's a real wallet implementation. For example, it says: "It does not store a full copy of the block chain..." Isn't that needed in order to be able to store bitcoins?


Title: Re: Bitcoin Wallet in Java
Post by: TheKoziTwo on May 24, 2011, 06:25:03 PM
Nope... you only need private/public keys to store your coins and they are stored in your wallet.dat file. The block chain is needed to verify spends etc.


Title: Re: Bitcoin Wallet in Java
Post by: Anders on May 24, 2011, 06:53:24 PM
Nope... you only need private/public keys to store your coins and they are stored in your wallet.dat file. The block chain is needed to verify spends etc.

Ok, but if I want to be able to make actual bitcoin transactions directly from the server, is a full copy of the block chain needed then?


Title: Re: Bitcoin Wallet in Java
Post by: Mike Hearn on May 24, 2011, 07:04:32 PM
No. I suggest you read Satoshis white paper to start with. BitcoinJ implements "simplified payment verification". It's a much less resource intensive approach but you rely on the strength of the network or a connection to a trusted node.

You can receive coins and send them just fine. But I ask that you be careful with BitCoinJ. It's still a very new codebase and isn't ready for primetime yet. The wallet formats will change, the APIs will change, there are bugs and missing features, etc. Only send around small quantities of money or use the testnet.


Title: Re: Bitcoin Wallet in Java
Post by: Anders on May 24, 2011, 07:12:08 PM
No. I suggest you read Satoshis white paper to start with. BitcoinJ implements "simplified payment verification". It's a much less resource intensive approach but you rely on the strength of the network or a connection to a trusted node.

You can receive coins and send them just fine. But I ask that you be careful with BitCoinJ. It's still a very new codebase and isn't ready for primetime yet. The wallet formats will change, the APIs will change, there are bugs and missing features, etc. Only send around small quantities of money or use the testnet.

I have read the white paper briefly. Will take a closer look at it. I was thinking as an experiment to run BitCoinJ on Google App Engine, but that platform doesn't allow opening sockets (only port 80 url fetch allowed) if I remember correctly. I assume that could be a problem if the Bitcoin API relies on some special port number(s).


Title: Re: Bitcoin Wallet in Java
Post by: Mike Hearn on May 24, 2011, 09:50:49 PM
Yes, it won't work on AppEngine. People who are hosting Bitcoin sites like the faucet on there are using RPC to a private server.


Title: Re: Bitcoin Wallet in Java
Post by: jimbobway on May 24, 2011, 10:38:01 PM
No. I suggest you read Satoshis white paper to start with. BitcoinJ implements "simplified payment verification". It's a much less resource intensive approach but you rely on the strength of the network or a connection to a trusted node.

You can receive coins and send them just fine. But I ask that you be careful with BitCoinJ. It's still a very new codebase and isn't ready for primetime yet. The wallet formats will change, the APIs will change, there are bugs and missing features, etc. Only send around small quantities of money or use the testnet.

Mike, I was just wondering how long it will be before you feel confident in BitcoinJ such that you would recommend it for large transactions?


Title: Re: Bitcoin Wallet in Java
Post by: Anders on May 24, 2011, 10:48:52 PM
Yes, it won't work on AppEngine. People who are hosting Bitcoin sites like the faucet on there are using RPC to a private server.

I saw somewhere that someone used Google App Engine but together with the Amazon cloud service. Maybe Amazon allows applications to open sockets on other ports than 80.


Title: Re: Bitcoin Wallet in Java
Post by: Mike Hearn on May 25, 2011, 06:56:07 AM
I don't know yet. Probably at least a couple of months. At the very least we need to implement the fee rules.

After my current chunk of work is done I'll be releasing 0.2, which has lots of new features over the last release. In the 0.3 release I'll do some more work towards stabilising the wallet format and some core interfaces.

The good news is it's not just me anymore. There's quite a nice developer community forming around the project, so progress will hopefully pick up a notch.


Title: Re: Bitcoin Wallet in Java
Post by: Anders on May 25, 2011, 09:02:59 AM
I don't know yet. Probably at least a couple of months. At the very least we need to implement the fee rules.

After my current chunk of work is done I'll be releasing 0.2, which has lots of new features over the last release. In the 0.3 release I'll do some more work towards stabilising the wallet format and some core interfaces.

The good news is it's not just me anymore. There's quite a nice developer community forming around the project, so progress will hopefully pick up a notch.

Are you working on a tunneling via HTTP for the bitcoin transactions? That would be really cool.


Title: Re: Bitcoin Wallet in Java
Post by: Mike Hearn on May 25, 2011, 09:45:07 AM
I'm not. But feel free to contribute a patch to add an example of how to do it and improve support. The API for it already exists - you can create a transaction, then confirm it as sent later, so you don't have to submit via the P2P network.


Title: Re: Bitcoin Wallet in Java
Post by: Anders on May 25, 2011, 10:22:16 AM
I'm not. But feel free to contribute a patch to add an example of how to do it and improve support. The API for it already exists - you can create a transaction, then confirm it as sent later, so you don't have to submit via the P2P network.

One problem is that I only use Google App Engine at the moment. I could develop an extra API for that to run locally on my computer, but I would like to be able to run it on an external server. It would be nice if Google could develop a Bitcoin web service or something like that and run it on their infrastructure. Free of course!  ;D