It occurred to me that the new key rotation thing makes it possible to implement a credible low friction "Sign up with email, then migrate a self custody nostr id later" sort of flow.
So basically the way it would work is that the client allows the person to sign up with email, and you have a backend service that generates an nsec for them, and the backend signs stuff for them.
Then if the user wants to move to self custody at any point, they go in their account settings and click like "Enable self custody" or something.
This causes the client to generate a local nsec in the usual way, and the backend creates a key rotation event pointing at the self custodied nsec, and as soon as it's timestamped, immediately rotates to that new nsec.
So far so good.
However, there is still a problem -- there's no way for the backend to prove that it did not also publish an earlier timestamped rotation event with the new pubkey (which would allow the backend to rug the user in the future)
But we can solve this by having the user rotate *again* (using their new nsec) to a second locally generated nsec. (which the backend service could not have known, and thus could not have created any prior key rotation events for)
So bottom line is, yeah it involves two rotations (ie a 20 minute process on average given block time) but it massively reduces sign up friction while providing a way to migrate to self custody while keeping the social graph you may have accumulated prior to rotating into self custody.
nostr:npub1jlrs53pkdfjnts29kveljul2sm0actt6n8dxrrzqcersttvcuv3qdjynqn nostr:npub1klkk3vrzme455yh9rl2jshq7rc8dpegj3ndf82c3ks2sk40dxt7qulx3vt
Login to reply
Replies (11)
You could also sign up with email and store the nsec in a multisig bunker
Is there a resource about key rotation on nostr?
Can you explain this more? So the backend service generates an nsec for the email, and then what is the other nsec?
There is an open questions for what is the longest chain algorithm.
The service could have generated a chain of 10 rotation events and withhold them, then the user publishes his rotation, and later the service publishes its entire chain.
Which one is valid?
Great idea. You could enable this UX now even with self-custody nsec by using something like Photon (if you want the email/password login flow) or BullRecover (without email)
https://docs.photonsdk.org/
https://recoverbull.com/
Damn it youre right. Ok back to the drawing board. Thank you!
No, the client generates an nsec along with email and password and sends it to the bunkers like in promenade, then something something send an ncryptsec to the email/password service. nostr:nprofile1qy88wumn8ghj7mn0wvhxcmmv9uq32amnwvaz7tmjv4kxz7fwv3sk6atn9e5k7tcpzamhxue69uhhyetvv9ujumn0wd68ytnzv9hxgtcpz9mhxue69uhkummnw3ezumrpdejz7qg3waehxw309ahx7um5wgh8w6twv5hsqgrkcud2uwjfruweamz8ewshug5umfq38g9mkmn2u9mk6ajru2w2lg2lyjva is also doing something with oauth and enclaves I don't fully understand
I see. Thank you
No, relays must not accept backdated events for this kind. A withholding attack is always possible otherwise.
Perhaps these "service" / custodial accounts should be declared as "genesis" type, and thus be deemed ineligible for backdated key rotation?