rpcconsole: display signet challenge #896

pull RandyMcMillan wants to merge 1 commits into bitcoin-core:master from bitcoincore-dev:pr/1919/916101/674094/b4aa9f5f7b1/eb918d0c31d-rpcconsole-signet-challenge changing 3 files +96 −1
  1. RandyMcMillan commented at 12:13 AM on September 24, 2025: contributor

    Motivation:

    This pull request aims to enhance the RPC console by displaying the signet challenge, providing users with crucial network configuration information directly within the console. This improves usability and clarity, especially for users interacting with custom signet networks.

    Use Cases:

    1. Verifying Signet Configuration: Users can quickly verify the active signet challenge when connecting to a custom signet, ensuring they are on the intended network.

    2. Improved User Experience: For developers and advanced users working with multiple signet environments, having the challenge readily visible in the RPC console reduces the need to look up configuration details elsewhere.

  2. DrahtBot commented at 12:13 AM on September 24, 2025: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    No conflicts as of last run.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  3. RandyMcMillan commented at 12:15 AM on September 24, 2025: contributor

    display an elided signet challenge

    <img width="799" height="669" alt="Screenshot 2025-09-23 at 6 51 46 PM" src="https://github.com/user-attachments/assets/49c0d622-1e4c-4c8a-ba28-158e22c78476" />

  4. hebasto commented at 10:27 AM on September 25, 2025: member

    cc @Sjors

  5. in src/qt/rpcconsole.cpp:744 in 6d15f90d04
     739 | +            std::string challengeString = challengeToString(vChallenge);
     740 | +            std::string challenge_start = challengeString.substr(0, 8);
     741 | +            std::string challenge_end = challengeString.substr(challengeString.length() - 8);
     742 | +
     743 | +            ui->networkName->setText(
     744 | +                tr("Signet: (%1...%2)").arg(
    


    luke-jr commented at 10:42 AM on September 25, 2025:

    Might be a better way to elide the middle so that a copy/paste gets the full string?


    RandyMcMillan commented at 8:42 PM on September 25, 2025:

    Testing a proper Qt interface for better formatting now.

  6. in src/util/strencodings.cpp:386 in 357f7d423a outdated
     382 | @@ -383,6 +383,25 @@ std::string Capitalize(std::string str)
     383 |      return str;
     384 |  }
     385 |  
     386 | +std::string ChallengeToStdString(const std::vector<uint8_t>& v)
    


    RandyMcMillan commented at 8:49 PM on September 25, 2025:

    move ChallengeToStdString to src/util/strencodings.cpp for later availability in main window.

  7. in src/qt/rpcconsole.cpp:615 in a87484caef outdated
     611 | @@ -612,22 +612,6 @@ bool RPCConsole::eventFilter(QObject* obj, QEvent *event)
     612 |      return QWidget::eventFilter(obj, event);
     613 |  }
     614 |  
     615 | -std::string RPCConsole::challengeToString(const std::vector<uint8_t>& v)
    


    RandyMcMillan commented at 8:50 PM on September 25, 2025:

    removed std::string RPCConsole::challengeToString(const std::vector<uint8_t>& v)


    RandyMcMillan commented at 11:46 PM on September 25, 2025:

    squash later

  8. RandyMcMillan commented at 8:51 PM on September 25, 2025: contributor

    added "trivial challenge" support per signet implementation.

    <img width="1062" height="613" alt="Screenshot 2025-09-25 at 4 47 29 PM" src="https://github.com/user-attachments/assets/d09860cf-2578-4b55-95f2-7a8f948909d6" />

  9. RandyMcMillan commented at 8:54 PM on September 25, 2025: contributor

    handle long challenges with proper elision and text flow.

    <img width="1062" height="597" alt="Screenshot 2025-09-25 at 4 24 29 PM" src="https://github.com/user-attachments/assets/0f1d7b97-77c9-48f6-ae43-7b72e7fd8084" />

  10. RandyMcMillan commented at 8:55 PM on September 25, 2025: contributor

    common length challenges elide and flow correctly. <img width="1078" height="673" alt="Screenshot 2025-09-25 at 4 25 50 PM" src="https://github.com/user-attachments/assets/f76d9839-ae13-4f70-aeea-0a268ecfad19" />

  11. pablomartin4btc commented at 9:13 PM on September 25, 2025: contributor

    It would be good to put the label "challenge:" in both the info tab and the title, and also differentiate between the default challenge and the custom one (specified by -signetchallenge=). With this in mind perhaps when there's no custom challenge specified we don't update the window title but only the info tab ("Name: Signet (challenge: 512103ad...e6c452ae, default)" or something like that).

    For the conversion you can use HexStr() instead of ChallengeToStdString().

  12. RandyMcMillan commented at 9:17 PM on September 25, 2025: contributor

    It would be good to put the label "challenge:" in both the info tab and the title, and also differentiate between the default challenge and the custom one (specified by -signet_challenge). With this in mind perhaps when there's no custom challenge specified we don't update the window title but only the info tab ("Name: Signet (challenge: 512103ad...e6c452ae, default)" or something like that).

    For the conversion you can use HexStr() instead of ChallengeToStdString().

    i was thinking a long the same lines.

    I will test against https://github.com/bitcoin/bitcoin/pull/29838

    and make a decision - trying to avoid a conflict. :)

  13. RandyMcMillan commented at 9:21 PM on September 25, 2025: contributor

    also trying to treat the challenge as a fingerprint - avoiding clutter in the title but the rcpconsole formatting ought to look ok.

  14. RandyMcMillan force-pushed on Sep 25, 2025
  15. RandyMcMillan commented at 11:36 PM on September 25, 2025: contributor

    fixed typo and commit scope add Network Name with Challenge on new line per @pablomartin4btc feed back Challenge Copy&Paste-able from gui per @luke-jr feed back Detect Default signet_challenge and display "Default" Removed parenthesis in rpcconsole panel, keep in title

  16. RandyMcMillan commented at 11:37 PM on September 25, 2025: contributor

    tooltip displays challenge (even if obfuscated in rpcconsole) <img width="970" height="690" alt="Screenshot 2025-09-25 at 7 25 34 PM" src="https://github.com/user-attachments/assets/a2a12f56-8468-4373-bfdd-40c2b5ae909d" />

  17. RandyMcMillan commented at 11:38 PM on September 25, 2025: contributor

    when default signet_challenge detected: <img width="1376" height="623" alt="Screenshot 2025-09-25 at 7 23 29 PM" src="https://github.com/user-attachments/assets/d2a0cd88-5585-4762-a028-d61980b72a20" />

  18. RandyMcMillan commented at 11:39 PM on September 25, 2025: contributor

    when common length signet_challenge:

    <img width="1396" height="566" alt="Screenshot 2025-09-25 at 7 22 52 PM" src="https://github.com/user-attachments/assets/866e0fe5-de31-4a80-815b-e3281272c4bf" />

  19. in src/qt/rpcconsole.h:87 in cf15f7cc3c outdated
      83 | @@ -84,7 +84,6 @@ class RPCConsole: public QWidget
      84 |      virtual bool eventFilter(QObject* obj, QEvent *event) override;
      85 |      void keyPressEvent(QKeyEvent *) override;
      86 |      void changeEvent(QEvent* e) override;
      87 | -    std::string challengeToString(const std::vector<uint8_t>& v);
    


    RandyMcMillan commented at 11:46 PM on September 25, 2025:

    squash later

  20. in src/qt/rpcconsole.cpp:61 in 5f06fbbcb2 outdated
      56 | @@ -57,6 +57,9 @@ const int INITIAL_TRAFFIC_GRAPH_MINS = 30;
      57 |  const QSize FONT_RANGE(4, 40);
      58 |  const char fontSizeSettingsKey[] = "consoleFontSize";
      59 |  
      60 | +const std::string DEFAULT_CHALLENGE_STRING =
      61 | +    "512103AD5E0EDAD18CB1F0FC0D28A3D4F1F3E445640337489ABB10404F2D1E086BE430210359EF5021964FE22D6F8E05B2463C9540CE96883FE3B278760F048F5189F2E6C452AE";
    


    RandyMcMillan commented at 11:48 PM on September 25, 2025:

    maybe a global constant?

  21. in src/qt/rpcconsole.h:239 in 5f06fbbcb2 outdated
     234 | +        QLabel::resizeEvent(event);
     235 | +        recalculateElidedText();
     236 | +    }
     237 | +
     238 | +    // Provide the full challenge when Copy&Paste
     239 | +    QMimeData* createMimeDataFromSelection() const {
    


    RandyMcMillan commented at 11:56 PM on September 25, 2025:

    the full challenge should be copy and pasted - please test cc: @luke-jr @pablomartin4btc

  22. RandyMcMillan force-pushed on Sep 26, 2025
  23. RandyMcMillan force-pushed on Sep 26, 2025
  24. RandyMcMillan commented at 4:13 PM on September 26, 2025: contributor

    use HexStr() per pablomartin4btc suggestion use lower case DEFAULT_CHALLENGE_STRING for comparison

  25. RandyMcMillan force-pushed on Sep 26, 2025
  26. RandyMcMillan force-pushed on Sep 27, 2025
  27. RandyMcMillan force-pushed on Sep 28, 2025
  28. RandyMcMillan commented at 4:09 PM on September 28, 2025: contributor

    rebase on top of gui/master

    temporarily cherry-pick PR https://github.com/bitcoin/bitcoin/pull/33480 to fix an issue.

  29. DrahtBot added the label Needs rebase on Oct 15, 2025
  30. rpcconsole:display signet_challenge db1c4089f0
  31. RandyMcMillan force-pushed on Nov 11, 2025
  32. RandyMcMillan requested review from pablomartin4btc on Nov 11, 2025
  33. RandyMcMillan requested review from luke-jr on Nov 11, 2025
  34. DrahtBot removed the label Needs rebase on Nov 11, 2025
  35. hebasto commented at 11:30 PM on November 18, 2025: member

    @RandyMcMillan

    The PR description is currently empty. Could you please add the motivation for this change, along with a few example use cases?

  36. ekzyis commented at 2:04 PM on April 9, 2026: none

    i was thinking a long the same lines.

    I will test against bitcoin/bitcoin#29838

    and make a decision - trying to avoid a conflict. :)

    https://github.com/bitcoin/bitcoin/pull/34566 has replaced https://github.com/bitcoin/bitcoin/pull/29838. It uses the magic bytes as the suffix now, as suggested multiple times (here, here, here). I see you gave a thumbs-up to one of them, so I think this is also in your interests, rather than this possibly being a problem here?

  37. RandyMcMillan commented at 2:30 PM on April 9, 2026: contributor

    thanks - i will revisit this PR soon - great work on your PR


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/gui. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-27 21:20 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me