Selling anonymous API access with Lightning + Cashu:

- Request access, server sends LN invoice

- Pay invoice, server gives you ecash

- Put ecash in HTTP header, call APIs

Server can't link payment to user, or who is doing what.

This is so simple, I must just build it.

Reply to this note

Please Login to reply.

Discussion

👀

I muted you because you wrote on the hell thread. Shame!

I’ve got to get off that thread. Do you have to mute everyone or is there a smarter way?

🫡

Yes

Server still has IP address and can link API calls that way, but better than alternatives

Another cyber department is responsible for that that layer ser

So each API call will also return remaining ecash token?

You can split it up in the beginning as much as you like. Say 1 request per satoshi, you pay 1000 sats, you get 1000 ecash tokens worth 1 sat.

I thought about using LN for monetizing API access, but this sounds better and achieves the goal to reduce roundtrips (compared to „create invoice for every request“)!

If I understood Cashu correctly, you can „top up“ a balance with the first LN invoice (say, 1000 sats), and then send 10 requests using 10 sats worth of ecash?

https://twitter.com/mrlukelukasson/status/1529192648015331330?s=46&t=8YH8IlzSo8cWrg_G3bi8Xg

Exactly, and the payment is push instead of pull, like in Lighting making it a lot easier to implement.

Pretty sure it could be built very easily using this lib: https://github.com/cashubtc/cashu-js

Jesus Christ!

And you don’t even need to handle the „balance“ in the background as I would have needed to do in my thought exercise.

You already solved this via Cashu itself, right ?! 👀

There is no balance in Cashu 😘

Let's build it! Join us: https://t.me/CashuBTC

⚡️⚡️

lnbc210n1pjqpetwsp583sjrcvz8h0xzue49rc74lterymd655j07jgaev8clekxlczkc5spp5ykv73yz3g7q49uzpg898ykxcp5g52eqgyld7zhux9wl8updl2wasdqvffhkkjr0v3kqxqzjccqpjrzjqfdwgqn4luevj3s75lm94fav3ndlswq56tva93qzychaea5l68eagza5eqqqjmgqqyqqqqqqqqqqqzcq9q9qyysgq8r98mydhdh2ajkufa4gsr7uc0axk052xxfpgr7nn27jplgzh267hvj8e4cvltskjyafcc574t4z4vuyhk4ngnw20zskm39lhmv9ntfsqxfyv76

That’s the point 😃

The first LN invoice represents the „balance“ (if compared to my thoughts) and you send ecash as long as you have any and then get new ecash tokens with the next LN invoice.

it’s very unstable

But lyapunov stable

asymptotically?

Asymptotes in unperiodic orbits?

(Sounds like Ike an indie band)

Good concept

Can't you do that with a normal Bearer token?

You Pay LN invoice ➡️ Server return `access_token` ➡️ you include 'Bearer ${access_token}' in Header

The token validity could be based on how much you pay. e.g. 10sats per API call

A 👏 no 👏 ny 👏 mi 👏 ty*

*using blind signatures

Ah of course, I confused server with the mint.

Because if they Mint were to issue the eCash/access_token, then it would know the new token and who it gave it to, right?

*would know the IP address (it gave the token to)

Not really the person

LN + Cashu applications are really fascinating!

#[0]

This post finally convinced me that there is a meaningful use case to Fediminta besides creating Fiat on Bitcoin rails.

Who needs anything other than btc tho

I've built a proof of concept. Pay for API access with ecash. Server doesn't know who you are.

- Server: a HTTP middleware with a Cashu mint and requires ecash in the HTTP header

- Client: HTTP client that puts ecash into header

It took me a couple hours. Mint and wallet are imported as libraries. It can't get simpler than this.

#[0]

This is 🔥 🔥 🔥

I can’t wait for ecash to catch on as the L3 of cyber money 💪💪

(Dumb qn) How does that work for sending the right payment amount? If you send an ecash it has a fixed amount right, so do you get a new one back as change?

Or when initially paying the LN invoice do you get a ton of worth-one-request ecash tokens back?

This is exactly the right question. I've just added the ability to mint a bunch of fixed-amount tokens with the python wallet: https://github.com/cashubtc/cashu/pull/121