diff --git a/legacy/firmware/.changelog.d/2190.changed b/legacy/firmware/.changelog.d/2190.changed new file mode 100644 index 0000000000..4872888c6e --- /dev/null +++ b/legacy/firmware/.changelog.d/2190.changed @@ -0,0 +1 @@ +Do not convert bech32 addresses to uppercase in QR code to increase compatibility diff --git a/legacy/firmware/fsm_msg_coin.h b/legacy/firmware/fsm_msg_coin.h index 8f02e3472b..a7f0a05aa4 100644 --- a/legacy/firmware/fsm_msg_coin.h +++ b/legacy/firmware/fsm_msg_coin.h @@ -253,9 +253,7 @@ void fsm_msgGetAddress(const GetAddress *msg) { } bool is_cashaddr = coin->cashaddr_prefix != NULL; - bool is_bech32 = msg->script_type == InputScriptType_SPENDWITNESS || - msg->script_type == InputScriptType_SPENDTAPROOT; - if (!fsm_layoutAddress(address, desc, is_cashaddr || is_bech32, + if (!fsm_layoutAddress(address, desc, is_cashaddr, is_cashaddr ? strlen(coin->cashaddr_prefix) + 1 : 0, msg->address_n, msg->address_n_count, false, msg->has_multisig ? &(msg->multisig) : NULL, diff --git a/legacy/firmware/layout2.c b/legacy/firmware/layout2.c index 5334ff7799..2f268467d6 100644 --- a/legacy/firmware/layout2.c +++ b/legacy/firmware/layout2.c @@ -787,8 +787,12 @@ void layoutAddress(const char *address, const char *desc, bool qrcode, } oledInvert(0, 0, 63, 63); - if (side > 0 && side <= 29) { - int offset = 32 - side; + if (side > 0 && side <= 33) { + // For QR code V4 (33x33), still maintaining two pixels per module + // so that it is nicely readable. Not showing the bottom row, + // which is not a problem thanks to the QR code's error correction. + // It is a use-case for BTC taproot addresses. + int offset = side <= 29 ? 32 - side : 0; for (int i = 0; i < side; i++) { for (int j = 0; j < side; j++) { if (qrcodegen_getModule(codedata, i, j)) {