Bitcoin’s lightning network has taken a big step toward a better user experience courtesy of new work by one of its principal open-source developers.

Widely believed to be the key to helping the cryptocurrency reach a mainstream audience by pushing it to handle millions of transactions, lightning still has a lot of work ahead of it. First and foremost, it’s not exactly safe to use yet. No less important is that the user experience has its kinks. Namely, the current way of generating addresses for accepting payments is not as easy or dynamic as it could be for many use cases.

But that is starting to change. Lightning Labs CTO Olaoluwa Osuntokun recently released a rough draft of a code change that would allow users to accept an address that doesn’t need to change each time. It’s a proof of concept, showing that payments can be made with a static address.

“When you do a payment, you request an invoice, that works well for some cases. But sometimes you might want to send to just a node – interaction from the receiver or not,” as Osuntokun put it in conversation with CoinDesk.

He added:

“I think it’s a really cool feature. Alice can send to Bob without Bob expecting it or having to do anything at all. Which is cool because it removes some friction.”

He added it might be good for games or tips, where people don’t necessarily need all the details an invoice provides, like who sent them money and for what item.

It’s been a much-requested feature since lightning, still in beta, was launched. Lightning K0ala, the pseudonymous developer who created lightning’s first hit game, even argued on Twitter: “This unlocks a whole set of possibilities for end-user UX.”

“It’s definitely needed,” Bitcoin Core and lightning network contributor Ben Woosley told CoinDesk.

Though, very importantly, it’s not a perfect code implementation — not by far. Plus, the usual warnings about using bitcoin’s lightning network while it’s still early-stage definitely still apply.

‘Spontaneous payments’

Right now in lightning, users and merchants accept payments via invoices.

Say a user wants a cup of coffee. The barista will generate an invoice saying a user owes them $3 worth of bitcoin. The invoice is fulfilled when the sender submits the correct amount.

Similar to bitcoin addresses, it’s a jumbled string of letters and numbers. This tweet from Twitter CEO Jack Dorsey might be the most widely seen example so far.

lnbc28600u1pw9n7g7pp5enjn8exsyymyl6mlxmcvy7fdcwuh04z96swfmtasznppglgdyvsqdqqcqzysc8rve6vdwuvketcn7yp8gu3ltvq29vj588erp3at9z2msqj0yhhjdwsf7qtfy5lwf8favm6u3wr5qklvprlhrz89pknpdfxnc55wy6sqnrxjh7 — jack (@jack) February 5, 2019

The main drawback to this method is an invoice can only be used once. If a user were to accept a second payment to the address, the payment could be stolen.

This works for a lot of commercial applications until it doesn’t. Some users want another option: to just slap an address somewhere, maybe to pull in donations. People often use bitcoin addresses in this way. People just post an address somewhere that multiple people can send donations to – a user might get 20 donations from people from across the world.

So, it’s no surprise that other developers have already thought a lot about how to implement this feature. Lightning developer René Pickhardt even “hacked” the lightning software to allow users to do so, releasing code for others who would want to do the same.

“That allows [users] to do spontaneous payments with the current implementations without the necessity for others to upgrade their nodes,” he told CoinDesk.

But with Osuntokun’s Sphinx send, spontaneous payments get a more formal – not accidental – introduction. With the change to LND, it adds an option for receiving payments.

“You just need the public key of the receiver,” he told CoinDesk, which doesn’t need to change each time the way an invoice does.

People call the new feature “spontaneous payments” because the recipient of a payment doesn’t have to approve that they’re getting a payment ahead of time, as is done with an invoice.

A ‘hacky’ start

While the code works, Osuntokun admits it’s “hacky” so far.

“Much of this [code] will likely change,” he said in the pull request introducing what he called a “rough draft” of the new feature. The next steps are pretty nitty gritty. Osuntokun told CoinDesk he’s next working on “finalizing” the software’s “extra blob format” (EOB), a change that would allow users to send more data attached to payments over the network.

In addition to Sphinx send, the code change will lay the foundations for future much-anticipated code changes, including Atomic Multi-Path Payments (AMP), a way to combine many lightning channels into one.

But even if it’s not ready for prime-time yet, Osuntokun is excited to see the lightning community start exploring it as an option. He and other developers think this could open up a range of new use cases, including donations and easier exchanges from one cryptocurrency to another.

As he said in the proposal:

“This allows users to start exploring a new set of use cases that benefits from this type of spontaneous payment.”

Light bulb via Shutterstock