Skip to content

Commit f57b640

Browse files
authored
🔖 (release) [NO-ISSUE]: New release incoming: DMK 1.4.1, Signer ETH 1.15.1, Signer Zcash 0.2.0 (#1485)
2 parents 2588664 + 5662795 commit f57b640

68 files changed

Lines changed: 2364 additions & 142 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.changeset/afraid-banks-sort.md‎

Lines changed: 0 additions & 5 deletions
This file was deleted.

‎.changeset/all-humans-relate.md‎

Lines changed: 0 additions & 5 deletions
This file was deleted.

‎.changeset/bright-moles-fetch.md‎

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@ledgerhq/device-signer-kit-aleo": minor
3+
---
4+
5+
Add support for signing nested calls

‎.changeset/salty-pumas-rush.md‎

Lines changed: 0 additions & 5 deletions
This file was deleted.

‎.cursor/skills/backmerge/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ git commit -m "🔧 (release): Reset private packages after release"
6969

7070
```bash
7171
git push -u origin chore/backmerge
72-
gh pr create -B develop --title "🔀 (release) [NO-ISSUE]: Backmerge release into develop" -T .github/pull_request_backmerge_template.md
72+
gh pr create -B develop --title "🔀 (release) [NO-ISSUE]: Backmerge release into develop" -F .github/pull_request_backmerge_template.md
7373
```
7474

7575
- Report the PR URL to the user.

‎apps/docs/pages/docs/getting-started.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ Here you can find a summary of all the libraries that compose the DMK.
3939

4040
| Device Management Kit (DMK) | NPM | Version |
4141
| --------------------------- | ------------------------------------------------------------------------------------------------ | ------- |
42-
| Device Management Kit | [@ledgerhq/device-management-kit](https://www.npmjs.com/package/@ledgerhq/device-management-kit) | 1.4.0 |
42+
| Device Management Kit | [@ledgerhq/device-management-kit](https://www.npmjs.com/package/@ledgerhq/device-management-kit) | 1.4.1 |
4343

4444
| Signers & Trusted App Kit | NPM | Version |
4545
| ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
46-
| Device Signer Ethereum | [@ledgerhq/device-signer-kit-ethereum](https://www.npmjs.com/package/@ledgerhq/device-signer-kit-ethereum) | 1.15.0 |
46+
| Device Signer Ethereum | [@ledgerhq/device-signer-kit-ethereum](https://www.npmjs.com/package/@ledgerhq/device-signer-kit-ethereum) | 1.15.1 |
4747
| Device Signer Bitcoin | [@ledgerhq/device-signer-kit-bitcoin](https://www.npmjs.com/package/@ledgerhq/device-signer-kit-bitcoin) | 1.3.0 |
4848
| Device Signer Solana | [@ledgerhq/device-signer-kit-solana](https://www.npmjs.com/package/@ledgerhq/device-signer-kit-solana) | 1.8.0 |
4949
| Device Signer Cosmos | [@ledgerhq/device-signer-kit-cosmos](https://www.npmjs.com/package/@ledgerhq/device-signer-kit-cosmos) | 1.0.0 |

‎apps/docs/pages/docs/references/signers/zcash.mdx‎

Lines changed: 63 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
This module provides the implementation of the Ledger zcash signer of the Device Management Kit. It enables interaction with the zcash application on a Ledger device including:
44

55
- Retrieving the zcash address using a given derivation path
6+
- Retrieving the zcash full viewing key (UFVK or Orchard FVK)
67
- Signing a zcash transaction
78
- Signing a message displayed on a Ledger device
89
- Retrieving the app configuration
@@ -15,8 +16,9 @@ This module provides the implementation of the Ledger zcash signer of the Device
1516
4. [Use Cases](#-use-cases)
1617
- [Get App Configuration](#use-case-1-get-app-configuration)
1718
- [Get Address](#use-case-2-get-address)
18-
- [Sign Transaction](#use-case-3-sign-transaction)
19-
- [Sign Message](#use-case-4-sign-message)
19+
- [Get Full Viewing Key](#use-case-3-get-full-viewing-key)
20+
- [Sign Transaction](#use-case-4-sign-transaction)
21+
- [Sign Message](#use-case-5-sign-message)
2022
5. [Observable Behavior](#-observable-behavior)
2123
6. [Example](#-example)
2224

@@ -44,7 +46,7 @@ const signerZcash = new SignerZcashBuilder({ dmk, sessionId }).build();
4446

4547
## 🔹 Use Cases
4648

47-
The `SignerZcashBuilder.build()` method will return a `SignerZcash` instance that exposes 4 dedicated methods, each of which calls an independent use case. Each use case will return an object that contains an observable and a method called `cancel`.
49+
The `SignerZcashBuilder.build()` method will return a `SignerZcash` instance that exposes 5 dedicated methods, each of which calls an independent use case. Each use case will return an object that contains an observable and a method called `cancel`.
4850

4951
---
5052

@@ -119,7 +121,63 @@ type GetAddressCommandResponse = {
119121

120122
---
121123

122-
### Use Case 3: Sign Transaction
124+
### Use Case 3: Get Full Viewing Key
125+
126+
This method allows users to retrieve the zcash full viewing key based on a given ZIP-32 account `derivationPath`.
127+
128+
```typescript
129+
const { observable, cancel } = signerZcash.getFullViewingKey(
130+
derivationPath,
131+
options,
132+
);
133+
```
134+
135+
#### **Parameters**
136+
137+
- `derivationPath`
138+
139+
- **Required**
140+
- **Type:** `string` (e.g., `"32'/133'/0'"`)
141+
- The account-level ZIP-32 derivation path used for the zcash full viewing key.
142+
143+
- `options`
144+
145+
- Optional
146+
- Type: `FullViewingKeyOptions`
147+
148+
```typescript
149+
type FullViewingKeyOptions = {
150+
mode?: "ufvk" | "orchardFvk";
151+
skipOpenApp?: boolean;
152+
};
153+
```
154+
155+
- `mode`: Optional export mode. Defaults to `"ufvk"`.
156+
- `"ufvk"` returns the Unified Full Viewing Key as a UTF-8 string.
157+
- `"orchardFvk"` returns the raw Orchard Full Viewing Key bytes (`Uint8Array`).
158+
- `skipOpenApp`: An optional boolean indicating whether to skip opening the zcash app automatically (`true`) or not (`false`).
159+
160+
#### **Returns**
161+
162+
- `observable` Emits DeviceActionState updates, including the following details:
163+
164+
```typescript
165+
type GetFullViewingKeyResult =
166+
| {
167+
mode: "ufvk";
168+
fullViewingKey: string;
169+
}
170+
| {
171+
mode: "orchardFvk";
172+
fullViewingKey: Uint8Array;
173+
};
174+
```
175+
176+
- `cancel` A function to cancel the action on the Ledger device.
177+
178+
---
179+
180+
### Use Case 4: Sign Transaction
123181

124182
This method allows users to sign a zcash transaction.
125183

@@ -174,7 +232,7 @@ type Signature = {
174232

175233
---
176234

177-
### Use Case 4: Sign Message
235+
### Use Case 5: Sign Message
178236

179237
This method allows users to sign a text string that is displayed on Ledger devices.
180238

‎apps/sample/src/components/SignerAleoView/index.tsx‎

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ import {
1212
type SignFeeIntentDAError,
1313
type SignFeeIntentDAIntermediateValue,
1414
type SignFeeIntentDAOutput,
15+
type SignNestedCallDAError,
16+
type SignNestedCallDAIntermediateValue,
17+
type SignNestedCallDAOutput,
1518
type SignRootIntentDAError,
1619
type SignRootIntentDAIntermediateValue,
1720
type SignRootIntentDAOutput,
@@ -69,7 +72,7 @@ export const SignerAleoView: React.FC<{ sessionId: string }> = ({
6972
});
7073
},
7174
initialValues: {
72-
derivationPath: "44'/683'/0",
75+
derivationPath: "44'/683'/0'/0'",
7376
checkOnDevice: false,
7477
skipOpenApp: false,
7578
},
@@ -134,7 +137,7 @@ export const SignerAleoView: React.FC<{ sessionId: string }> = ({
134137
});
135138
},
136139
initialValues: {
137-
derivationPath: "44'/683'/0",
140+
derivationPath: "44'/683'/0'/0'",
138141
rootIntent: "",
139142
skipOpenApp: false,
140143
},
@@ -186,6 +189,44 @@ export const SignerAleoView: React.FC<{ sessionId: string }> = ({
186189
SignFeeIntentDAError,
187190
SignFeeIntentDAIntermediateValue
188191
>,
192+
{
193+
title: "Sign Nested Call",
194+
description: "Sign a nested call with the device",
195+
executeDeviceAction: ({ nestedCallRequest, skipOpenApp }) => {
196+
if (!signer) {
197+
throw new Error("Signer not initialized");
198+
}
199+
// Convert hex string to Uint8Array
200+
const nestedCallRequestBytes = nestedCallRequest.startsWith("0x")
201+
? new Uint8Array(
202+
nestedCallRequest
203+
.slice(2)
204+
.match(/.{1,2}/g)
205+
?.map((byte) => Number.parseInt(byte, 16)) ?? [],
206+
)
207+
: new Uint8Array(
208+
nestedCallRequest
209+
.match(/.{1,2}/g)
210+
?.map((byte) => Number.parseInt(byte, 16)) ?? [],
211+
);
212+
return signer.signNestedCall(nestedCallRequestBytes, {
213+
skipOpenApp,
214+
});
215+
},
216+
initialValues: {
217+
nestedCallRequest: "",
218+
skipOpenApp: false,
219+
},
220+
deviceModelId,
221+
} satisfies DeviceActionProps<
222+
SignNestedCallDAOutput,
223+
{
224+
nestedCallRequest: string;
225+
skipOpenApp?: boolean;
226+
},
227+
SignNestedCallDAError,
228+
SignNestedCallDAIntermediateValue
229+
>,
189230
],
190231
[deviceModelId, signer],
191232
);

‎apps/sample/src/components/SignerZcashView/index.tsx‎

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ import {
77
type GetAppConfigDAError,
88
type GetAppConfigDAIntermediateValue,
99
type GetAppConfigDAOutput,
10+
type GetFullViewingKeyDAError,
11+
type GetFullViewingKeyDAIntermediateValue,
12+
type GetFullViewingKeyDAOutput,
1013
type GetTrustedInputDAError,
1114
type GetTrustedInputDAIntermediateValue,
1215
type GetTrustedInputDAOutput,
@@ -16,13 +19,21 @@ import {
1619
type SignTransactionDAError,
1720
type SignTransactionDAIntermediateValue,
1821
type SignTransactionDAOutput,
22+
type ZcashFullViewingKeyMode,
1923
} from "@ledgerhq/device-signer-kit-zcash";
2024

2125
import { DeviceActionsList } from "@/components/DeviceActionsView/DeviceActionsList";
2226
import { type DeviceActionProps } from "@/components/DeviceActionsView/DeviceActionTester";
27+
import { type ValueSelector } from "@/components/Form";
28+
import { type FieldType } from "@/hooks/useForm";
2329
import { useDmk } from "@/providers/DeviceManagementKitProvider";
2430
import { useSignerZcash } from "@/providers/SignerZcashProvider";
2531

32+
const fullViewingKeyModeOptions: ValueSelector<FieldType>["mode"] = [
33+
{ label: "UFVK (string, P2=0x00)", value: "ufvk" },
34+
{ label: "Orchard FVK (96 raw bytes, P2=0x01)", value: "orchardFvk" },
35+
];
36+
2637
export const SignerZcashView: React.FC<{ sessionId: string }> = ({
2738
sessionId,
2839
}) => {
@@ -85,6 +96,43 @@ export const SignerZcashView: React.FC<{ sessionId: string }> = ({
8596
GetAddressDAError,
8697
GetAddressDAIntermediateValue
8798
>,
99+
{
100+
title: "Get Full Viewing Key",
101+
description:
102+
"Exports a full viewing key (UFVK/FVK) from the device. It does not spend funds, but it allows watching shielded balance and activity for this derivation — treat it as highly sensitive secret material. Do not share, log, or commit sample output; use only for local SDK testing.",
103+
executeDeviceAction: ({ derivationPath, mode, skipOpenApp }) => {
104+
if (!signer) {
105+
throw new Error("Signer not initialized");
106+
}
107+
const resolvedMode: ZcashFullViewingKeyMode =
108+
mode === "orchardFvk" ? "orchardFvk" : "ufvk";
109+
return signer.getFullViewingKey(derivationPath, {
110+
mode: resolvedMode,
111+
skipOpenApp,
112+
});
113+
},
114+
initialValues: {
115+
derivationPath: "32'/133'/0'",
116+
mode: "ufvk",
117+
skipOpenApp: false,
118+
},
119+
valueSelector: { mode: fullViewingKeyModeOptions },
120+
labelSelector: {
121+
mode: "Export mode (GET_VK P2)",
122+
derivationPath: "Derivation path",
123+
skipOpenApp: "Skip open app",
124+
},
125+
deviceModelId,
126+
} satisfies DeviceActionProps<
127+
GetFullViewingKeyDAOutput,
128+
{
129+
derivationPath: string;
130+
mode: ZcashFullViewingKeyMode;
131+
skipOpenApp?: boolean;
132+
},
133+
GetFullViewingKeyDAError,
134+
GetFullViewingKeyDAIntermediateValue
135+
>,
88136
{
89137
title: "Sign Transaction",
90138
description: "Sign a transaction with the device",

0 commit comments

Comments
 (0)