Skip to content

Commit d3676ef

Browse files
fix: ledger builds (#7260)
Description --- Fixed ledger builds locally using the latest ledger docker image; however, the objective is to fix the ledger wallet auto-builds in GitHub, and this may still need some tweaks in follow-up commits. Motivation and Context --- Ledger auto-builds in GitHub were failing. How Has This Been Tested? --- - Tested locally. - Ledger auto-builds in GitHub: https://github.com/hansieodendaal/tari/actions/runs/15869532430 ![image](https://github.com/user-attachments/assets/28f139a7-291f-417c-90a9-4751204ed9a8) What process can a PR reviewer use to test or verify this change? --- Code review. Check GitHub actions output. <!-- Checklist --> <!-- 1. Is the title of your PR in the form that would make nice release notes? The title, excluding the conventional commit tag, will be included exactly as is in the CHANGELOG, so please think about it carefully. --> Breaking Changes --- - [x] None - [ ] Requires data directory on base node to be deleted - [ ] Requires hard fork - [ ] Other - Please specify <!-- Does this include a breaking change? If so, include this line as a footer --> <!-- BREAKING CHANGE: Description what the user should do, e.g. delete a database, resync the chain --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Summary by CodeRabbit - **Documentation** - Updated the README to clarify installation instructions, specify the correct working directory, and standardize path formatting for commands. - **Refactor** - Improved internal handling of string values for "Amount" and "Receiver" fields to ensure data safety, with no change to visible behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 86539c8 commit d3676ef

File tree

8 files changed

+25
-21
lines changed

8 files changed

+25
-21
lines changed

applications/minotari_ledger_wallet/wallet/README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,16 +145,19 @@ ledgerctl delete "MinoTari Wallet"
145145

146146
- Installation
147147

148+
The following command has to be run from the root of the Tari ledger wallet repository, i.e.
149+
`<TARI>/applications/minotari_ledger_wallet/wallet`.
150+
148151
First locate `app_nanosplus.json`. It will either be in the ledger wallet root
149-
`/applications/minotari_ledger_wallet/wallet` or in its the target directory `./target/nanosplus/release`,
152+
`<TARI>/applications/minotari_ledger_wallet/wallet` or in its the target directory `./target/nanosplus/release`,
150153
then run one of the following commands to install the application:
151154

152155
```
153156
ledgerctl install app_nanosplus.json
154157
```
155158
```
156-
ledgerctl install .\target\nanosplus\release\app_nanosplus.json
157-
ledgerctl install .\target\stax\release\app_stax.json
159+
ledgerctl install ./target/nanosplus/release/app_nanosplus.json
160+
ledgerctl install ./target/stax/release/app_stax.json
158161
```
159162

160163
**Notes for Windows users:**

applications/minotari_ledger_wallet/wallet/src/crypto/hashing.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright 2025 The Tari Project
22
// SPDX-License-Identifier: BSD-3-Clause
33
use alloc::{format, string::String};
4-
54
use core::marker::PhantomData;
65

76
use digest::{Digest, FixedOutput, FixedOutputReset, Output, OutputSizeUser, Update};

applications/minotari_ledger_wallet/wallet/src/crypto/schnorr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ use rand_core::{CryptoRng, RngCore};
1414
use tari_utilities::ByteArray;
1515

1616
use crate::{
17-
hash_domain,
18-
hashing::DomainSeparatedHash,
1917
crypto::{
2018
hashing::{DomainSeparatedHasher, DomainSeparation},
2119
keys::{RistrettoPublicKey, RistrettoSecretKey},
2220
},
21+
hash_domain,
22+
hashing::DomainSeparatedHash,
2323
};
2424

2525
hash_domain!(SchnorrSigChallenge, "com.tari.schnorr_signature", 1);

applications/minotari_ledger_wallet/wallet/src/handlers/get_one_sided_metadata_signature.rs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,25 @@ use ledger_device_sdk::ui::{
2020
gadgets::{Field, MultiFieldReview, SingleMessage},
2121
};
2222
use minotari_ledger_wallet_common::{
23-
get_public_spend_key_bytes_from_tari_dual_address,
2423
get_payment_id_bytes_from_tari_dual_address,
24+
get_public_spend_key_bytes_from_tari_dual_address,
2525
tari_dual_address_display,
26-
TARI_DUAL_ADDRESS_MIN_SIZE,
2726
TARI_DUAL_ADDRESS_MAX_SIZE,
27+
TARI_DUAL_ADDRESS_MIN_SIZE,
2828
};
2929
use tari_utilities::ByteArray;
3030
use zeroize::Zeroizing;
3131

3232
use crate::{
3333
alloc::string::ToString,
34-
hashing::DomainSeparatedConsensusHasher,
3534
crypto::{
3635
commitment::PedersenCommitment,
3736
commitment_and_public_key_signature::CommitmentAndPublicKeySignature,
3837
commitment_factory::PedersenCommitmentFactory,
3938
hashing::DomainSeparatedHasher,
4039
keys::{RistrettoPublicKey, RistrettoSecretKey},
4140
},
41+
hashing::DomainSeparatedConsensusHasher,
4242
utils::{
4343
derive_from_bip32_key,
4444
get_key_from_canonical_bytes,
@@ -56,7 +56,8 @@ pub fn handler_get_one_sided_metadata_signature(comm: &mut Comm) -> Result<(), A
5656
let data = comm.get_data().map_err(|_| AppSW::WrongApduLength)?;
5757

5858
// Validate minimum required data size early
59-
// Minimum: account(8) + network(8) + txo_version(8) + sender_offset_key_index(8) + value(8) + commitment_mask(32) + address_size(2) + min_address(67) + message(32) = 171
59+
// Minimum: account(8) + network(8) + txo_version(8) + sender_offset_key_index(8) + value(8) + commitment_mask(32) +
60+
// address_size(2) + min_address(67) + message(32) = 171
6061
if data.len() < 171 {
6162
return Err(AppSW::WrongApduLength);
6263
}
@@ -88,7 +89,7 @@ pub fn handler_get_one_sided_metadata_signature(comm: &mut Comm) -> Result<(), A
8889
if data.len() < 74 {
8990
return Err(AppSW::WrongApduLength);
9091
}
91-
let address_size_bytes = &data[72..74];
92+
let address_size_bytes = &data[72..74];
9293
let address_size = u16::from_le_bytes([address_size_bytes[0], address_size_bytes[1]]) as usize;
9394

9495
if address_size < TARI_DUAL_ADDRESS_MIN_SIZE || address_size > TARI_DUAL_ADDRESS_MAX_SIZE {
@@ -126,20 +127,23 @@ pub fn handler_get_one_sided_metadata_signature(comm: &mut Comm) -> Result<(), A
126127
return Err(AppSW::WrongApduLength);
127128
}
128129
let mut metadata_signature_message_common = [0u8; 32];
129-
metadata_signature_message_common.clone_from_slice(&data[metadata_signature_message_common_start..metadata_signature_message_common_end]);
130+
metadata_signature_message_common
131+
.clone_from_slice(&data[metadata_signature_message_common_start..metadata_signature_message_common_end]);
130132

131133
// Extract payment ID if present
132134
let payment_id_bytes = get_payment_id_bytes_from_tari_dual_address(receiver_address_bytes)
133135
.map_err(|_| AppSW::MetadataSignatureFail)?;
134136

135137
let mut fields = Vec::new();
138+
let field_value = format!("{}", value.to_string());
136139
fields.push(Field {
137140
name: "Amount",
138-
value: &format!("{}", value.to_string()),
141+
value: &field_value,
139142
});
143+
let field_value = format!("{}", receiver_address);
140144
fields.push(Field {
141145
name: "Receiver",
142-
value: &format!("{}", receiver_address),
146+
value: &field_value,
143147
});
144148

145149
// Add payment ID field if present

applications/minotari_ledger_wallet/wallet/src/handlers/get_schnorr_signature.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ use tari_utilities::ByteArray;
1212

1313
use crate::{
1414
alloc::string::ToString,
15-
hash_domain,
1615
crypto::schnorr::SchnorrSignature,
16+
hash_domain,
1717
utils::{derive_from_bip32_key, get_random_nonce},
1818
AppSW,
1919
KeyType,

applications/minotari_ledger_wallet/wallet/src/handlers/get_script_signature.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ use ledger_device_sdk::ui::gadgets::SingleMessage;
1313

1414
use crate::{
1515
alloc::string::ToString,
16-
hashing::DomainSeparatedConsensusHasher,
1716
crypto::{
1817
commitment::PedersenCommitment,
1918
commitment_and_public_key_signature::CommitmentAndPublicKeySignature,
2019
commitment_factory::PedersenCommitmentFactory,
2120
keys::{RistrettoPublicKey, RistrettoSecretKey},
2221
},
22+
hashing::DomainSeparatedConsensusHasher,
2323
utils::{
2424
alpha_hasher,
2525
derive_from_bip32_key,

applications/minotari_ledger_wallet/wallet/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
#![feature(alloc_error_handler)]
77

88
extern crate alloc;
9-
mod hashing;
109
mod crypto;
10+
mod hashing;
1111
pub mod utils;
1212

1313
mod app_ui {

applications/minotari_ledger_wallet/wallet/src/utils.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ use zeroize::Zeroizing;
2020

2121
use crate::{
2222
alloc::string::{String, ToString},
23-
hash_domain,
2423
crypto::{hashing::DomainSeparatedHasher, keys::RistrettoSecretKey},
24+
hash_domain,
2525
AppSW,
2626
KeyType,
2727
BIP32_COIN_TYPE,
@@ -164,9 +164,7 @@ fn get_raw_bip32_key(path: &[u32]) -> Result<Zeroizing<[u8; 64]>, String> {
164164
Ok(key_buffer)
165165
}
166166
},
167-
Err(e) => {
168-
return Err(cx_error_to_string(e))
169-
},
167+
Err(e) => return Err(cx_error_to_string(e)),
170168
}
171169
}
172170

0 commit comments

Comments
 (0)