This week I made some strides to get TollGate router-to-router payments finally working! Something we said 'will be possible' but hadn't reliably built yet, only some early prototypes were able to do it. And our upcoming event Zitadelle in Germany was good motivation to make the push to finally get this in our TollGate package. Maybe we'll meet you there...?
TollGate
Anyways, In the last weeks I'd already made a hacky attempt where i found out a major issue. The gonuts (golang) library we were using as our wallet did not support offline payments. Meaning the software would crash on startup if there was no internet connection, which as you can imagine is les than ideal in case of tollgate ;) So that's #issue1
As the library is not maintained anymore and there are no other golang options I decided for now to just for the repo and add the offline payments so we're not blocked on this. We are looking into options of incorporating the much better maintained and more complete Cashu CDK library.
Another issue #issue2 I encountered is that NDSCTL, the software we use for the captive portal does not create a user session UNLESS they first hit port 80 on the router, which is annoying because we do not and will not specify captive portals as part of the protocol, meaning we cannot force people to first visit port 80. To not be side-tracked by this we decided to just add a poll on port 80 when we do the detection, but this cannot be relied on long-term.
With the help of my nifty AI-assistant Claude i've been able to come up with a good solution for the network detection. Apparently there's the netstat library which I can use to real-time detect network changes on linux. And it works like a charm on detecting newly available gateways. It was a bit finicky to get it working for both cable and wifi, but it seems reliable now.
It's very satisfying to connect a LAN cable and see it pop up in the logs that it detected an upstream tollgate within a couple seconds! Very basic but this is what makes a dev happy ;)
Receipt.cash
I also spent a little bit of time on Receipt.Cash. For a while i've been wanting to reverse the flow of funds for reliability. I now decided it was time to actually do it. Because no-one is now using the tool and i can't confidently recommend it because of these risks.
I added the feature to upload an image instead of just snapping a picture. This was a feature-request of a privacy conscious person and i thought it was a great idea! This is now in the live version.
i'm still working on a branch so this is not deployed yet I first changed the receipt itself, now I price everything in sats and just include the conversion rate to btc when the receipt was captured.
And also because i store the price in btc (sort of because) i can easily display the price in whatever fiat currency someone desires.
I've been able to send settlementEvents with the mint_quote_id back to the receipt scanner and have them retrieve the money. I'm still hitting some errors where it fails to store the money so i lost plenty of sats by doing this. #eatYourOwnDogshit I'll always test with real money so I feel the pain of my own bugs.
I ended by adding a receipt overview so you could view historic receipts you've scanned and how far along people have paid them back to you.
Summary
- Forked gonuts to get offline payments working (fork). #issue1
- Polling
:80to trigger NDSCTL captive portal software as a short-term solution. #issue2 - Update Receipt.cash live version with image uploads instead of just having to capture
- WIP Receipt.cash
- Receipt edits
- Currency selection, receipt shared in sats
- Error reporting form
- Reverse payment flow (more reliable)
