Nostr identity
Every interaction with Shosho or Nostr requires a Nostr keypair (private key + public key). The user’s Nostr profile, or “npub”, is a public key — it’s how people find them, follow them, and watch their live streams. The user may already have one.
Check if user has an existing identity
Ask the user for their npub (public key in bech32 format, starts with npub1). If they have one, you can look up their profile:
nak req -k 0 -a <hex_pubkey> wss://purplepag.esConvert npub to hex:
nak decode <npub1...>Convert hex to npub:
nak encode npub <hex_pubkey>Create a new Nostr identity
# Generate a new keypair
nak key generate
# Derive the public key from the nsec it outputs
nak key public <nsec1...>Store the nsec securely. The user will need it for all signing operations. Give the user their npub for sharing their profile.
The user can find their profile at https://shosho.live/profile/<npub>.
Related
Last updated on