Skip to content

Commit 59b4af2

Browse files
authored
feat(ledger/app): add initial ledger app (#1870)
Description --- feat(ledger/app): add initial ledger app Motivation and Context --- Adds ledger app boilerplate code and implements get_version, get_app_name and get_public_key Next up: transaction signing How Has This Been Tested? --- Client test with speculos Breaking Changes --- - [x] None - [ ] Requires data directory to be deleted - [ ] Other - Please specify
1 parent 7a6a464 commit 59b4af2

36 files changed

+967
-594
lines changed

Cargo.lock

Lines changed: 25 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ members = [
4646
"crates/wallet/sdk",
4747
"crates/wallet/sdk_services",
4848
"crates/wallet/storage_sqlite",
49-
"crates/wallet/tari-ledger-client",
49+
"crates/wallet/ledger/client",
50+
"crates/wallet/ledger/common",
5051
"crates/ootle_address",
5152
"crates/ootle_serde",
5253
"crates/ootle_byte_type",
@@ -152,6 +153,7 @@ tari_hashing = "5.3.0-pre.1"
152153

153154
## Ledger
154155
minotari_ledger_wallet_common = { git = "https://github.com/tari-project/tari.git", tag = "v5.3.0-pre.1" }
156+
ootle_ledger_common = { path = "crates/wallet/ledger/common", version = "0.1.0" }
155157

156158
# networking crates
157159
proto_builder = { path = "networking/proto_builder" }
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[target.nanosplus]
2+
runner = "speculos -m nanosplus" # Or change the target
3+
4+
[unstable]
5+
avoid-dev-deps = true
6+
build-std = ["core", "alloc"]
7+
build-std-features = ["compiler-builtins-mem"]
8+
host-config = true
9+
target-applies-to-host = true
10+
11+
[host]
12+
rustflags = ["-Ctarget-feature=-crt-static"]
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
[workspace]
2+
[package]
3+
name = "ootle-ledger-app"
4+
version = "0.1.0"
5+
description = "Ootle Ledger App"
6+
edition = "2024"
7+
authors = ["Tari Development Community"]
8+
license = "BSD-3-Clause"
9+
10+
[[bin]]
11+
name = "ootle"
12+
path = "src/main.rs"
13+
14+
[dependencies]
15+
ootle_ledger_common = { path = "../common", default-features = false }
16+
17+
ledger_device_sdk = { version = "1.33.1" }
18+
curve25519-dalek = { version = "4", default-features = false, features = ["alloc", "rand_core", "precomputed-tables", "zeroize"] }
19+
borsh = { version = "1.6.0", default-features = false, features = ["derive"] }
20+
zeroize = { version = "1.8.2", default-features = false, features = ["alloc"] }
21+
22+
[features]
23+
bagl = []
24+
nbgl = ["ledger_device_sdk/io_new", "ledger_device_sdk/nano_nbgl"]
25+
26+
[profile.release]
27+
opt-level = "s"
28+
lto = true
29+
strip = "debuginfo"
30+
panic = "abort"
31+
32+
[package.metadata.ledger]
33+
curve = ["secp256k1"]
34+
flags = "0"
35+
path = ["44'/535348'"]
36+
name = "Tari Ootle Wallet"
37+
38+
[package.metadata.ledger.nanox]
39+
icon = "images/key_14x14.gif"
40+
41+
[package.metadata.ledger.nanosplus]
42+
icon = "images/key_14x14.gif"
43+
44+
[package.metadata.ledger.stax]
45+
icon = "images/key_32x32.gif"
46+
47+
[package.metadata.ledger.flex]
48+
icon = "images/key_40x40.gif"
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
#!/usr/bin/env bash
2+
3+
#
4+
# // Copyright 2026 The Tari Project
5+
# // SPDX-License-Identifier: BSD-3-Clause
6+
#
7+
8+
set -e
9+
10+
# 🎯 Ledger App Builder
11+
# Builds the Ledger app using Docker for a given target device.
12+
13+
SUPPORTED_TARGETS=("nanosplus" "nanox" "nanos" "stax" "flex")
14+
15+
usage() {
16+
echo ""
17+
echo "🦀 Ledger App Builder 🦀"
18+
echo ""
19+
echo "Usage: $0 <target>"
20+
echo ""
21+
echo "📦 Supported targets:"
22+
for t in "${SUPPORTED_TARGETS[@]}"; do
23+
echo "$t"
24+
done
25+
echo ""
26+
echo "📖 Examples:"
27+
echo " $0 nanosplus"
28+
echo " $0 nanox"
29+
echo ""
30+
exit 1
31+
}
32+
33+
if [ -z "$1" ]; then
34+
echo "❌ Error: No target specified."
35+
usage
36+
fi
37+
38+
TARGET="$1"
39+
40+
# Validate target
41+
VALID=false
42+
for t in "${SUPPORTED_TARGETS[@]}"; do
43+
if [ "$TARGET" = "$t" ]; then
44+
VALID=true
45+
break
46+
fi
47+
done
48+
49+
if [ "$VALID" = false ]; then
50+
echo "❌ Error: Unknown target '$TARGET'."
51+
usage
52+
fi
53+
54+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
55+
56+
echo ""
57+
echo "🚀 Building Ledger app for target: $TARGET"
58+
echo "📁 Using source directory: $SCRIPT_DIR"
59+
echo ""
60+
61+
docker run --rm -it \
62+
-v "$SCRIPT_DIR:/app" \
63+
-w /app/app \
64+
ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder \
65+
cargo ledger setup && cargo ledger build "$TARGET"
66+
67+
echo ""
68+
echo "✅ Build complete for target: $TARGET"
69+
echo ""
70+
892 Bytes
Loading
880 Bytes
Loading
187 Bytes
Loading
225 Bytes
Loading
358 Bytes
Loading

0 commit comments

Comments
 (0)