@neuraiproject/neurai-sign-esp32 0.5.9 → 0.5.10

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 CHANGED
@@ -579,6 +579,7 @@ using JSON messages. Supported commands:
579
579
  | `sign_message` | Physical button | 30s |
580
580
  | `depin_session_begin` | Physical button (channel token on screen) | 30s |
581
581
  | `get_depin_identity` | None (session-gated) | 10s |
582
+ | `depin_sign_digest` | Physical button | 30s |
582
583
  | `depin_sign` | None (session-gated, rate-limited) | 30s |
583
584
  | `depin_decrypt` | None (session-gated, rate-limited) | 30s |
584
585
  | `depin_decrypt_payload` | None (session-gated, rate-limited) | 30s |
@@ -618,6 +619,7 @@ Main class for device interaction.
618
619
  | `depinSign(params)` | Sign a DePIN message on-device (DER over the canonical CDepinMessage); session-gated, rate-limited |
619
620
  | `depinDecrypt(depinMessageHex)` | Decrypt a CDepinMessage addressed to this identity → `plaintext_b64`; session-gated |
620
621
  | `depinDecryptPayload(encryptedPayloadHex)` | Decrypt a bare ECIES `encrypted_payload_hex` (decomposed server item) → `plaintext_b64`; session-gated |
622
+ | `depinSignDigest(digestHex)` | Sign a tx sighash with the DePIN key (account 100') → `{ signature, pubkey }`; physical confirmation, for the pubkey-reveal burn |
621
623
  | `depinSessionEnd()` | End the DePIN session (also revoked on lock / disconnect / timeout) |
622
624
  | `signTransaction(opts)` | Build + sign + finalize in one call; auto-routes legacy (PSBT) vs PQ (`sign_tx`) by device mode |
623
625
  | `signPqTransaction(opts)` | Spend from a PQ address: build raw tx + sign via `sign_tx` (used internally by `signTransaction` in PQ mode) |
@@ -13178,6 +13178,23 @@ var NeuraiSignESP32Bundle = (function () {
13178
13178
  this.assertSuccess(response);
13179
13179
  return response;
13180
13180
  }
13181
+ /**
13182
+ * Sign a 32-byte digest with the DePIN key (account 100'). The device ALWAYS
13183
+ * asks for an explicit physical confirmation — this signature can move the
13184
+ * DePIN address's XNA. Used to spend from the DePIN address, notably the
13185
+ * pubkey-reveal burn that publishes the account-100 pubkey on-chain (so other
13186
+ * chat members can encrypt group messages to this identity). The host builds
13187
+ * the transaction, computes each input's legacy sighash, calls this per input,
13188
+ * and assembles the P2PKH scriptSig from `signature` (append the sighash-type
13189
+ * byte) + `pubkey`. Requires the device unlocked; not session-gated.
13190
+ *
13191
+ * @param digestHex 32-byte digest (the tx sighash), hex.
13192
+ */
13193
+ async depinSignDigest(digestHex) {
13194
+ const response = await this.serial.sendCommand({ action: "depin_sign_digest", digest: digestHex }, 35000);
13195
+ this.assertSuccess(response);
13196
+ return response;
13197
+ }
13181
13198
  /**
13182
13199
  * End the current DePIN session: auto-sign/decrypt stops and the identity is
13183
13200
  * no longer revealed until a new {@link depinSessionBegin} approval. Safe to
package/dist/browser.js CHANGED
@@ -13175,6 +13175,23 @@ class NeuraiESP32 {
13175
13175
  this.assertSuccess(response);
13176
13176
  return response;
13177
13177
  }
13178
+ /**
13179
+ * Sign a 32-byte digest with the DePIN key (account 100'). The device ALWAYS
13180
+ * asks for an explicit physical confirmation — this signature can move the
13181
+ * DePIN address's XNA. Used to spend from the DePIN address, notably the
13182
+ * pubkey-reveal burn that publishes the account-100 pubkey on-chain (so other
13183
+ * chat members can encrypt group messages to this identity). The host builds
13184
+ * the transaction, computes each input's legacy sighash, calls this per input,
13185
+ * and assembles the P2PKH scriptSig from `signature` (append the sighash-type
13186
+ * byte) + `pubkey`. Requires the device unlocked; not session-gated.
13187
+ *
13188
+ * @param digestHex 32-byte digest (the tx sighash), hex.
13189
+ */
13190
+ async depinSignDigest(digestHex) {
13191
+ const response = await this.serial.sendCommand({ action: "depin_sign_digest", digest: digestHex }, 35000);
13192
+ this.assertSuccess(response);
13193
+ return response;
13194
+ }
13178
13195
  /**
13179
13196
  * End the current DePIN session: auto-sign/decrypt stops and the identity is
13180
13197
  * no longer revealed until a new {@link depinSessionBegin} approval. Safe to
package/dist/index.cjs CHANGED
@@ -13177,6 +13177,23 @@ class NeuraiESP32 {
13177
13177
  this.assertSuccess(response);
13178
13178
  return response;
13179
13179
  }
13180
+ /**
13181
+ * Sign a 32-byte digest with the DePIN key (account 100'). The device ALWAYS
13182
+ * asks for an explicit physical confirmation — this signature can move the
13183
+ * DePIN address's XNA. Used to spend from the DePIN address, notably the
13184
+ * pubkey-reveal burn that publishes the account-100 pubkey on-chain (so other
13185
+ * chat members can encrypt group messages to this identity). The host builds
13186
+ * the transaction, computes each input's legacy sighash, calls this per input,
13187
+ * and assembles the P2PKH scriptSig from `signature` (append the sighash-type
13188
+ * byte) + `pubkey`. Requires the device unlocked; not session-gated.
13189
+ *
13190
+ * @param digestHex 32-byte digest (the tx sighash), hex.
13191
+ */
13192
+ async depinSignDigest(digestHex) {
13193
+ const response = await this.serial.sendCommand({ action: "depin_sign_digest", digest: digestHex }, 35000);
13194
+ this.assertSuccess(response);
13195
+ return response;
13196
+ }
13180
13197
  /**
13181
13198
  * End the current DePIN session: auto-sign/decrypt stops and the identity is
13182
13199
  * no longer revealed until a new {@link depinSessionBegin} approval. Safe to
package/dist/index.d.ts CHANGED
@@ -255,6 +255,13 @@ interface IDepinDecryptResponse {
255
255
  plaintext_b64: string;
256
256
  op_count: number;
257
257
  }
258
+ interface IDepinSignDigestResponse {
259
+ status: string;
260
+ /** DER signature over the digest (no sighash-type byte; append it host-side). */
261
+ signature: string;
262
+ /** Compressed secp256k1 DePIN public key (33 bytes), hex — for the scriptSig. */
263
+ pubkey: string;
264
+ }
258
265
  interface IErrorResponse {
259
266
  status: "error";
260
267
  message: string;
@@ -263,7 +270,7 @@ interface IProcessingResponse {
263
270
  status: "processing";
264
271
  stage: string;
265
272
  }
266
- type DeviceResponse = IPingResponse | IDeviceInfo | IAddressResponse | IBip32PubkeyResponse | ISignPsbtResponse | ISignTxResponse | ISignMessageResponse | ISetupSeedResponse | IDepinSessionResponse | IDepinIdentityResponse | IDepinSignResponse | IDepinDecryptResponse | IErrorResponse | IProcessingResponse;
273
+ type DeviceResponse = IPingResponse | IDeviceInfo | IAddressResponse | IBip32PubkeyResponse | ISignPsbtResponse | ISignTxResponse | ISignMessageResponse | ISetupSeedResponse | IDepinSessionResponse | IDepinIdentityResponse | IDepinSignResponse | IDepinDecryptResponse | IDepinSignDigestResponse | IErrorResponse | IProcessingResponse;
267
274
  /**
268
275
  * Message-level transport consumed by {@link NeuraiESP32}. This is the only
269
276
  * surface the device class depends on, so any platform (Web Serial, React
@@ -530,6 +537,19 @@ declare class NeuraiESP32 {
530
537
  * Requires an active session and the `depin_message` capability.
531
538
  */
532
539
  depinDecryptPayload(encryptedPayloadHex: string): Promise<IDepinDecryptResponse>;
540
+ /**
541
+ * Sign a 32-byte digest with the DePIN key (account 100'). The device ALWAYS
542
+ * asks for an explicit physical confirmation — this signature can move the
543
+ * DePIN address's XNA. Used to spend from the DePIN address, notably the
544
+ * pubkey-reveal burn that publishes the account-100 pubkey on-chain (so other
545
+ * chat members can encrypt group messages to this identity). The host builds
546
+ * the transaction, computes each input's legacy sighash, calls this per input,
547
+ * and assembles the P2PKH scriptSig from `signature` (append the sighash-type
548
+ * byte) + `pubkey`. Requires the device unlocked; not session-gated.
549
+ *
550
+ * @param digestHex 32-byte digest (the tx sighash), hex.
551
+ */
552
+ depinSignDigest(digestHex: string): Promise<IDepinSignDigestResponse>;
533
553
  /**
534
554
  * End the current DePIN session: auto-sign/decrypt stops and the identity is
535
555
  * no longer revealed until a new {@link depinSessionBegin} approval. Safe to
package/dist/index.js CHANGED
@@ -13175,6 +13175,23 @@ class NeuraiESP32 {
13175
13175
  this.assertSuccess(response);
13176
13176
  return response;
13177
13177
  }
13178
+ /**
13179
+ * Sign a 32-byte digest with the DePIN key (account 100'). The device ALWAYS
13180
+ * asks for an explicit physical confirmation — this signature can move the
13181
+ * DePIN address's XNA. Used to spend from the DePIN address, notably the
13182
+ * pubkey-reveal burn that publishes the account-100 pubkey on-chain (so other
13183
+ * chat members can encrypt group messages to this identity). The host builds
13184
+ * the transaction, computes each input's legacy sighash, calls this per input,
13185
+ * and assembles the P2PKH scriptSig from `signature` (append the sighash-type
13186
+ * byte) + `pubkey`. Requires the device unlocked; not session-gated.
13187
+ *
13188
+ * @param digestHex 32-byte digest (the tx sighash), hex.
13189
+ */
13190
+ async depinSignDigest(digestHex) {
13191
+ const response = await this.serial.sendCommand({ action: "depin_sign_digest", digest: digestHex }, 35000);
13192
+ this.assertSuccess(response);
13193
+ return response;
13194
+ }
13178
13195
  /**
13179
13196
  * End the current DePIN session: auto-sign/decrypt stops and the identity is
13180
13197
  * no longer revealed until a new {@link depinSessionBegin} approval. Safe to
@@ -255,6 +255,13 @@ interface IDepinDecryptResponse {
255
255
  plaintext_b64: string;
256
256
  op_count: number;
257
257
  }
258
+ interface IDepinSignDigestResponse {
259
+ status: string;
260
+ /** DER signature over the digest (no sighash-type byte; append it host-side). */
261
+ signature: string;
262
+ /** Compressed secp256k1 DePIN public key (33 bytes), hex — for the scriptSig. */
263
+ pubkey: string;
264
+ }
258
265
  interface IErrorResponse {
259
266
  status: "error";
260
267
  message: string;
@@ -263,7 +270,7 @@ interface IProcessingResponse {
263
270
  status: "processing";
264
271
  stage: string;
265
272
  }
266
- type DeviceResponse = IPingResponse | IDeviceInfo | IAddressResponse | IBip32PubkeyResponse | ISignPsbtResponse | ISignTxResponse | ISignMessageResponse | ISetupSeedResponse | IDepinSessionResponse | IDepinIdentityResponse | IDepinSignResponse | IDepinDecryptResponse | IErrorResponse | IProcessingResponse;
273
+ type DeviceResponse = IPingResponse | IDeviceInfo | IAddressResponse | IBip32PubkeyResponse | ISignPsbtResponse | ISignTxResponse | ISignMessageResponse | ISetupSeedResponse | IDepinSessionResponse | IDepinIdentityResponse | IDepinSignResponse | IDepinDecryptResponse | IDepinSignDigestResponse | IErrorResponse | IProcessingResponse;
267
274
  /**
268
275
  * Message-level transport consumed by {@link NeuraiESP32}. This is the only
269
276
  * surface the device class depends on, so any platform (Web Serial, React
@@ -530,6 +537,19 @@ declare class NeuraiESP32 {
530
537
  * Requires an active session and the `depin_message` capability.
531
538
  */
532
539
  depinDecryptPayload(encryptedPayloadHex: string): Promise<IDepinDecryptResponse>;
540
+ /**
541
+ * Sign a 32-byte digest with the DePIN key (account 100'). The device ALWAYS
542
+ * asks for an explicit physical confirmation — this signature can move the
543
+ * DePIN address's XNA. Used to spend from the DePIN address, notably the
544
+ * pubkey-reveal burn that publishes the account-100 pubkey on-chain (so other
545
+ * chat members can encrypt group messages to this identity). The host builds
546
+ * the transaction, computes each input's legacy sighash, calls this per input,
547
+ * and assembles the P2PKH scriptSig from `signature` (append the sighash-type
548
+ * byte) + `pubkey`. Requires the device unlocked; not session-gated.
549
+ *
550
+ * @param digestHex 32-byte digest (the tx sighash), hex.
551
+ */
552
+ depinSignDigest(digestHex: string): Promise<IDepinSignDigestResponse>;
533
553
  /**
534
554
  * End the current DePIN session: auto-sign/decrypt stops and the identity is
535
555
  * no longer revealed until a new {@link depinSessionBegin} approval. Safe to
@@ -13175,6 +13175,23 @@ class NeuraiESP32 {
13175
13175
  this.assertSuccess(response);
13176
13176
  return response;
13177
13177
  }
13178
+ /**
13179
+ * Sign a 32-byte digest with the DePIN key (account 100'). The device ALWAYS
13180
+ * asks for an explicit physical confirmation — this signature can move the
13181
+ * DePIN address's XNA. Used to spend from the DePIN address, notably the
13182
+ * pubkey-reveal burn that publishes the account-100 pubkey on-chain (so other
13183
+ * chat members can encrypt group messages to this identity). The host builds
13184
+ * the transaction, computes each input's legacy sighash, calls this per input,
13185
+ * and assembles the P2PKH scriptSig from `signature` (append the sighash-type
13186
+ * byte) + `pubkey`. Requires the device unlocked; not session-gated.
13187
+ *
13188
+ * @param digestHex 32-byte digest (the tx sighash), hex.
13189
+ */
13190
+ async depinSignDigest(digestHex) {
13191
+ const response = await this.serial.sendCommand({ action: "depin_sign_digest", digest: digestHex }, 35000);
13192
+ this.assertSuccess(response);
13193
+ return response;
13194
+ }
13178
13195
  /**
13179
13196
  * End the current DePIN session: auto-sign/decrypt stops and the identity is
13180
13197
  * no longer revealed until a new {@link depinSessionBegin} approval. Safe to
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neuraiproject/neurai-sign-esp32",
3
- "version": "0.5.9",
3
+ "version": "0.5.10",
4
4
  "description": "Create and sign PSBTs for Neurai via ESP32 hardware wallet",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",