Weekend Bitcoin Project Recap

I dream of a future where everyone is their own bank, money is internet native, and the world is a true decentralized meritocracy. Such things are promised by crypto and its advocates. Wouldn’t that be great.

Maybe that will happen, maybe it won’t. (I hope it does.) Regardless, bitcoin is super interesting and each passing day it looks less and less like it’s going away, and more and more like it will stick around as a legitimate financial tool in our world. So I’ve started daydreaming cryptocurrency applications and playing around with the technology.

Most recently some things came together in my mind that made me interested in building a thing that lets you send crypto to people by publishing the transactions on Twitter. I’ve been spending a bunch of time on Twitter tweeting about things I’m thinking about and trying to make internet friends. I think the platform is really undervalued at the moment and I like thinking about what will be possible in a world where it realizes its potential. Which is to say this idea that I had is not exclusive to Twitter, it can be built on any social platform, but Twitter is the one I’m thinking about and using right now.

Anyway so the core of the idea is “publishing transactions online.” The cryptographic nature of cryptocurrency means all spending activity, all sending and receiving money, can be public for anyone to look at. For every bitcoin in existence, it’s possible to trace it all the way from when it was created, every time it was spent, to what Bitcoin address currently owns it. There is no risk in this information being public because only the person who owns the secret key behind an address has the power to spend the Bitcoin associated with that address.

An implication of the Bitcoin system being secure even when all transaction information is out in the open is that you can post transactions anywhere. If there is a way to get that transaction information – info that sends Bitcoin from one address to another – to a Bitcoin miner, then the transaction will go through and the person on the receiving end will get Bitcoin.

This quote from The Internet of Money is what planted the seed in my mind when I read the book a few months ago.

“Bitcoin is fundamentally different. What I’m transmitting is not the key, but simply a signed message. It is an authorization. That authorization has two external references: (1) to where the money’s coming from by referencing an unspent output on the blockchain, and (2) a reference to where I want to send the money — by creating a new encumbrance, a new limitation on who can spend the money, usually a public key or bitcoin address. That transaction contains no sensitive data. If you steal the information in the transaction, all you know is which address the money came from, which address the money’s going to, and how much. That’s it. The signature reveals nothing. The addresses reveal nothing. There are no identifiers. You could take the transaction and print it out. You could post it on a billboard. You could shout it from the rooftop. A bitcoin transaction can be transmitted over completely unsecured Wi-Fi. By smoke signal. By light signal. With carrier pigeons. It doesn’t matter. Nothing in that message can be compromised.”

Excerpt From: Andreas M. Antonopoulos. “The Internet of Money.”

So my idea was to build an app with two parts:

  1. A client that constructs Bitcoin transactions for you and posts them to Twitter
  2. A bot that listens for these transactions and sends them to the Bitcoin network so they get processed

I did some research and figured out how to set up my own Bitcoin node using bcoin. But eventually I turned away from the approach of publishing raw transactions on Twitter. It’s super cool but it requires people to manage their own wallets so that they would have a private key to supply my app with in order to generate transactions. This is a pretty high barrier to entry because it requires not only a level of technical skill but also a deep understanding of Bitcoin and wallet management. Lots of people (aka me) don’t have both of those things but still want to use crypto.

So I started looking into the Coinbase API.

Coinbase is a large ($100B!) company that invests a lot of money into managing wallets and private keys for people. They also have an API that developers can use to programmatically send Bitcoin.

While tweeting raw transactions would be cool, I became more interested in using a third party API to send the transactions because it would be eminently more usable. So I mapped out how the app would work by taking advantage of the Coinbase API.

  1. User logs into the app using Coinbase OAuth, which gives the app an access token to make requests on their behalf to Coinbase.
  2. User authenticates the app against Twitter, thus associating their Twitter account with their Coinbase account.
  3. User tweets something like “@app send @myfriend 1,500 sats” where @app is the account owned by the application.
  4. The app has a server component which is listening for tweets to @app, picks up the tweet and looks up the sender in its database using the Twitter handle.
  5. The app looks up the receiver by their Twitter handle, and finds the associated Coinbase account.
  6. The app uses the access token stored with the sender’s account to send a request to the Coinbase API instructing it to send the given amount of Bitcoin to the receiving account.
  7. Coinbase sends a response asking for 2FA.
  8. The app sends a notification to the sending user asking for a 2FA code.
  9. User inputs a 2FA code into a mobile application, and the app makes a second transaction request to Coinbase, this time including the 2FA code.
  10. Coinbase processes the transaction and the receiving user gets some BTC 💵

I think this would work! And I think it would be a fun app that lets you use Twitter to send any cryptocurrency supported by Coinbase. But I decided to table the project for two reasons:

  1. There are already a bunch of these bots, which I found out are known collectively as “tip bots.” The ones I saw are free, and so there isn’t a great business model here.
  2. I wouldn’t be a primary user of the app. One day I hope to be paying for everything in crypto, but at the moment I just hold BTC as an asymmetric bet which might pay off over the long term.

Even though my dreams of running a Twitter crypto payments business lasted about a day and a half, I think the whole exercise was super valuable.

  • I know more about the actual software behind Bitcoin,
  • I designed a hypothetical crypto app,
  • I wrote a Coinbase OAuth React component that I will integrate into my Staq.js project,
  • I have my own self-hosted bcoin node running in the cloud (which I will continue to experiment with), and
  • I got two blog posts out of the whole thing (this one and a guide for self-hosting a bitcoin node in the cloud)

Not bad for a weekend of hacking around 🙂

Matt Roll @mroll