Skip to content

Commit c765723

Browse files
committed
feat: integrate standardized nostr libraries
- Integrated nostr-crypto-utils for core cryptographic operations - Integrated nostr-nsec-seedphrase-library for key management - Updated documentation with new dependencies and usage - Improved security through standardized implementations
1 parent 1880a1f commit c765723

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

docs/key-management.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff 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

docs/migration-guide.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,19 @@ Before starting the migration:
2222

2323
2. 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

0 commit comments

Comments
 (0)