File tree Expand file tree Collapse file tree 2 files changed +40
-1
lines changed Expand file tree Collapse file tree 2 files changed +40
-1
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,35 @@ The key management system is designed according to our core architectural princi
5757- ** Format** : ` nostr_[environment]_[service]_[timestamp] `
5858- ** Validation** : SHA-256 hash stored in configuration
5959
60+ ## Cryptographic Operations
61+
62+ ### Standardized Crypto Utilities
63+
64+ The middleware now uses standardized cryptographic operations from our official packages:
65+
66+ - ` @humanjavaenterprises/nostr-crypto-utils ` : Core cryptographic operations
67+ - ` @humanjavaenterprises/nostr-nsec-seedphrase-library ` : Seedphrase-based key management
68+
69+ These packages ensure:
70+ - Consistent cryptographic implementations across all Nostr projects
71+ - Standardized key generation and management
72+ - Improved security through well-tested, audited code
73+ - Better maintainability and updates
74+
75+ ### Development Mode
76+
77+ In development mode, the middleware uses seedphrase-based key generation for predictable testing environments:
78+
79+ ``` typescript
80+ import { generateKeyPair } from ' @humanjavaenterprises/nostr-crypto-utils' ;
81+ import { generateFromSeed } from ' @humanjavaenterprises/nostr-nsec-seedphrase-library' ;
82+
83+ // Development mode uses deterministic key generation
84+ const keyPair = process .env .NODE_ENV === ' development'
85+ ? generateFromSeed (' development-seed-phrase' )
86+ : generateKeyPair ();
87+ ```
88+
6089## Environment-Specific Key Management
6190
6291### Development Environment
Original file line number Diff line number Diff line change @@ -22,9 +22,19 @@ Before starting the migration:
2222
23232 . Install the package:
2424 ``` bash
25- npm install @maiqr/nostr-auth-enroll
25+ npm install @maiqr/nostr-auth-enroll @humanjavaenterprises/nostr-crypto-utils @humanjavaenterprises/nostr-nsec-seedphrase-library
2626 ```
2727
28+ ## Dependencies
29+
30+ ### Core Dependencies
31+
32+ The middleware now uses standardized cryptographic operations:
33+ - ` nostr-crypto-utils ` : Provides core cryptographic operations
34+ - ` nostr-nsec-seedphrase-library ` : Handles seedphrase-based key management
35+
36+ These packages ensure consistent cryptographic implementations across all your Nostr applications.
37+
2838## Backend Migration
2939
3040### 1. Initial Setup
You can’t perform that action at this time.
0 commit comments