Using a clock chip instead of a screen
Closed this issue · 1 comments
I have an idea of how to make this even cheaper by replacing the display with a clock chip (a cheap RTC).
Let the URL contain an encrypted secret, and let the server add a timestamp to that secret using the current time and some simple maths (xor or similar). Other information may be encoded in as well. The result is returned as a PIN. User enters PIN, timestamp is removed by XOR with the device's time (use 30 second or minute intervals and check values for a few minutes back and forth) and compare the resulting PIN with the fixed PIN on the device. The device can even correct it's own time if it consistently gets PINs based on time in advance or in the past.
Other information may be coded in as well.
Example, a very simple slow car charger. Price is 100 sat per hour, maximum 8 hours:
- User scans fixed QR code with LNURLp and encrypted secret s.
- User pays 200 sat for 2 hours.
- Server decrypt s and xor decrypted s with encoded current time and 2 for 200 sat.
- Server returns PIN.
- User enters PIN.
- PoS terminal removes time and secret and check the result for valid values (1-8).
- In the first or few attempts it will get the valid value 2 and close the relay powering the charger for 2 hours.
- If all the 10 past PINs indicated a time in the future or past, advance or revert the RTC by one minute.
The time and amount must be encoded in a way that minimizes the chance of a wrong amount becoming valid within a reasonable time scope.
Nice. Changed the name to reflect the idea better.
So how would you indicate a successful pin was entered, an LED?