Skip to content

refactor(core): improved Stellar transaction signing interface for a more streamlined user experience. #5159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 20, 2025

Conversation

overcat
Copy link
Contributor

@overcat overcat commented Jun 9, 2025

Key Changes

  • Warning for TX Source Mismatch: We'll now show a warning when the transaction source doesn't match your Trezor account.
  • Improved Memo Alert: The alert page for when a memo isn't set has been optimized.
  • Enhanced Payment UI: The user interface for payment operations has been improved.
  • Enhanced Create Account UI: The user interface for the "Create Account" operation has been optimized.
  • Recipient #{output_index}: If a tx contains multiple payment-related operations, we will use Recipient #{output_index} to label them.

You can find the design here, though the final design has some slight differences which you can see in the follow-up discussions.

@overcat overcat force-pushed the refactor-stellar-sign-flow branch from cc1fbd7 to ccf56b4 Compare July 2, 2025 10:14
@overcat overcat changed the title [Draft] refactor(core): optimize the signing process of Stellar transactions. refactor(core): improved Stellar transaction signing interface for a more streamlined user experience. Jul 2, 2025
@overcat
Copy link
Contributor Author

overcat commented Jul 2, 2025

A Few Questions

  1. Do I need to manually add translation files? I'm guessing not, but when do we typically update those?

  2. Do I need to manually update ./tests/ui_tests/fixtures.json? It seems like ./tests/update_fixtures.py might not work in my own repository. Perhaps I'll only be able to use it after the CI runs in this repository?

Hi @matejcik, could you please help me with this? I haven't contributed code here for a long time.

@Hannsek
Copy link
Contributor

Hannsek commented Jul 3, 2025

cc @obrusvit

@matejcik
Copy link
Contributor

matejcik commented Jul 3, 2025

Do I need to manually add translation files? I'm guessing not, but when do we typically update those?

you need to add English strings. you can ignore the other languages

Do I need to manually update ./tests/ui_tests/fixtures.json? It seems like ./tests/update_fixtures.py might not work in my own repository. Perhaps I'll only be able to use it after the CI runs in this repository?

nobody does that manually.
if you run tests e.g. via make test_emu_ui_multicore in core directory, you should be able to run tests/update_fixtures.py local to update them. if there's a problem with that, please report what you see.

@overcat overcat force-pushed the refactor-stellar-sign-flow branch from 3a2f559 to fe44259 Compare July 4, 2025 02:32
br_name or "confirm_address",
br_code,
subtitle=None,
subtitle=subtitle,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made some adjustments to meet Stellar's requirements, but this has impacted certain interfaces for Ethereum and Solana.

Solana before and after:
Solana before
Solana after

Ethereum before and after:

Ethereum before
Ethereum after

I'm not sure why we're not consistent with delizia's implementation here, especially since the subtitle isn't ignored there.

def confirm_address(
title: str,
address: str,
subtitle: str | None = None,
description: str | None = None,
verb: str | None = None,
warning_footer: str | None = None,
chunkify: bool = True,
br_name: str | None = None,
br_code: ButtonRequestType = BR_CODE_OTHER,
) -> Awaitable[None]:
return confirm_value(
title,
address,
description or "",
br_name or "confirm_address",
br_code,
subtitle=subtitle,
verb=(verb or TR.buttons__confirm),
chunkify=chunkify,
)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine. Thanks for pointing this out.

@overcat overcat marked this pull request as ready for review July 4, 2025 03:17
@overcat overcat requested review from matejcik and prusnak as code owners July 4, 2025 03:17
@Hannsek Hannsek requested review from obrusvit and removed request for prusnak and matejcik July 14, 2025 07:51
@obrusvit obrusvit self-assigned this Jul 16, 2025
@obrusvit obrusvit added core Trezor Core firmware. Runs on Trezor Model T and Safe models. altcoin Any non-Bitcoin coins labels Jul 16, 2025
@github-project-automation github-project-automation bot moved this to 🔎 Needs review in Firmware Jul 16, 2025
@obrusvit obrusvit added this to the Release 25.09 milestone Jul 16, 2025
@obrusvit obrusvit force-pushed the refactor-stellar-sign-flow branch from 71b7c59 to d79e5c6 Compare July 16, 2025 15:35
@obrusvit
Copy link
Contributor

obrusvit commented Jul 16, 2025

Hello @overcat, I rebased on top of main and force-pushed so that CI can run.

  • I did minor fixes in d79e5c6
  • It's possible that ui_fixtures.json will have to be updated again, I will take care of it.

From the discussion in the issue, the last thing remaining in the UI is the cancellation from the warning screen, am I right? I'll take a look whether we can do it easily.

Thank you.

@obrusvit
Copy link
Contributor

One more thing @overcat, do you think you could provide trezorctl commands which trigger the usecases shown in your videos? Thank you.

@overcat
Copy link
Contributor Author

overcat commented Jul 17, 2025

Hi @obrusvit

From the discussion in the issue, the last thing remaining in the UI is the cancellation from the warning screen, am I right? I'll take a look whether we can do it easily.

This should apply to all alert pages, not just Stellar's. So, would it be better to do this in a separate PR?

do you think you could provide trezorctl commands which trigger the usecases shown in your videos? Thank you.

Here's some test data; you can find more in https://github.com/trezor/trezor-firmware/blob/main/common/tests/fixtures/stellar/sign_tx.json (check xdr field).

trezorctl device load -m 'all all all all all all all all all all all all'
# Source not equals Trezor Account (show warning page)
trezorctl stellar sign-transaction 'AAAAAgAAAADTSPIr3MGTm9sMI5oJJ/GuXE2KFkCxLma1cUfqm1LKzQAAAGQAAAAAAAAD6AAAAAEAAAAAG4J3zQAAAABd5CqEAAAAAAAAAAEAAAAAAAAAAQAAAABdVWQkZrGFuEMVLp4hkVHbxYkgJ+xAEBpRe+1coDDC4AAAAAAAAAAAHc8WmAAAAAAAAAAA'
# Payment with non-native asset
trezorctl stellar sign-transaction 'AAAAAgAAAAAvIrnGLwi3dPPr5t1ufbk8PsLL3gJ5Vho9nFIluMMikgAAAGQAAAAAAAAD6AAAAAEAAAAAG4J3zQAAAABd5CqEAAAAAAAAAAEAAAAAAAAAAQAAAABdVWQkZrGFuEMVLp4hkVHbxYkgJ+xAEBpRe+1coDDC4AAAAAFYAAAAAAAAACmElgLCDlg2XxI8Eth6HKRVDRDNIbCuDhjUTj5W/WoVAAAAAB3PFpgAAAAAAAAAAA=='
# All Send-like operations
trezorctl stellar sign-transaction 'AAAAAgAAAAAvIrnGLwi3dPPr5t1ufbk8PsLL3gJ5Vho9nFIluMMikgAAAfQAAAAAAAAD6AAAAAEAAAAAG4J3zQAAAABd5CqEAAAAAAAAAAUAAAAAAAAAAAAAAABdVWQkZrGFuEMVLp4hkVHbxYkgJ+xAEBpRe+1coDDC4AAAAAAF9eEAAAAAAAAAAAEAAAAAXVVkJGaxhbhDFS6eIZFR28WJICfsQBAaUXvtXKAwwuAAAAABWAAAAAAAAAAphJYCwg5YNl8SPBLYehykVQ0QzSGwrg4Y1E4+Vv1qFQAAAAAdzxaYAAAAAAAAAA0AAAABWAAAAAAAAABwi6oxX35cFm2EtGS/s4/WJXj+OtJyJ+dsy7ehecRRIQAAAAAdzxaYAAAAAF1VZCRmsYW4QxUuniGRUdvFiSAn7EAQGlF77VygMMLgAAAAAkFCQ0RFRkdISUpLTAAAAAAphJYCwg5YNl8SPBLYehykVQ0QzSGwrg4Y1E4+Vv1qFQAAAAAAAeJAAAAAAAAAAAAAAAACAAAAAVgAAAAAAAAAcIuqMV9+XBZthLRkv7OP1iV4/jrScifnbMu3oXnEUSEAAAAAHc8WmAAAAABdVWQkZrGFuEMVLp4hkVHbxYkgJ+xAEBpRe+1coDDC4AAAAAJBQkNERUZHSElKS0wAAAAAKYSWAsIOWDZfEjwS2HocpFUNEM0hsK4OGNROPlb9ahUAAAAAAAHiQAAAAAAAAAAAAAAACAAAAABdVWQkZrGFuEMVLp4hkVHbxYkgJ+xAEBpRe+1coDDC4AAAAAAAAAAA'
# Text Memo
trezorctl stellar sign-transaction 'AAAAAgAAAAAvIrnGLwi3dPPr5t1ufbk8PsLL3gJ5Vho9nFIluMMikgAAAGQAAAAAAAAD6AAAAAEAAAAAG4J3zQAAAABd5CqEAAAAAQAAAA1IZWxsbywgd29ybGQhAAAAAAAAAQAAAAAAAAABAAAAAF1VZCRmsYW4QxUuniGRUdvFiSAn7EAQGlF77VygMMLgAAAAAAAAAAAdzxaYAAAAAAAAAAA='

@Hannsek
Copy link
Contributor

Hannsek commented Jul 17, 2025

This should apply to all alert pages, not just Stellar's. So, would it be better to do this in a separate PR?

I thought it is an issue only with this pr, but as you said, it is problem with all warning screens. So, let's not block this pr with this.

@obrusvit obrusvit linked an issue Aug 15, 2025 that may be closed by this pull request
@ibz ibz force-pushed the refactor-stellar-sign-flow branch from d79e5c6 to 9a3dd90 Compare August 15, 2025 11:17
@ibz
Copy link
Contributor

ibz commented Aug 15, 2025

Rebased on main and force pushed...

@ibz ibz force-pushed the refactor-stellar-sign-flow branch from d9f3df5 to 231566a Compare August 18, 2025 09:26
@ibz ibz force-pushed the refactor-stellar-sign-flow branch 4 times, most recently from 699d01b to 03e9ad0 Compare August 18, 2025 10:30
@ibz
Copy link
Contributor

ibz commented Aug 18, 2025

BTW, I am taking this over so we can get unstuck. Thank you, @overcat for the great job!!!

After rebasing and dealing with conflicts, I am doing a final review - including a review of the UI changes.

I have to say that generally the UI looks much better than before!

In some cases it feels like a slight downgrade, for example:

image

Was replaced with:

image

I honestly liked seeing the fact that an account is created, not just a generic Recipient #1 - what do you think @Hannsek ? Should I in this case show Create account #1 instead of Recipient #1 in the title?

Another question, for @overcat

image

Is this really a "maximum fee" or is it an exact fee amount that we are dealing with? Since we changed the design, I would not have expected a change in the semantics... The two are not the same!

But generally the UI feels more consistent and in line with other coins, so I think having this merged will be a plus.

PS: I will look into the warning cancellation after this gets merged, since it is a separate issue...

@overcat
Copy link
Contributor Author

overcat commented Aug 18, 2025

Hi @ibz, it's maximum fee. See https://stellar.org/blog/developers/surge-pricing-on-stellar-faq

CAP5 introduces “dutch auction” fee payments which ensure that the operation fee you submit is the maximum you will pay and the actual amount is the lowest possible.

Copy link
Contributor

@ibz ibz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

I removed some strings that are now unused.

One thing to note is that we used to warn when using testnet for a transaction, now we don't.

I suppose it is not a risk of losing funds, because at worst what happens is somebody sends testnet tokens without realizing they are testnet... not the other way around.

async def require_confirm_final(
address_n: list[int],
fee: int,
timebonuds: tuple[int, int],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed to timebounds

@ibz
Copy link
Contributor

ibz commented Aug 19, 2025

I will squash, force push, and get it ready to be merged...

@ibz ibz force-pushed the refactor-stellar-sign-flow branch 2 times, most recently from 4044a6a to fa964c7 Compare August 19, 2025 11:05
@overcat
Copy link
Contributor Author

overcat commented Aug 19, 2025

One thing to note is that we used to warn when using testnet for a transaction, now we don't.

I suppose it is not a risk of losing funds, because at worst what happens is somebody sends testnet tokens without realizing they are testnet... not the other way around.

Yes, this design has been clarified here.

@ibz
Copy link
Contributor

ibz commented Aug 19, 2025

has been clarified

Right, I missed that part at the bottom about the testnet, but seems it's all clear. It was indeed an unnecessary complication for no added benefit.

@ibz ibz added the translations Put this label on a PR to run tests in all languages label Aug 19, 2025
@ibz ibz mentioned this pull request Aug 19, 2025
@ibz ibz force-pushed the refactor-stellar-sign-flow branch from fa964c7 to a746997 Compare August 20, 2025 06:10
@ibz ibz merged commit 6dc393a into trezor:main Aug 20, 2025
290 of 295 checks passed
@github-project-automation github-project-automation bot moved this from 🔎 Needs review to 🤝 Needs QA in Firmware Aug 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
altcoin Any non-Bitcoin coins core Trezor Core firmware. Runs on Trezor Model T and Safe models. translations Put this label on a PR to run tests in all languages
Projects
Status: 🤝 Needs QA
Development

Successfully merging this pull request may close these issues.

Stellar: optimize the signing process for sending tx.
5 participants