A few days I discovered that there's
yet another SPV wallet app being developed on top of bitcoinj, meaning we have:
- MultiBit
- Bitcoin Wallet for Android
- Hive
- MacWallet
- Bitcoin Touch for Ubuntu
So I want to plug this fact and remind people that it's never been easier to design and build the wallet of your dreams. You can do it in
any language on this list, which includes Python, Ruby and JavaScript with simple "out of the box" usage, and we're making it easier over time to use C/C++/Objective-C if those are your cup of tea too.
Let me show you how easy it is to build a simple, attractive wallet app. It has the following features:
- Runs on Windows, Linux and MacOS
- Can fully catch up with the block chain in a few seconds, even for new users.
- Has a progress bar that watches sync progress and slides off the screen when done. An address to send money to fades in when synced.
- Has a clickable Bitcoin address that will either open a different wallet app, or show a QRcode, or copy to the clipboard.
- A button that lets you empty the wallet out, when you're done with it.
- A widget (in the send coins screen) that validates the Bitcoin address has no typos in it, and highlights the edit in red if it does.
- It lets you spend unconfirmed transactions, although changing that is just one line. So money turns up immediately.
It is not meant to be a full wallet app and does not have a list of transactions, exchange rates or other such things, although those would not be hard to add.
Open the wallet-template code in a new tab.
It's written in Java 8, which is more or less like your fathers Java except with easy lambda functions, support for some functional programming stuff and a nice UI toolkit. You could write such an app in lots of other languages though, and the code would probably be shorter.
Take a look at Main.java and see the code that creates the WalletAppKit object. That's all you need to bring up a connection to the P2P network and synchronize a wallet with it. Easy.
Go look at the Controller class. It handles the UI logic for the main screen. It's simple - the largest method in this class simply sets up the animation that runs when the blockchain sync is finished. It also wires up the wallet balance to the UI.
Open SendMoneyController. It handles the UI logic for the send coins screen. After the user enters a valid Bitcoin address, it creates a transaction that sends all the money in the wallet to that address (you could ask the user to enter an amount of course). Then there's some code to handle popping up a crash window if something goes wrong, and updating the UI to reflect the transaction as it propagates across the network. Actual logic here is about 50 lines of code, max.
In the controls directory, you can see two classes that manage working with Bitcoin addresses. One of them can be used to make an edit box validate an address and enable/disable buttons depending on if it's valid. The other creates a clickable address widget that can also display a QRcode.
The utils directory contains a variety of misc utilities that aren't Bitcoin specific, like for popping up themed alert windows and so on. It's not relevant here.
I hope you will agree that this isn't much code. The UI layouts are all edited with the free Scene Builder app.
Put simply, if you have even basic programming experience and you aren't happy with existing wallet apps, now is the time to design the UI of your dreams. All the heavy lifting is handled for you by the frameworks and you're left to just draw on the canvas and make the app work how you want.