Skip to content
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

Add username registration and lightning address handling #7

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

dangeross
Copy link

@dangeross dangeross commented Aug 20, 2024

This PR adds the option to register a username along with the pubkey. Registration of the username enables <username>@<lnurl.domain> type requests to be handled by the service.

Registration of a username is optional and if included needs to be signed with the request. The username must be unique in that it is not already registered by another pubkey. Registration of another username to the same pubkey will overwrite the existing username. The usernames are stored in a separate table to insure they are not removed during cleaning.

Copy link

@JssDWt JssDWt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good. Some comments just to show I've reviewed.

persist/pg.go Outdated Show resolved Hide resolved
persist/pg.go Outdated
func (s *PgStore) getPubkeyUsername(ctx context.Context, pubkey []byte) (*PubkeyUsername, error) {
rows, err := s.pool.Query(
ctx,
`SELECT encode(pubkey, 'hex') pubkey, username
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't have to select the pubkey here

Copy link

@JssDWt JssDWt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

@JssDWt JssDWt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants