From ee7eb461c4db557f2d2c60a0e7c7f0bee14c2d81 Mon Sep 17 00:00:00 2001 From: padreug Date: Wed, 2 Jul 2025 16:25:20 +0200 Subject: [PATCH] feat: Implement comprehensive Nostr identity and social features MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Core Identity Management - Add secure key generation and import functionality - Implement AES-GCM encryption with PBKDF2 key derivation - Create password-protected identity storage - Add browser-compatible crypto utilities (no Buffer dependency) ## User Interface - Build identity management dialog with tabs for setup and profile - Add navbar integration with user dropdown and mobile support - Create password unlock dialog for encrypted identities - Integrate vue-sonner for toast notifications ## Nostr Protocol Integration - Implement event creation (notes, reactions, profiles, contacts) - Add reply thread detection and engagement metrics - Create social interaction composables for publishing - Support multi-relay publishing with failure handling - Add profile fetching and caching system ## Security Features - Web Crypto API with 100k PBKDF2 iterations - Secure random salt and IV generation - Automatic password prompts for encrypted storage - Legacy support for unencrypted identities ## Technical Improvements - Replace all Buffer usage with browser-native APIs - Add comprehensive error handling and validation - Implement reactive state management with Vue composables - Create reusable crypto utility functions 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- src/App.vue | 47 ++- src/components/layout/Navbar.vue | 76 +++- src/components/nostr/IdentityDialog.vue | 453 ++++++++++++++++++++++++ src/components/nostr/PasswordDialog.vue | 105 ++++++ src/composables/useIdentity.ts | 193 ++++++++++ src/composables/useSocial.ts | 156 ++++++++ src/lib/crypto/encryption.ts | 134 +++++++ src/lib/nostr/client.ts | 223 +++++++++++- src/lib/nostr/events.ts | 156 ++++++++ src/lib/nostr/identity.ts | 210 +++++++++++ src/lib/utils.ts | 3 + src/lib/utils/crypto.ts | 42 +++ 12 files changed, 1777 insertions(+), 21 deletions(-) create mode 100644 src/components/nostr/IdentityDialog.vue create mode 100644 src/components/nostr/PasswordDialog.vue create mode 100644 src/composables/useIdentity.ts create mode 100644 src/composables/useSocial.ts create mode 100644 src/lib/crypto/encryption.ts create mode 100644 src/lib/nostr/events.ts create mode 100644 src/lib/nostr/identity.ts create mode 100644 src/lib/utils/crypto.ts diff --git a/src/App.vue b/src/App.vue index 90e61b6..7be8c70 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,14 +1,47 @@ diff --git a/src/components/nostr/IdentityDialog.vue b/src/components/nostr/IdentityDialog.vue new file mode 100644 index 0000000..ad6b7eb --- /dev/null +++ b/src/components/nostr/IdentityDialog.vue @@ -0,0 +1,453 @@ + + +