ns-auth-sdk 1.2.4 → 1.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +16 -39
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,9 +1,23 @@
1
- # NS Auth SSO
1
+ # NS Auth SDK
2
+
3
+ Decentralized SSO - Authentication, membership, and profile management.
4
+
5
+ NSAuth enables client-side managing of private-keys with WebAuthn passkeys (FIDO2 credentials). By leveraging passkeys, users avoid traditional private‑key backups and password hassles, relying instead on biometric or device‑based authentication. The keys are compatible with common blockchains like Bitcoin and Ethereum and data is stored as events on public relays and can be encrypted.
6
+
7
+ Two Approaches
8
+ PRF Direct Method – Derive the private key directly from the PRF value produced by a passkey. Encryption Method – Encrypt an existing private key with a key derived from the passkey’s PRF output. WebAuthn PRF Extension The PRF (Pseudo‑Random Function) extension, part of WebAuthn Level 3, yields deterministic 32‑byte high‑entropy values from an authenticator’s internal private key and a supplied salt. The same credential ID and salt always generate the same PRF output, which never leaves the device except during authentication.
9
+
10
+ Using PRF Values as Private Keys
11
+ A 32‑byte PRF output can serve as a private key if it falls within the secp256k1 range (1 ≤ value < n). The chance of falling outside this range is astronomically low (~2⁻²²⁴), so explicit range checks are generally unnecessary.
12
+
13
+ Restoration Steps
14
+ Install the client on a new device. Fetch the latest kind 30100 event for the target public key. Extract the PWKBlob and decrypt it with the passkey’s PRF value. Use the recovered private key for signing. Multiple passkeys can each have their own PWKBlob, allowing redundancy across devices.
2
15
 
3
- SSO library for NS Auth - Authentication, membership, and profile management compatible with applesauce.
4
16
 
5
17
  ## Installation
6
18
 
19
+ Install from [npm](https://www.npmjs.com/package/ns-auth-sdk):
20
+
7
21
  ```bash
8
22
  npm install ns-auth-sdk
9
23
  # or
@@ -12,35 +26,6 @@ pnpm install ns-auth-sdk
12
26
  yarn add ns-auth-sdk
13
27
  ```
14
28
 
15
- ### Local Development
16
-
17
- For local development in a monorepo:
18
-
19
- ```bash
20
- cd packages/ns-auth-sdk
21
- pnpm install
22
- pnpm build
23
- ```
24
-
25
- Then in your main app's `package.json`:
26
-
27
- ```json
28
- {
29
- "dependencies": {
30
- "ns-auth-sdk": "file:./packages/ns-auth-sdk"
31
- }
32
- }
33
- ```
34
-
35
- ## Peer Dependencies
36
-
37
- This library requires the following peer dependencies:
38
-
39
- - `react` ^18.0.0
40
- - `react-dom` ^18.0.0
41
- - `applesauce-core` ^5.0.0
42
- - `nosskey-sdk` ^0.0.4
43
-
44
29
  ## Quick Start
45
30
 
46
31
  ### 1. Initialize Services
@@ -231,11 +216,3 @@ const relayService = new RelayService();
231
216
  relayService.initialize(eventStore);
232
217
  ```
233
218
 
234
- ## TypeScript Support
235
-
236
- This library is written in TypeScript and includes full type definitions.
237
-
238
- ## License
239
-
240
- MIT
241
-
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ns-auth-sdk",
3
- "version": "1.2.4",
3
+ "version": "1.2.6",
4
4
  "description": "SSO library for NS Auth - Authentication, membership, and profile management compatible with applesauce",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",