@neuraiproject/neurai-sign-esp32 0.8.2 → 0.8.3
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 +9 -35
- package/dist/NeuraiSignESP32.global.js +306 -200
- package/dist/browser.js +306 -200
- package/dist/index.cjs +306 -200
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +306 -200
- package/dist/react-native.d.ts +1 -1
- package/dist/react-native.js +306 -200
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -223,7 +223,13 @@ console.log(bip32.master_fingerprint); // "a1b2c3d4"
|
|
|
223
223
|
console.log(bip32.path); // "m/44'/1900'/0'"
|
|
224
224
|
```
|
|
225
225
|
|
|
226
|
-
### DePIN
|
|
226
|
+
### DePIN messaging compatibility
|
|
227
|
+
|
|
228
|
+
The supported messaging target is SDK 5 with RPC 6 and ECIES envelope format 3. Messaging on the ESP32 will become available after the firmware and adapter implement both contracts. Until then, use a software identity with SDK 5. The adapter rejects RPC 6 authentication and format 3 decryption before sending either command to the device.
|
|
229
|
+
|
|
230
|
+
Development and integration tests use `@neuraiproject/neurai-depin-msg@^5.0.0`. The published adapter has no runtime dependency on the messaging SDK.
|
|
231
|
+
|
|
232
|
+
### Legacy DePIN chat identity (protocol 2 firmware)
|
|
227
233
|
|
|
228
234
|
The device holds a **dedicated DePIN chat identity** on BIP44 account `100'`
|
|
229
235
|
(`m/44'/<coin>'/100'/0/0`), separate from the funds account, so a wallet can
|
|
@@ -283,36 +289,9 @@ await device.depinSessionEnd();
|
|
|
283
289
|
> the freshness of `timestamp` — the host supplies it and the chip only validates
|
|
284
290
|
> the message structure and channel/sender scope.
|
|
285
291
|
|
|
286
|
-
###
|
|
287
|
-
|
|
288
|
-
The calls above are the raw device commands. For the full **DePIN Messaging
|
|
289
|
-
Protocol 2** flows (challenge → receive → publish → purge) there is an adapter
|
|
290
|
-
that turns the device into an identity consumable by
|
|
291
|
-
[`@neuraiproject/neurai-depin-msg`](https://www.npmjs.com/package/@neuraiproject/neurai-depin-msg)
|
|
292
|
-
`>= 3.1.0`, without the private key ever leaving the chip:
|
|
293
|
-
|
|
294
|
-
```javascript
|
|
295
|
-
import { createDepinDeviceIdentity } from "@neuraiproject/neurai-sign-esp32";
|
|
296
|
-
import { requestDepinChallenge, receiveDepinMessages } from "@neuraiproject/neurai-depin-msg";
|
|
297
|
-
|
|
298
|
-
// Opens (or reuses) a session for the token and validates the announced
|
|
299
|
-
// identity against the network you expect. ONE physical approval.
|
|
300
|
-
const identity = await createDepinDeviceIdentity(device, {
|
|
301
|
-
token: "&NEURAI.CHAT",
|
|
302
|
-
expectedNetwork: "test", // must match the app's network
|
|
303
|
-
sessionPermissions: ["receive", "publish"], // default: ["receive"]
|
|
304
|
-
ttlMinutes: 15,
|
|
305
|
-
});
|
|
292
|
+
### Protocol 2 device session reference
|
|
306
293
|
|
|
307
|
-
|
|
308
|
-
const challenge = await requestDepinChallenge({
|
|
309
|
-
rpc, identity, token: "&NEURAI.CHAT", poolPublicKey,
|
|
310
|
-
});
|
|
311
|
-
const page = await receiveDepinMessages({
|
|
312
|
-
rpc, identity, token: "&NEURAI.CHAT", challenge: challenge.challenge,
|
|
313
|
-
poolPublicKey, network: "test", limit: 25,
|
|
314
|
-
});
|
|
315
|
-
```
|
|
294
|
+
The following permissions and commands describe the existing firmware interface. Applications targeting RPC 6 should use the compatibility information above.
|
|
316
295
|
|
|
317
296
|
**Session permissions.** They are independent capabilities, because a session
|
|
318
297
|
approved for reading must not be able to publish in the owner's name or purge
|
|
@@ -364,11 +343,6 @@ await identity.session.ensure({ minRemainingSeconds: 60 });
|
|
|
364
343
|
> `depin_sign_auth` and session permissions are **not implemented in current
|
|
365
344
|
> firmware yet** — the contract they must satisfy is specified, and exercised
|
|
366
345
|
> by a cryptographically faithful device mock, in this package's tests.
|
|
367
|
-
> `@neuraiproject/neurai-depin-msg@3.1.3` is published and required for
|
|
368
|
-
> installing this repository from scratch or publishing `neurai-sign-esp32@0.7.1`.
|
|
369
|
-
> The package has no runtime dependency on `neurai-depin-msg`; it is a `^3.1.3`
|
|
370
|
-
> development dependency used only by the integration tests. The package gate
|
|
371
|
-
> validates the adapter from a clean `neurai-sign-esp32` tarball.
|
|
372
346
|
|
|
373
347
|
### Provision an unconfigured device (`setup_seed`)
|
|
374
348
|
|