I made a bitcoin display!
First of all, I think that bitcoins are really neat. I hate that a third party, like Visa, or Wells Fargo, can dictate who I send money to. This is particularly frustrating when these corporations use their power to restrict free speech (can't send money to WikiLeaks!). Bitcoins solve lots of this!
I want to support this currency becoming more commonplace, and what better place than a hackerspace to lead the charge in Phoenix of people accepting bitcoins? (as of now, there are only a few places
[on of which is a Law Firm! AWESOME!] in Phoenix to spend them).
Thus: BITCOIN BOT!
First of all, it is a little hypocritical of me to say that I support BTC because I don't want corporations controlling my money, but then encouraging people to sign up for a coinbase account... I know. The rationale here is that while I use coinbase, and encourage others to as well, I don't have
to. If coinbase can make it easy for people with a bitcoin interest to satsify that interest, and this results in more wide acceptance of bitcoin, then I think that is justifiable. I can stop using coinbase, and transfer my money to local wallet whenever I want. I would compare this to email. I trust coinbase with my coins just like I trust gmail with my emails.
How to make one!
Making this was really easy! First I started looking at different wallet APIs, and I was a little disappointed to find out that nobody (that I could find) offered a read-only API. Having an API key floating around that would allow out-of-wallet-transfers, and storing that securely, is its own project...
I was really excited when I found out that coinbase has a feature called CallBack URLs
. This features, when enabled, will fetch a specified URL every time coins get deposited a specified coinbase wallet. This means that I can get a notification every time we get a donation, and that I don't have to expose our account to unnecessary security risks. Awesome!
So for example, when a deposit comes in to: 14aTmbF5BBFsFWkTj4c3bWYGFcxJ8UNawh, which is our address, coinbase will fetch a URL that I have specified (for example: http://example.com/btc_callback.cgi). If btc_callback.cgi is a perl/python/etc script, it can keep track of this, and perform an action when it happens (like making a doll dance!).
So here is some code for you:
Check out the Github Repo
btc_callback.cgi: this is the script that you want coinbase to fetch. Go ahead and read it all, it's very straightforward. It will modify a file called "current.btc", which is in the current directory.
btc_arduino.ino: this is the sketch that goes on your arduino! You will, obviously, need an ethernet shield for this to work. I used the ethernet shield from arduino (although there are lots of clones). I also used sparkfun's SerLCD module. You don't HAVE to do it this way, but we had one of these LCDs sitting around the lab. The code for this is pretty simple to read through as well.
Think this is cool?
Awesome! Come down to the lab and build stuff like this with us! Or check out our website
. The point of this robot was to accept donations, so if you would like to make a donation to us (first: thanks!), our bitcoin address is: 14aTmbF5BBFsFWkTj4c3bWYGFcxJ8UNawh . (This will probably be very confusing to anybody sitting int he lab at the time, haha)
Thanks for reading!