@entros/pulse-sdk 1.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/LICENSE +21 -0
- package/README.md +68 -0
- package/dist/index.d.mts +665 -0
- package/dist/index.d.ts +665 -0
- package/dist/index.js +3130 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +3041 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +70 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 IAM Protocol
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# @entros/pulse-sdk
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@entros/pulse-sdk)
|
|
4
|
+
[](https://www.npmjs.com/package/@entros/pulse-sdk)
|
|
5
|
+
|
|
6
|
+
Client-side SDK for the Entros Protocol. Captures behavioral biometrics (voice, motion, touch), extracts 134 statistical features, 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
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install @entros/pulse-sdk
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
### Wallet-connected (primary)
|
|
17
|
+
|
|
18
|
+
The user pays a small protocol fee (~0.005 SOL) and signs the verification transaction. Re-verification is batched into a single transaction (1 wallet prompt).
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
import { PulseSDK } from '@entros/pulse-sdk';
|
|
22
|
+
|
|
23
|
+
const pulse = new PulseSDK({ cluster: 'devnet' });
|
|
24
|
+
const result = await pulse.verify(touchElement, walletAdapter, connection);
|
|
25
|
+
|
|
26
|
+
if (result.success) {
|
|
27
|
+
console.log('Verified:', result.txSignature);
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Walletless (liveness-check tier)
|
|
32
|
+
|
|
33
|
+
For non-crypto users. No wallet, no SOL required. The integrator optionally funds verifications via the relayer API.
|
|
34
|
+
|
|
35
|
+
```typescript
|
|
36
|
+
import { PulseSDK } from '@entros/pulse-sdk';
|
|
37
|
+
|
|
38
|
+
const pulse = new PulseSDK({
|
|
39
|
+
cluster: 'devnet',
|
|
40
|
+
relayerUrl: 'https://api.entros.io/relay',
|
|
41
|
+
wasmUrl: '/circuits/iam_hamming.wasm',
|
|
42
|
+
zkeyUrl: '/circuits/iam_hamming_final.zkey',
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const result = await pulse.verify(touchElement);
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Pipeline
|
|
49
|
+
|
|
50
|
+
1. **Capture**: Audio (16kHz), IMU (accelerometer + gyroscope), touch (pressure + area) — event-driven, caller controls duration
|
|
51
|
+
2. **Extract**: 134 features — speaker (F0, jitter, shimmer, HNR, formants, LTAS), motion (jerk/jounce), touch (velocity/pressure)
|
|
52
|
+
3. **Validate**: Feature summaries sent to Entros validation server for server-side analysis
|
|
53
|
+
4. **Hash**: SimHash → 256-bit Temporal Fingerprint → Poseidon commitment
|
|
54
|
+
5. **Prove**: Groth16 proof that new fingerprint is within Hamming distance of previous
|
|
55
|
+
6. **Submit**: Single batched transaction via wallet (1 prompt) or relayer
|
|
56
|
+
|
|
57
|
+
## Development
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npm install
|
|
61
|
+
npm test # 60 vitest tests (including 8-phase adversarial pen test)
|
|
62
|
+
npm run build # ESM + CJS output
|
|
63
|
+
npm run typecheck # TypeScript strict mode
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## License
|
|
67
|
+
|
|
68
|
+
MIT
|