As a big believer in bitcoin I've been super-excited by the developments in the Lightning Network layer 2 scaling solution. It takes bitcoin's relatively slow, cumbersome, expensive network and turns it into a payment system that is potentially on par with bank credit cards.
I wanted to learn more about the Lightning Network but even after I installed and funded a wallet, there just wasn't much I could do with it. I wasn't really looking to use it to just convert it back to fiat to buy gift cards. Meh.
And I learn best when I'm building a project of my own. I need to be hands-on. So after a few brainstorming sessions with friends, I came up with the idea to build a super-simple arcade game for the web that would be pay-to-play at an absurdly cheap rate--100 satoshis (about 1 cent). And by "super-simple" I was thinking 8-bit gaming or even Tetris level graphics since this was going to be a passion project that I'd build in my free time. And the point wasn't to spend enormous time on graphics; anyone can do that. The point was to build a working Lightning Node Lapp.
The a-ha moment for the game came when I realized that Lightning Network invoices (QR codes) looked like mazes. Then the pieces quickly started falling into place from there. Friends have likened it to a bit like Pac-Man but with our own twists on the gameplay. And it's just tons of fun to see 8-bit stacks of bitcoin just waiting to be saved, all why fleeing from the evil fiat that's chasing us!
What it does
EscapeQR is a fun web-based arcade game that uses the Lightning Network in a pay-to-play model. Just like an old-school arcade cabinet, but instead of dropping quarters into a machine, you complete a microtransaction on the Lightning Network. It's meant to be a demonstration of how simple, how fast, and how amazing the Lightning Network is. The hope is to encourage more people to install Lightning Network wallets and learn how it works by playing EscapeQR with super low-stakes transactions.
To that end we're building onboarding resources to help people learn about Lightning and set up their first Lightning wallet. We're even funding their wallets with some free sats via our Lightning faucet!
How I built it
The backend is built in python/django. Its main job is to manage API requests to my Lightning Network node (create invoice, get invoice status). The server layer also saves high scores. It's running serverless on AWS Lambda to save costs and talks to an RDS Postgres database. Static assets are on S3.
The final piece was blockstack and twitter sign-in integration. Players can always opt to skip sign-in and play anonymously, but if they do sign in, they'll have access to a record of their personal best high scores. We also plan on running some social media promotions ("Highest score this month wins...") that will only be available to players who sign in.
Challenges I ran into
Experimenting with the Lightning Network node and setting up payment channels wasn't easy and still isn't perfected. I was able to make sure that most of the major custodial Lightning Network wallets would be able to find a payment channel to my node and that there'll be at least some liquidity there to work with.
Accomplishments that I'm proud of
The whole dang thing, honestly! The game is simple but the feedback has been great and people are enjoying the game mechanics. The simple 8-bit bitcoin logo is just cool. I had them printed up as stickers and handed them out at the Bitcoin 2019 Conference and they were definitely a hit!
And it was really cool to get to present the project on the Crypto Bit Bus which took various crypto influencers from LA up to SF for Bitcoin 2019. Even though that crew is super-deep in the bitcoin/crypto community, most of them had never made a Lightning Network transaction before. It was great to guide these people that I follow daily on twitter and YouTube and teach them a bit about such a cool, important new piece of the bitcoin ecosystem.
What I learned
The Lightning Network is really impressive. I like playing EscapeQR on my laptop but doing the Lightning payment through my phone. That way I can see the speed from the phone click to the game reacting--usually in less than one second. There's something almost magical to see one device trigger an action on another like that.
The custodial Lightning Network wallets all pretty much work as expected and weren't any harder to use than any other typical crypto wallet. The non-custodial wallets... yeesh. Channel management. Liquidity management. Way too hard for all but the most hard core power users.
The vendors' side is definitely a challenge. It's just too difficult to get a Lightning Network node configured with decent payment channels that have any incoming liquidity. Late in the process I came across OpenNode which seems to be a much better option for vendors. No, you don't have full control of the funds going through OpenNode, but they've made it so easy to create a new account and your business can immediately start receiving Lightning Network transactions. I swapped EscapeQR over to OpenNode and (aside from some documentation shortcomings) have been thrilled with the change.
What's next for EscapeQR
More behind-the-scenes code improvements, deeper signed-in user experience, UI refinements, social media promo campaign to launch some competitions to drum up usage.
If there's time (and energy and brainpower), I'd also love to do an integration with one of my other projects: WAXBadges. It's an open platform for an eternal achievements system that lives on the WAX blockchain. For example, I could create a "Survivor" achievement for making it to Level 10 in EscapeQR. Once you unlock it, the server would call my WAXBadges smart contract and grant the signed-in user that achievement. That data would then persist publicly forever as long as WAX's mainnet is operational. I also built a WAXBadges Achievements Explorer (explorer.waxbadges.com) so users can see their achievement and share them out to social media. Would be fun to do a hype campaign for new EscapeQR achievements and cross-promote it via the @WAXBadges account to bring both of my small communities together.