I’ve never felt right about creating an account for someone and then just giving them an nsec.. here’s the (possible) solution:
here's how the flow works for gifting. "Gift Flow Explained
1. Gift Creation (by you, the gifter)
• You select posts/articles on /gift
• Data is stored in the database with status pending
• No keypair is created yet
2. Worker Processing (server-side)
• Worker picks up pending gifts
• Generates temporary/ephemeral keypair (generate_temp_keypair() in worker.py:754)
• Downloads media from Instagram/TikTok
• Uploads to Blossom using the temp keypair for authentication (kind 24242 auth events)
• Gift status changes to ready
Key insight: Blossom is content-addressed — URLs are based on the SHA-256 hash of the file content. So the same file always gets the same URL (blossom.primal.net/<sha256hash>) regardless of who uploaded it. The temp keypair is just for upload authorization, not for identity.
3. Gift Claiming (recipient’s browser)
When the recipient opens the claim link:
• A brand new random keypair is generated client-side in their browser:
const privateKeyBytes = crypto.getRandomValues(new Uint8Array(32));
• This happens at gift-claim/[token]/+page.svelte:118–130
• The keypair never leaves their browser — it’s not sent to your server
• Posts are signed and published to Nostr relays using this keypair
• Recipient is shown their nsec and prompted to save it
Your Access
Correct — you (the owner of ownyourposts.com) have zero access to the recipient’s private key because:
1. It’s generated with crypto.getRandomValues() in the browser
2. It’s never transmitted to the server
3. Only the signed Nostr events go to relays (public data)
The ephemeral worker keypair is discarded after upload — it was only used to authorize the Blossom upload, not to establish any ongoing identity.
Login to reply
Replies (5)
I think this is really cool, but I don't understand why all y'all primal folks are so determined to have every nsec hot. It's like there is an allergy to offline key gen.
@Paul estuve intentando crear algo similar a pedido de @Micael pero me cagué a palos y se me hizo imposible, pero vos lo lograste 🫡💪💪. MICA acá está la mejor herramienta, vamos a probarla y usarla 👌
Dude this is so illegal, good energy but please, yo, let's grow legally. Or mostly legally!
here we go! post AI SWE
I believe this is an interesting marketing strategy to get more people interested on Nostr and make the onboarding smooth as possible.
I have a genuine question and perhaps a curiosity of mine.
How do we know that the "gifter" has the intention of giving it to the original creators and not an adversary who will steal your online identity and your creations? Do we have a way to mitigate this? I know that everything can be abused esp tech and with lot of bots already, it is inevitable that people will take advantage of this. 🤔☺️ #asknostr #primal