@neuraiproject/neurai-sign-esp32 0.8.1 → 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 +22 -36
- package/dist/NeuraiSignESP32.global.js +326 -205
- package/dist/browser.js +326 -205
- package/dist/index.cjs +326 -205
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +326 -205
- package/dist/react-native.d.ts +1 -1
- package/dist/react-native.js +326 -205
- package/package.json +6 -5
package/README.md
CHANGED
|
@@ -44,7 +44,7 @@ asset name, transferred amount, destination address, and fee more clearly.
|
|
|
44
44
|
|
|
45
45
|
Before supplying UTXOs or PSBT inputs to this signing library, the host
|
|
46
46
|
application must verify `getblockhash(0)` against
|
|
47
|
-
`
|
|
47
|
+
`000000c710413a4265a996d30c86043aedef6a563900f1bc43fea61d5b2dc77d`.
|
|
48
48
|
The device does not query the chain. Discard UTXOs and PSBTs assembled from
|
|
49
49
|
the previous testnet. All three AuthScript address families activate on the
|
|
50
50
|
reset testnet at block 10; outputs included earlier have no AuthScript spend
|
|
@@ -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
|
-
###
|
|
292
|
+
### Protocol 2 device session reference
|
|
287
293
|
|
|
288
|
-
The
|
|
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
|
-
});
|
|
306
|
-
|
|
307
|
-
// From here it is an ordinary depin-msg identity.
|
|
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
|
|
|
@@ -958,6 +932,18 @@ ArduinoJson parser was checked on the host up to MAX_MONEY; this does not replac
|
|
|
958
932
|
an on-device signing and display check of the firmware installed on your ESP32.
|
|
959
933
|
No global bigint JSON serializer is required.
|
|
960
934
|
|
|
935
|
+
## Upgrading to 0.8.2
|
|
936
|
+
|
|
937
|
+
Previous transactions are read with `@neuraiproject/neurai-create-transaction`
|
|
938
|
+
`^0.10.0`, which follows the node's NIP-014 encoding (Neurai DePIN-Test
|
|
939
|
+
`d4ff4ef`, live on the testnet reset of 2026-11-05): reference inputs are
|
|
940
|
+
announced by flag `0x02` of the extended format, and a version 3 transaction
|
|
941
|
+
without them has the plain layout. With 0.8.1 a PSBT whose previous
|
|
942
|
+
transaction is version 3 in that encoding is unreadable. Version 3
|
|
943
|
+
transactions of the previous testnet (an empty reference list after the
|
|
944
|
+
outputs) no longer read. What the device signs does not change: NeuraiHW still
|
|
945
|
+
refuses a version 3 transaction or previous transaction.
|
|
946
|
+
|
|
961
947
|
## Upgrading to 0.8.1
|
|
962
948
|
|
|
963
949
|
React Native (Hermes): Buffer methods are no longer called on `subarray()`
|