feat: auto-generate Nostr keypair during identity creation
Every new identity now gets both Ed25519 (DID) and secp256k1 (Nostr) keys from creation. The create() method calls create_nostr_key() automatically, so identity.create RPC always returns nostr_pubkey and nostr_npub fields. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -143,18 +143,15 @@ impl IdentityManager {
|
||||
self.set_default(&id).await?;
|
||||
}
|
||||
|
||||
// Auto-generate Nostr keypair so every identity has both key types
|
||||
let _ = self.create_nostr_key(&id).await;
|
||||
|
||||
// Re-read to pick up the Nostr keys
|
||||
let record = self.get(&id).await?;
|
||||
|
||||
tracing::info!("Created identity '{}' ({})", name, purpose);
|
||||
|
||||
Ok(IdentityRecord {
|
||||
id,
|
||||
name,
|
||||
purpose,
|
||||
pubkey_hex,
|
||||
did,
|
||||
created_at,
|
||||
nostr_pubkey: None,
|
||||
nostr_npub: None,
|
||||
})
|
||||
Ok(record)
|
||||
}
|
||||
|
||||
/// Get a single identity by ID (without secret key).
|
||||
|
||||
Reference in New Issue
Block a user