bb03 UI: placeholder BTC signing workflows
What changed, and why it matters
This commit replaces unfinished placeholder code (which would crash with 'todo!()') with simple working user-interface placeholders for Bitcoin signing demonstrations. It adds basic on-screen prompts to confirm a recipient/amount and a total/fee, and makes progress/empty UI elements return real objects instead of crashing. There is no security issue visible in the diff; it is routine UI scaffolding.
No security action required. Review as normal UI feature code.
Security signals we found
No strong security signals were identified.
Evidence from the diff
In src/rust/bitbox03/src/ui.rs, the BitBox03 UI HAL implementation is fleshed out for BTC signing workflows: set_fraction becomes a no-op, verify_recipient and verify_total_fee now format strings and call self.confirm(), progress_create returns BitBox03UiProgress, and empty_create returns BitBox03UiEmpty. Previously these methods panicked via todo!(). The change is strictly additive scaffolding for demo flows and does not introduce cryptographic, authorization, or memory-safety changes.
Changed components
src/rust/bitbox03/src/ui.rsInspect captured patch +24 / −12
diff --git a/src/rust/bitbox03/src/ui.rs b/src/rust/bitbox03/src/ui.rs
index 33439a0..f4d9814 100644
--- a/src/rust/bitbox03/src/ui.rs
+++ b/src/rust/bitbox03/src/ui.rs
@@ -40,9 +40,7 @@ impl<Timer> Drop for ScreenGuard<'_, Timer> {
}
impl hal::ui::Progress for BitBox03UiProgress {
- fn set_fraction(&mut self, _numerator: u32, _denominator: u32) {
- todo!()
- }
+ fn set_fraction(&mut self, _numerator: u32, _denominator: u32) {}
}
impl hal::ui::Empty for BitBox03UiEmpty {}
@@ -78,19 +76,33 @@ impl<Timer: bitbox_hal::timer::Timer> hal::ui::Ui for BitBox03Ui<Timer> {
async fn verify_recipient(
&mut self,
- _recipient: &str,
- _amount: &str,
+ recipient: &str,
+ amount: &str,
) -> Result<(), bitbox_hal::ui::UserAbort> {
- todo!()
+ let body = format!("{amount}\n\n{recipient}");
+ self.confirm(&bitbox_hal::ui::ConfirmParams {
+ title: "Send",
+ body: &body,
+ accept_is_nextarrow: true,
+ ..Default::default()
+ })
+ .await
}
async fn verify_total_fee(
&mut self,
- _total: &str,
- _fee: &str,
- _longtouch: bool,
+ total: &str,
+ fee: &str,
+ longtouch: bool,
) -> Result<(), bitbox_hal::ui::UserAbort> {
- todo!()
+ let body = format!("Total amount\n{total}\n\nFee\n{fee}");
+ self.confirm(&bitbox_hal::ui::ConfirmParams {
+ title: "Transaction",
+ body: &body,
+ longtouch,
+ ..Default::default()
+ })
+ .await
}
async fn status(&mut self, title: &str, status_success: bool) {
@@ -114,11 +126,11 @@ impl<Timer: bitbox_hal::timer::Timer> hal::ui::Ui for BitBox03Ui<Timer> {
}
fn progress_create(&mut self, _title: &str) -> Self::Progress {
- todo!()
+ BitBox03UiProgress
}
fn empty_create(&mut self) -> Self::Empty {
- todo!()
+ BitBox03UiEmpty
}
fn unlock_animation_create(&mut self) -> Self::UnlockAnimation {
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.