@entros/pulse-sdk 1.5.3 → 2.0.0
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.
- package/README.md +3 -3
- package/dist/index.d.mts +34 -8
- package/dist/index.d.ts +34 -8
- package/dist/index.js +788 -45
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +788 -45
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/@entros/pulse-sdk)
|
|
4
4
|
[](https://www.npmjs.com/package/@entros/pulse-sdk)
|
|
5
5
|
|
|
6
|
-
Client-side SDK for the Entros Protocol. Captures behavioral biometrics (voice, motion, touch), extracts
|
|
6
|
+
Client-side SDK for the Entros Protocol. Captures behavioral biometrics (voice, motion, touch), extracts a 314-dimensional statistical feature vector (v2 expansion: MFCCs, LPC coefficients, formant trajectories, voice quality, pitch contour shape, IMU FFT-band tremor, cross-axis covariance, touch curvature, gap distribution, path efficiency — see `docs/master/BLUEPRINT-feature-pipeline-v2.md`), generates a Groth16 zero-knowledge proof, and submits for on-chain verification on Solana. Raw biometric data stays on-device — only derived features and the proof are transmitted.
|
|
7
7
|
|
|
8
8
|
> **Looking for a drop-in?** Most integrators want [`@entros/verify`](https://github.com/entros-protocol/entros-verify) — a popup-pattern React component that wraps this SDK and ships verification in five lines of JSX. Use this package directly when you need to own the verification UX (custom capture canvas, branded loading states, mobile-native).
|
|
9
9
|
|
|
@@ -32,7 +32,7 @@ if (result.success) {
|
|
|
32
32
|
|
|
33
33
|
### Walletless (liveness-check tier)
|
|
34
34
|
|
|
35
|
-
For
|
|
35
|
+
For liveness checking without wallet onboarding. The integrator optionally funds verifications via the relayer API. Submits proofs to chain through the relayer; **does not issue SAS attestations** — for SAS attestations bound to a verified wallet, use the wallet-connected path above.
|
|
36
36
|
|
|
37
37
|
```typescript
|
|
38
38
|
import { PulseSDK } from '@entros/pulse-sdk';
|
|
@@ -50,7 +50,7 @@ const result = await pulse.verify(touchElement);
|
|
|
50
50
|
## Pipeline
|
|
51
51
|
|
|
52
52
|
1. **Capture**: Audio (16kHz), IMU (accelerometer + gyroscope), touch (pressure + area) — event-driven, caller controls duration
|
|
53
|
-
2. **Extract**:
|
|
53
|
+
2. **Extract**: 314 features — speaker block (176): legacy F0 / jitter / shimmer / HNR / formant ratios / LTAS / amplitude (44) plus v2 additions: MFCCs + delta-MFCCs (78), LPC coefficient stats (24), formant absolute trajectories + bandwidths (16), voice quality CPP/tilt/H1-H2/sub-bands (9), pitch contour DCT (5). Motion block (81): legacy jerk + jounce per IMU axis (54) plus v2 additions: cross-axis covariance (6), FFT band energy on accel axes (12), physiological tremor peak (2), direction-reversal stats (3), motion-magnitude autocorrelation (4). Touch block (57): legacy velocity + pressure dynamics (36) plus v2 additions: pressure derivative (4), contact aspect ratio + area derivative (4), trajectory curvature (3), velocity autocorrelation (3), inter-touch gap distribution (4), path efficiency + per-stroke length (3).
|
|
54
54
|
3. **Validate**: Feature summaries sent to Entros validation server for server-side analysis
|
|
55
55
|
4. **Hash**: SimHash → 256-bit Temporal Fingerprint → Poseidon commitment
|
|
56
56
|
5. **Prove**: Groth16 proof that new fingerprint is within Hamming distance of previous
|
package/dist/index.d.mts
CHANGED
|
@@ -356,7 +356,7 @@ declare function fuseFeatures(audio: number[], motion: number[], touch: number[]
|
|
|
356
356
|
* amplitude statistics (5)
|
|
357
357
|
*/
|
|
358
358
|
|
|
359
|
-
declare const SPEAKER_FEATURE_COUNT
|
|
359
|
+
declare const SPEAKER_FEATURE_COUNT: number;
|
|
360
360
|
/**
|
|
361
361
|
* Extract speaker-dependent audio features.
|
|
362
362
|
*
|
|
@@ -394,18 +394,41 @@ declare function extractSpeakerFeatures(audio: AudioCapture): Promise<number[]>;
|
|
|
394
394
|
declare function extractAccelerationMagnitude(samples: MotionSample[], targetFrameCount: number): number[];
|
|
395
395
|
/**
|
|
396
396
|
* Extract kinematic features from motion (IMU) data.
|
|
397
|
-
* Computes jerk (3rd derivative) and jounce (4th derivative) of acceleration,
|
|
398
|
-
* then condenses each axis into statistics.
|
|
399
397
|
*
|
|
400
|
-
*
|
|
398
|
+
* Layout (`MOTION_FEATURE_COUNT = 81`):
|
|
399
|
+
* `[0..48)` legacy: 6 axes × (jerk stats 4 + jounce stats 4)
|
|
400
|
+
* `[48..54)` legacy: jitter variance per axis (6)
|
|
401
|
+
* `[54..60)` v2: cross-axis covariance (6 selected pairs)
|
|
402
|
+
* `[60..72)` v2: FFT band energy in {0-2, 2-6, 6-12, 12-30} Hz × {ax, ay, az}
|
|
403
|
+
* `[72..74)` v2: physiological tremor peak frequency + amplitude (4-12 Hz)
|
|
404
|
+
* `[74..76)` v2: direction-reversal rate per axis: mean, variance across {ax, ay, az}
|
|
405
|
+
* `[76]` v2: mean angular velocity (|gyro| over the capture)
|
|
406
|
+
* `[77..81)` v2: motion-magnitude autocorrelation at lags {1, 5, 10, 25}
|
|
407
|
+
*
|
|
408
|
+
* @privacyGuarantee Operates on already-on-device IMU samples and emits
|
|
409
|
+
* statistical / spectral aggregates (variances, covariances, band sums,
|
|
410
|
+
* autocorrelation scalars). The full sample stream is never transmitted.
|
|
401
411
|
*/
|
|
402
412
|
declare function extractMotionFeatures(samples: MotionSample[]): number[];
|
|
403
413
|
/**
|
|
404
414
|
* Extract kinematic features from touch data.
|
|
405
|
-
* Computes velocity and acceleration of touch coordinates,
|
|
406
|
-
* plus pressure and area statistics.
|
|
407
415
|
*
|
|
408
|
-
*
|
|
416
|
+
* Layout (`TOUCH_FEATURE_COUNT = 57`):
|
|
417
|
+
* `[0..32)` legacy: velocity / accel / pressure / area / jerk stats (32)
|
|
418
|
+
* `[32..36)` legacy: jitter variance for {vx, vy, pressure, area} (4)
|
|
419
|
+
* `[36..40)` v2: pressure first-derivative stats (mean, var, skew, kurt)
|
|
420
|
+
* `[40..42)` v2: contact aspect-ratio stats (mean, var)
|
|
421
|
+
* `[42..44)` v2: contact-area first-derivative stats (mean, var)
|
|
422
|
+
* `[44..47)` v2: trajectory curvature stats (mean, var, skew)
|
|
423
|
+
* `[47..50)` v2: velocity autocorrelation at lags {1, 3, 5}
|
|
424
|
+
* `[50..54)` v2: inter-touch gap duration stats (mean, var, skew, kurt)
|
|
425
|
+
* `[54]` v2: path efficiency (straight-line / total path length)
|
|
426
|
+
* `[55..57)` v2: per-stroke total path length: mean, variance
|
|
427
|
+
*
|
|
428
|
+
* @privacyGuarantee Operates on already-on-device touch samples and emits
|
|
429
|
+
* statistical aggregates only. The full coordinate stream is never
|
|
430
|
+
* transmitted; downstream phase-content (e.g. typed text) is not
|
|
431
|
+
* recoverable from the per-stroke summaries.
|
|
409
432
|
*/
|
|
410
433
|
declare function extractTouchFeatures(samples: TouchSample[]): number[];
|
|
411
434
|
/**
|
|
@@ -413,7 +436,10 @@ declare function extractTouchFeatures(samples: TouchSample[]): number[];
|
|
|
413
436
|
* Captures behavioral patterns from mouse/pointer movement that are user-specific:
|
|
414
437
|
* path curvature, speed patterns, micro-corrections, pause behavior.
|
|
415
438
|
*
|
|
416
|
-
* Returns:
|
|
439
|
+
* Returns: `MOUSE_DYNAMICS_FEATURE_COUNT` (= `MOTION_FEATURE_COUNT`) values.
|
|
440
|
+
* The first 54 entries are the legacy mouse-dynamics signal; the trailing
|
|
441
|
+
* v2-block slots stay zero on desktop so the per-modality bit-influence
|
|
442
|
+
* share matches a mobile IMU capture under the new pipeline.
|
|
417
443
|
*/
|
|
418
444
|
declare function extractMouseDynamics(samples: TouchSample[]): number[];
|
|
419
445
|
|
package/dist/index.d.ts
CHANGED
|
@@ -356,7 +356,7 @@ declare function fuseFeatures(audio: number[], motion: number[], touch: number[]
|
|
|
356
356
|
* amplitude statistics (5)
|
|
357
357
|
*/
|
|
358
358
|
|
|
359
|
-
declare const SPEAKER_FEATURE_COUNT
|
|
359
|
+
declare const SPEAKER_FEATURE_COUNT: number;
|
|
360
360
|
/**
|
|
361
361
|
* Extract speaker-dependent audio features.
|
|
362
362
|
*
|
|
@@ -394,18 +394,41 @@ declare function extractSpeakerFeatures(audio: AudioCapture): Promise<number[]>;
|
|
|
394
394
|
declare function extractAccelerationMagnitude(samples: MotionSample[], targetFrameCount: number): number[];
|
|
395
395
|
/**
|
|
396
396
|
* Extract kinematic features from motion (IMU) data.
|
|
397
|
-
* Computes jerk (3rd derivative) and jounce (4th derivative) of acceleration,
|
|
398
|
-
* then condenses each axis into statistics.
|
|
399
397
|
*
|
|
400
|
-
*
|
|
398
|
+
* Layout (`MOTION_FEATURE_COUNT = 81`):
|
|
399
|
+
* `[0..48)` legacy: 6 axes × (jerk stats 4 + jounce stats 4)
|
|
400
|
+
* `[48..54)` legacy: jitter variance per axis (6)
|
|
401
|
+
* `[54..60)` v2: cross-axis covariance (6 selected pairs)
|
|
402
|
+
* `[60..72)` v2: FFT band energy in {0-2, 2-6, 6-12, 12-30} Hz × {ax, ay, az}
|
|
403
|
+
* `[72..74)` v2: physiological tremor peak frequency + amplitude (4-12 Hz)
|
|
404
|
+
* `[74..76)` v2: direction-reversal rate per axis: mean, variance across {ax, ay, az}
|
|
405
|
+
* `[76]` v2: mean angular velocity (|gyro| over the capture)
|
|
406
|
+
* `[77..81)` v2: motion-magnitude autocorrelation at lags {1, 5, 10, 25}
|
|
407
|
+
*
|
|
408
|
+
* @privacyGuarantee Operates on already-on-device IMU samples and emits
|
|
409
|
+
* statistical / spectral aggregates (variances, covariances, band sums,
|
|
410
|
+
* autocorrelation scalars). The full sample stream is never transmitted.
|
|
401
411
|
*/
|
|
402
412
|
declare function extractMotionFeatures(samples: MotionSample[]): number[];
|
|
403
413
|
/**
|
|
404
414
|
* Extract kinematic features from touch data.
|
|
405
|
-
* Computes velocity and acceleration of touch coordinates,
|
|
406
|
-
* plus pressure and area statistics.
|
|
407
415
|
*
|
|
408
|
-
*
|
|
416
|
+
* Layout (`TOUCH_FEATURE_COUNT = 57`):
|
|
417
|
+
* `[0..32)` legacy: velocity / accel / pressure / area / jerk stats (32)
|
|
418
|
+
* `[32..36)` legacy: jitter variance for {vx, vy, pressure, area} (4)
|
|
419
|
+
* `[36..40)` v2: pressure first-derivative stats (mean, var, skew, kurt)
|
|
420
|
+
* `[40..42)` v2: contact aspect-ratio stats (mean, var)
|
|
421
|
+
* `[42..44)` v2: contact-area first-derivative stats (mean, var)
|
|
422
|
+
* `[44..47)` v2: trajectory curvature stats (mean, var, skew)
|
|
423
|
+
* `[47..50)` v2: velocity autocorrelation at lags {1, 3, 5}
|
|
424
|
+
* `[50..54)` v2: inter-touch gap duration stats (mean, var, skew, kurt)
|
|
425
|
+
* `[54]` v2: path efficiency (straight-line / total path length)
|
|
426
|
+
* `[55..57)` v2: per-stroke total path length: mean, variance
|
|
427
|
+
*
|
|
428
|
+
* @privacyGuarantee Operates on already-on-device touch samples and emits
|
|
429
|
+
* statistical aggregates only. The full coordinate stream is never
|
|
430
|
+
* transmitted; downstream phase-content (e.g. typed text) is not
|
|
431
|
+
* recoverable from the per-stroke summaries.
|
|
409
432
|
*/
|
|
410
433
|
declare function extractTouchFeatures(samples: TouchSample[]): number[];
|
|
411
434
|
/**
|
|
@@ -413,7 +436,10 @@ declare function extractTouchFeatures(samples: TouchSample[]): number[];
|
|
|
413
436
|
* Captures behavioral patterns from mouse/pointer movement that are user-specific:
|
|
414
437
|
* path curvature, speed patterns, micro-corrections, pause behavior.
|
|
415
438
|
*
|
|
416
|
-
* Returns:
|
|
439
|
+
* Returns: `MOUSE_DYNAMICS_FEATURE_COUNT` (= `MOTION_FEATURE_COUNT`) values.
|
|
440
|
+
* The first 54 entries are the legacy mouse-dynamics signal; the trailing
|
|
441
|
+
* v2-block slots stay zero on desktop so the per-modality bit-influence
|
|
442
|
+
* share matches a mobile IMU capture under the new pipeline.
|
|
417
443
|
*/
|
|
418
444
|
declare function extractMouseDynamics(samples: TouchSample[]): number[];
|
|
419
445
|
|