NIP-05: Auto-provision identity on user creation #14
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
When a user creates a Lightning.Pub wallet (via
AddAppUser), they should automatically receive a NIP-05 identity and Lightning Address. Currently users must explicitly callnip05.claimwith a chosen username — most users will never do this.Problem
A Lightning.Pub user without a NIP-05 identity has:
alice@domain.com)alice@domain.com)This defeats the purpose of having the NIP-05 extension if it requires manual opt-in.
Proposed Solution
New extension hook:
onUserCreated()Add an
onUserCreatedcallback toExtensionContext:When
AppUserManager.AddAppUser()creates a new user, dispatch to all registered extension callbacks.NIP-05 extension auto-provisioning
The NIP-05 extension subscribes to
onUserCreated()and:identifier(e.g."alice"), use that as the usernamenpub1abc@domain.com)User can still customize
nip05.claimreleases the auto-assigned name and claims a new onenip05.releaseremoves the identity entirely (opt-out)auto_provision: falseConfig addition
Implementation scope
types.ts,context.ts,loader.ts): AddonUserCreatedhookappUserManager.ts): Dispatch user creation events to extension loadernip05Manager.ts): Subscribe and auto-provisiondomain,auto_provision,auto_username_strategyfieldsWhy this matters
The goal is: install Lightning.Pub + NIP-05 extension → every user automatically gets
username@yourdomain.comas both a Nostr identity and a Lightning Address. Zero friction.