Skip to content

feat: Silent Payment Address Generation#854

Draft
notTanveer wants to merge 2 commits into
selfcustody:mainfrom
notTanveer:feat/sp-addr
Draft

feat: Silent Payment Address Generation#854
notTanveer wants to merge 2 commits into
selfcustody:mainfrom
notTanveer:feat/sp-addr

Conversation

@notTanveer
Copy link
Copy Markdown

What is this PR for?

#688, basic support for generating Silent Payment addresses.

NOTE: the actual Silent Payment computation logic should ultimately come from embit. Once upstream support is finalized, this can be refactored to rely directly on it.
For more details, see: diybitcoinhardware/embit#96

Changes made to:

  • Code
  • Tests

Did you build the code and tested on device?

  • Yes, build and tested on simulator

What is the purpose of this pull request?

  • New feature
2026-04-15.16-39-12.mov

@notTanveer notTanveer changed the title Feat/sp addr feat: Silent Payment Address Generation Apr 16, 2026
@qlrd
Copy link
Copy Markdown
Member

qlrd commented Apr 16, 2026

Strong cACK.

But i think would be better to add it as a KruxApp. AFAIK BIP352 has some tracking issue and isn't too stable to implement on firmware.

Also, would be nice to have some docs commit explaining the users how to use (use this made .mov and convert to some youtube video?)

@notTanveer
Copy link
Copy Markdown
Author

But i think would be better to add it as a KruxApp.

100% agree!

Also, would be nice to have some docs commit explaining the users how to use (use this made .mov and convert to some youtube video?)

good suggestion, i think it makes more sense to create a proper video once we have the send support. this will help new users to get familiar with silent payment.

Copy link
Copy Markdown
Member

@qlrd qlrd left a comment

Choose a reason for hiding this comment

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

Tested UX here with dana and silentium. Same outputs on mainnet using *(["abandon] * 11 + ["about"]) mnemonic (fingerprint 73c5da0a).

There's a failed functional test, i believe because the new item add the item stack:

tests/pages/test_menu.py ...F...
...
mocker = <pytest_mock.plugin.MockerFixture object at 0x1114ca9c0>, amigo = None

    def test_two_screens_menu(mocker, amigo):
        from krux.pages import Menu, MENU_CONTINUE, MENU_EXIT, MENU_SHUTDOWN
        from krux.input import (
            BUTTON_ENTER,
            BUTTON_PAGE,
            BUTTON_PAGE_PREV,
            SWIPE_UP,
            SWIPE_DOWN,
        )
...
        assert status == MENU_EXIT
>       assert ctx.input.wait_for_fastnav_button.call_count == len(BTN_SEQUENCE)
E       AssertionError: assert 27 == 13
E        +  where 27 = <MagicMock name='mock.input.wait_for_fastnav_button' id='4609921712'>.call_count
E        +    where <MagicMock name='mock.input.wait_for_fastnav_button' id='4609921712'> = <MagicMock name='mock.in
E        +      where <MagicMock name='mock.input' id='4575737040'> = <MagicMock id='4595040336'>.input
E        +  and   13 = len([0, 1, 0, 0, 7, 2, ...])

tests/pages/test_menu.py:225: AssertionError
---------------------------------------- Captured stdout call ----------------------------------------
3
click 0 [0]
click 1 [0, 1]
click 1 [0, 1, 1]
click 2 [0, 1, 1, 2]
click 4 [0, 1, 1, 2, 4]
click 0 [0, 1, 1, 2, 4, 0]
[('0', <function test_two_screens_menu.<locals>.<lambda> at 0x110b8fba0>), ('1', <function test_two_screens_menu.<locals>.<lambda> at 0x111b65300>), ('2', <function test_two_screens_menu.<locals>.<lambda> at 0x111b66b60>), ('3', <function test_two_screens_menu.<locals>.<lambda> at 0x111b663e0>), ('4', <function test_two_screens_menu.<locals>.<lambda> at 0x111b66d40>), ('< Back', <function Menu.<lambda> at 0x1114877e0>)]
click 0 [0]
click 1 [0, 1]
click 1 [0, 1, 1]
click 4 [0, 1, 1, 4]
click 0 [0, 1, 1, 4, 0

Also i suggest on krux-app to add an item menu that shows the current taproot "classic" address for verification, like in silentium. It would be nice to sign too (but dont know if its a not pushed wip)

@Garrysoon
Copy link
Copy Markdown

unfortunately, this is only for receiving... to spend the seed phrase must be entered into external applications, like Dana/Silentium

@notTanveer
Copy link
Copy Markdown
Author

There's a failed functional test, i believe because the new item add the item stack:

idk what's wrong but all the tests are passing perfectly on my end. below are the logs

Test Logs
poetry run poe test
Poe => python -c 'import shutil, os; os.path.exists("htmlcov") and shutil.rmtree("htmlcov")'
Poe => pytest --cache-clear --cov src/krux --cov-report html ./tests --cov-context=test --cov-report term-missing
======================================= test session starts =======================================
platform linux -- Python 3.12.3, pytest-9.0.2, pluggy-1.6.0
rootdir: /home/sahil/dev/krux
configfile: pyproject.toml
plugins: cov-7.0.0, mock-3.15.1
collected 1063 items

tests/pages/home_pages/test_addresses.py ...............                                    [  1%]
tests/pages/home_pages/test_bip85.py ...                                                    [  1%]
tests/pages/home_pages/test_home.py ............................                            [  4%]
tests/pages/home_pages/test_miniscript_indenter.py .                                        [  4%]
tests/pages/home_pages/test_mnemonic_backup.py ..........                                   [  5%]
tests/pages/home_pages/test_mnemonic_xor.py .............                                   [  6%]
tests/pages/home_pages/test_pub_key_view.py ....                                            [  6%]
tests/pages/home_pages/test_sign_message_ui.py ....                                         [  7%]
tests/pages/home_pages/test_silent_payment.py ....                                          [  7%]
tests/pages/home_pages/test_wallet_descriptor.py .................                          [  9%]
tests/pages/new_mnemonic/test_dice_rolls.py .............                                   [ 10%]
tests/pages/test_capture_entropy.py .......                                                 [ 11%]
tests/pages/test_datum_tool.py .........................                                    [ 13%]
tests/pages/test_device_tests.py ......................                                     [ 15%]
tests/pages/test_encryption_ui.py .......................................                   [ 19%]
tests/pages/test_file_manager.py ......                                                     [ 19%]
tests/pages/test_file_operations.py .....                                                   [ 20%]
tests/pages/test_fill_flash.py .........                                                    [ 21%]
tests/pages/test_flash_tools.py ..................                                          [ 22%]
tests/pages/test_keypads.py .                                                               [ 22%]
tests/pages/test_login.py ...............................................                   [ 27%]
tests/pages/test_menu.py .......                                                            [ 28%]
tests/pages/test_mnemonic_editor.py ..................                                      [ 29%]
tests/pages/test_page.py ...................................                                [ 33%]
tests/pages/test_print_page.py ...                                                          [ 33%]
tests/pages/test_qr_capture.py .....................                                        [ 35%]
tests/pages/test_qr_view.py ..............                                                  [ 36%]
tests/pages/test_screensaver.py .                                                           [ 36%]
tests/pages/test_settings_page.py ..................                                        [ 38%]
tests/pages/test_stackbit.py ......                                                         [ 38%]
tests/pages/test_tc_code_verification.py ..                                                 [ 39%]
tests/pages/test_tiny_seed.py ........................                                      [ 41%]
tests/pages/test_tools.py ......                                                            [ 41%]
tests/pages/test_utils.py ..                                                                [ 42%]
tests/pages/test_wallet_settings.py .................                                       [ 43%]
tests/printers/test_cnc.py ...........................                                      [ 46%]
tests/printers/test_printer.py .........                                                    [ 47%]
tests/printers/test_thermal.py ......                                                       [ 47%]
tests/test_auto_shutdown.py ..                                                              [ 47%]
tests/test_baseconv.py ............                                                         [ 49%]
tests/test_bbqr.py .........................                                                [ 51%]
tests/test_bip39.py ........                                                                [ 52%]
tests/test_buttons.py .........                                                             [ 52%]
tests/test_camera.py ...............................                                        [ 55%]
tests/test_context.py ...                                                                   [ 56%]
tests/test_display.py ....................................................................  [ 62%]
tests/test_encryption.py ............................                                       [ 65%]
tests/test_firmware.py ..................................                                   [ 68%]
tests/test_format.py .                                                                      [ 68%]
tests/test_i18n.py .                                                                        [ 68%]
tests/test_input.py ...........................................                             [ 72%]
tests/test_kef.py .........................                                                 [ 74%]
tests/test_key.py ............                                                              [ 76%]
tests/test_light.py ...                                                                     [ 76%]
tests/test_metadata.py .                                                                    [ 76%]
tests/test_power.py ................................................                        [ 80%]
tests/test_psbt.py ......................................                                   [ 84%]
tests/test_qr.py .....                                                                      [ 85%]
tests/test_sd_card.py ....                                                                  [ 85%]
tests/test_settings.py ...................                                                  [ 87%]
tests/test_silent_payment.py ..                                                             [ 87%]
tests/test_touch.py .............................................                           [ 91%]
tests/test_wallet.py ..................................                                     [ 94%]
tests/touchscreens/test_cst816.py .......................                                   [ 96%]
tests/touchscreens/test_ft6x36.py ...........                                               [ 98%]
tests/touchscreens/test_gt911.py ...................                                        [ 99%]
tests/touchscreens/test_touchscreen.py ..                                                   [100%]

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 27, 2026

Codecov Report

❌ Patch coverage is 92.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.27%. Comparing base (76feb7b) to head (609c42c).
⚠️ Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
src/krux/pages/home_pages/home.py 25.00% 3 Missing ⚠️
src/krux/pages/home_pages/silent_payment.py 95.65% 2 Missing ⚠️
src/krux/silent_payment.py 96.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #854      +/-   ##
==========================================
- Coverage   97.31%   97.27%   -0.04%     
==========================================
  Files          83       85       +2     
  Lines       10573    10648      +75     
==========================================
+ Hits        10289    10358      +69     
- Misses        284      290       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@qlrd
Copy link
Copy Markdown
Member

qlrd commented May 11, 2026

n, i think it makes more se

There's a failed functional test, i believe because the new item add the item stack:

idk what's wrong but all the tests are passing perfectly on my end. below are the logs
Test Logs

poetry run poe test
Poe => python -c 'import shutil, os; os.path.exists("htmlcov") and shutil.rmtree("htmlcov")'
Poe => pytest --cache-clear --cov src/krux --cov-report html ./tests --cov-context=test --cov-report term-missing
======================================= test session starts =======================================
platform linux -- Python 3.12.3, pytest-9.0.2, pluggy-1.6.0
rootdir: /home/sahil/dev/krux
configfile: pyproject.toml
plugins: cov-7.0.0, mock-3.15.1
collected 1063 items

tests/pages/home_pages/test_addresses.py ...............                                    [  1%]
tests/pages/home_pages/test_bip85.py ...                                                    [  1%]
tests/pages/home_pages/test_home.py ............................                            [  4%]
tests/pages/home_pages/test_miniscript_indenter.py .                                        [  4%]
tests/pages/home_pages/test_mnemonic_backup.py ..........                                   [  5%]
tests/pages/home_pages/test_mnemonic_xor.py .............                                   [  6%]
tests/pages/home_pages/test_pub_key_view.py ....                                            [  6%]
tests/pages/home_pages/test_sign_message_ui.py ....                                         [  7%]
tests/pages/home_pages/test_silent_payment.py ....                                          [  7%]
tests/pages/home_pages/test_wallet_descriptor.py .................                          [  9%]
tests/pages/new_mnemonic/test_dice_rolls.py .............                                   [ 10%]
tests/pages/test_capture_entropy.py .......                                                 [ 11%]
tests/pages/test_datum_tool.py .........................                                    [ 13%]
tests/pages/test_device_tests.py ......................                                     [ 15%]
tests/pages/test_encryption_ui.py .......................................                   [ 19%]
tests/pages/test_file_manager.py ......                                                     [ 19%]
tests/pages/test_file_operations.py .....                                                   [ 20%]
tests/pages/test_fill_flash.py .........                                                    [ 21%]
tests/pages/test_flash_tools.py ..................                                          [ 22%]
tests/pages/test_keypads.py .                                                               [ 22%]
tests/pages/test_login.py ...............................................                   [ 27%]
tests/pages/test_menu.py .......                                                            [ 28%]
tests/pages/test_mnemonic_editor.py ..................                                      [ 29%]
tests/pages/test_page.py ...................................                                [ 33%]
tests/pages/test_print_page.py ...                                                          [ 33%]
tests/pages/test_qr_capture.py .....................                                        [ 35%]
tests/pages/test_qr_view.py ..............                                                  [ 36%]
tests/pages/test_screensaver.py .                                                           [ 36%]
tests/pages/test_settings_page.py ..................                                        [ 38%]
tests/pages/test_stackbit.py ......                                                         [ 38%]
tests/pages/test_tc_code_verification.py ..                                                 [ 39%]
tests/pages/test_tiny_seed.py ........................                                      [ 41%]
tests/pages/test_tools.py ......                                                            [ 41%]
tests/pages/test_utils.py ..                                                                [ 42%]
tests/pages/test_wallet_settings.py .................                                       [ 43%]
tests/printers/test_cnc.py ...........................                                      [ 46%]
tests/printers/test_printer.py .........                                                    [ 47%]
tests/printers/test_thermal.py ......                                                       [ 47%]
tests/test_auto_shutdown.py ..                                                              [ 47%]
tests/test_baseconv.py ............                                                         [ 49%]
tests/test_bbqr.py .........................                                                [ 51%]
tests/test_bip39.py ........                                                                [ 52%]
tests/test_buttons.py .........                                                             [ 52%]
tests/test_camera.py ...............................                                        [ 55%]
tests/test_context.py ...                                                                   [ 56%]
tests/test_display.py ....................................................................  [ 62%]
tests/test_encryption.py ............................                                       [ 65%]
tests/test_firmware.py ..................................                                   [ 68%]
tests/test_format.py .                                                                      [ 68%]
tests/test_i18n.py .                                                                        [ 68%]
tests/test_input.py ...........................................                             [ 72%]
tests/test_kef.py .........................                                                 [ 74%]
tests/test_key.py ............                                                              [ 76%]
tests/test_light.py ...                                                                     [ 76%]
tests/test_metadata.py .                                                                    [ 76%]
tests/test_power.py ................................................                        [ 80%]
tests/test_psbt.py ......................................                                   [ 84%]
tests/test_qr.py .....                                                                      [ 85%]
tests/test_sd_card.py ....                                                                  [ 85%]
tests/test_settings.py ...................                                                  [ 87%]
tests/test_silent_payment.py ..                                                             [ 87%]
tests/test_touch.py .............................................                           [ 91%]
tests/test_wallet.py ..................................                                     [ 94%]
tests/touchscreens/test_cst816.py .......................                                   [ 96%]
tests/touchscreens/test_ft6x36.py ...........                                               [ 98%]
tests/touchscreens/test_gt911.py ...................                                        [ 99%]
tests/touchscreens/test_touchscreen.py ..                                                   [100%]

Had similar error on other branches. I think its a jupyter apple issue :) no error on your side i think.

also you need to fix transalations, lint and formatting. Maybe it's worth to re-open this PR on kapps

@qlrd
Copy link
Copy Markdown
Member

qlrd commented May 11, 2026

good suggestion, i think it makes more sense to create a proper video once we have the send support. this will help new users to get familiar with silent payment.

I was talking more on docs/**/*.md files side. But due to the context, is better on a follow-up.

@notTanveer
Copy link
Copy Markdown
Author

after thinking about it for a while, i think it makes more sense to add this once we have proper receive support with some coordinator integration in place.

right now i’m trying to shift my focus more towards implementing SP send support first.

@odudex
Copy link
Copy Markdown
Member

odudex commented May 11, 2026

after thinking about it for a while, i think it makes more sense to add this once we have proper receive support with some coordinator integration in place.

right now i’m trying to shift my focus more towards implementing SP send support first.

I agree.
I must build the whole infrastructure, with a coordinator and Embit to test everything.
The send part is where infrastructure is more mature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants