-
Notifications
You must be signed in to change notification settings - Fork 20
Add a simple public-key-based authenticator #79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
TheBlueMatt
commented
Dec 29, 2025
JWT-based authentication is currently largely the default due to its integration in `ldk-node` indirectly via LNURL-auth. This is great, but massively over-engineered (and requiring yet another service devs have to set up and maintain) for just authenticating to a storage service (and maybe an LSP). In the next commit, we'll add an option for a much simpler authentication scheme, based simply on proof-of-knowledge of a private key and the service using the signing pubkey to identify where to store data. This then leaves authentication of installs to a higher-level (e.g. a web proxy that validates Apple DeviceCheck attestations before passing requests through to VSS).
JWT-based authentication is currently largely the default due to its integration in `ldk-node` indirectly via LNURL-auth. This is great, but massively over-engineered (and requiring yet another service devs have to set up and maintain) for just authenticating to a storage service (and maybe an LSP). Here we add a much simpler authentication scheme, based simply on proof-of-knowledge of a private key. This allows for a simple VSS install without requiring any additional services. It relies on some higher-level authentication to limit new account registration, but that can be accomplished through more traditional anti-DoS systems like Apple DeviceCheck.
|
👋 I see @valentinewallace was un-assigned. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we add a much simpler authentication scheme, based simply on
proof-of-knowledge of a private key.
I'm a bit skeptical of this approach right now. Generally there is no harm in supporting different authentication schemes, but we so far failed to establish a single standard authentication mechanism.
For that reason I'm afraid that adding more different authentication schemes could result in an even more complicated/confusion support matrix for users.
Any thoughts on that? Wouldn't it be preferable to commit to one scheme for now to finally establish a standard? Could you expand on why you couldn't just use the existing JWT auth for your usecase?
|
🔔 1st Reminder Hey @tankyleo! This PR has been waiting for your review. |
Isn't this mostly/almost entirely because we failed to ever actually offer any authentication mechanisms? The only auth mechanism currently implemented on the server-side (which was only recently added) is LNURL-Auth, which isn't even freestanding - it requires a second server somewhere that we don't provide. On the client side we allow for a "just give us the header" implementation to do fully-custom things, but that doens't help all that much either. If we'd provided a standard way to do authentication from day one, I have to assume people would have used it.
The authentication scheme here is totally different from what already exists - instead of having the wallet contact a server and ask for the server to sign off on the client accessing data for its user-id, this just allows the client to access its data by signing a message. This sidesteps having to implement a second server entirely, not to mention reduces complexity and dependencies. |
Well, no, at the time there was some push-back to the idea of featuring a particular default/preferred authentication scheme, as some people were of the opinion that that should be completely left to the user as they would want to integrate with whatever authentication infrastructure they'd already have in place.
Also not quite accurate, as we have users that have been running their LNURL-auth implementation for quite some time. But yes, we only recently finally made progress to add support to
I was under the impression that we concluded to finally change that and provide a default implementation?
Yeah, see above, I had always considered us not providing a default auth mechanism a failure on our end that unnecessarily risks protocol fragmentation. So fully agree we should close that gap.
Not sure I'm completely following, AFAICT the hand-rolled signature scheme is close to what the JWT token would already do?
AFAICT we still don't couple
I had previously understood that the current idea is that we'd add issuance as part of the Rust codebase? |
|
🔔 2nd Reminder Hey @tankyleo! This PR has been waiting for your review. |
Sure, that's fine, but we can't complain that there isn't a single standard if we never tried to propose one because people wanted to do ad-hoc things?
Right, my point is that its the only thing currently offered in our default implementation, not that people couldn't add their own auth.
I'm not at all convinced we should also go implement an LNURL-auth server on top of VSS and all the other stuff we built. The point of having something like LNURL-Auth where there's a second server involved is that that other server does rate-limiting or whatever is required for user-signup validation. We can't readily provide a "default" for that as its highly application-dependent. This PR proposes an alternative approach - for some users (certainly not all) they might do user-signup ratelimiting/validation at a higher level (eg via cookies or by embedding authentication tokens in the URI) and having a reverse proxy validate that authentication. Then, vss-server is only responsible for ensuring that the storage is tied to the seedphrase so that there's no mixing of data across wallets.
The JWT tokens are required to be signed by a fixed public key (a second server) which does application-specific user signup validation. The authentication scheme here is totally different - it relies on something else doing user signup validation and ties the store-id to the users' seedphrase (via some kind of static derivation path on the client side) rather than the higher-level validation. For my use-case this is an important distinction because I have a Apple DeviceCheck service but that isn't authenticating to a specific store-id but rather only gating access (by having the client prove that it is a valid install of the app on real Apple hardware). The user might use several different seed phrases which would mean different store-ids, but to use LNURL-Auth I'd need yet another server, or have the vss-server sign auth tokens which is unnecessary complexity and an extra round-trip. I think some of the confusion here is that "user authentication" may be totally distinct from store-id - storage needs to be tied to a specific wallet/seedphrase, but actual authentication might not be tied to that at all, which makes the LNURL-auth design not super helpful and just complexity for complexity's sake. |