TollGate started off using an old c
based captive portal called nodogsplash.
The captive portal served a simple HTLM page and forwarded any input strings that were submitted to a script that redeemed the e-cash and authenticated the user’s session if the payment succeeded. The redeem script used an existing API called redeem.cashu.me to melt e-cash notes to a given LNURL over lightning.
The benefit of using nodogsplash was the simplicity with which input strings could be passed to a script and the simplicity of the user facing HTML page. This made it rather straight forward to create a demo for TollGate. However, truncated input strings and a lack of control over session duration posed a challenge at the time.
Increasing the length of the input fields that the captive portal could process allowed the strings to be long enough to process e-cash strings with 2^{n}
SAT denominations. These are the shortest e-cash notes because they only contain a single proof. Unfortunately other denominations like prime numbers that resulted in longer e-cash strings continued to get truncated despite my fix.
After blaming microhttpd
, but failing to find the new bottleneck we gave up and tried a newer version of nodogsplash
called OpenNDS
. The issue may have simply been a limitation in the length of a scripts arguments in the shell terminal. This particular bottleneck was later resolved by writing the e-cash strings into a file and passing the file path to the redeem script.
Benefits: could specify session expiration time in redeem script
https://github.com/openwrt/openwrt
https://github.com/chGoodchild/nodogsplash/blob/increase_username_field/README.md
lua based captive portal that uses client side rendering - perhaps we can still build on this approach for serving a crows nest to first time users who don’t know anything about TollGate yet. However, the crows nest that we serve will need access to persistent storage in order to save their private keys.