BIP352: Fix recipients typing in create_outputs to List[Dict[str, str]] #1961

pull Snezhkko wants to merge 2 commits into bitcoin:master from Snezhkko:chore/fix-create-outputs-recipients-typing changing 1 files +1 −1
  1. Snezhkko commented at 12:23 PM on September 8, 2025: contributor

    Update the recipients parameter in create_outputs from List[str] to List[Dict[str, str]]. This aligns the type annotation with actual usage in the code (recipient["address"], recipient["scan_pub_key"], recipient["spend_pub_key"]) and matches the structure provided by the test vectors. The previous annotation was misleading and could cause static type checkers and IDEs to surface incorrect diagnostics.

  2. BIP352: Fix recipients typing in create_outputs to List[Dict[str, str]] 48d704df7b
  3. murchandamus added the label Proposed BIP modification on Sep 10, 2025
  4. murchandamus added the label Pending acceptance on Sep 10, 2025
  5. in bip-0352/reference.py:119 in 48d704df7b
     115 | @@ -116,7 +116,7 @@ def decode_silent_payment_address(address: str, hrp: str = "tsp") -> Tuple[ECPub
     116 |      return B_scan, B_spend
     117 |  
     118 |  
     119 | -def create_outputs(input_priv_keys: List[Tuple[ECKey, bool]], outpoints: List[COutPoint], recipients: List[str], expected: Dict[str, any] = None, hrp="tsp") -> List[str]:
     120 | +def create_outputs(input_priv_keys: List[Tuple[ECKey, bool]], outpoints: List[COutPoint], recipients: List[Dict[str, str]], expected: Dict[str, any] = None, hrp="tsp") -> List[str]:
    


    jonatack commented at 9:46 PM on September 10, 2025:

    These objects are indeed List[Dict[str, str]]. An example when printing the recipients values:

    [{'address': 'sp1qqgste7k9hx0qftg6qmwlkqtwuy6cycyavzmzj85c6qdfhjdpdjtdgqaxww2fnhrx05cghth75n0qcj59e3e2anscr0q9wyknjxtxycg07y3pevyj',
      'scan_pub_key': '0220bcfac5b99e04ad1a06ddfb016ee13582609d60b6291e98d01a9bc9a16c96d4',
      'spend_pub_key': '03a6739499dc667d308baefea4de0c4a85cc72aece181bc05712d3919662610ff1'},
     {'address': 'sp1qqgste7k9hx0qftg6qmwlkqtwuy6cycyavzmzj85c6qdfhjdpdjtdgqaxww2fnhrx05cghth75n0qcj59e3e2anscr0q9wyknjxtxycg07y3pevyj',
      'scan_pub_key': '0220bcfac5b99e04ad1a06ddfb016ee13582609d60b6291e98d01a9bc9a16c96d4',
      'spend_pub_key': '03a6739499dc667d308baefea4de0c4a85cc72aece181bc05712d3919662610ff1'}]
    
  6. jonatack approved
  7. jonatack commented at 9:46 PM on September 10, 2025: member

    ACK 48d704df7be0f30aa2134b813b98049bd5866076

  8. murchandamus commented at 3:36 PM on November 10, 2025: member

    Looking for sign-off from authors: @josibake, @RubenSomsen

  9. murchandamus commented at 12:14 AM on February 28, 2026: member

    cc: @theStack

  10. edilmedeiros commented at 4:55 PM on May 7, 2026: none

    ACK 48d704df7be0f30aa2134b813b98049bd5866076

    I recently noticed this while preparing #2153, but not included in that PR in favor of this. Happy to rebase #2153 when/if this gets merged.

  11. jonatack commented at 2:17 AM on May 8, 2026: member

    re-ACK, thanks @edilmedeiros for reviewing. This is a straightforward fix; it doesn't change the code, only the hints for static type checkers, and I think it can move forward.

  12. jonatack removed the label Proposed BIP modification on May 8, 2026
  13. jonatack removed the label Pending acceptance on May 8, 2026
  14. jonatack added the label Bug fix on May 8, 2026
  15. Merge branch 'master' into chore/fix-create-outputs-recipients-typing 86d13edfd5
  16. jonatack commented at 3:09 AM on May 8, 2026: member

    Rebased and merged as https://github.com/bitcoin/bips/commit/c5c76f355a414278b354753ee7b763a49007653c. Thanks @Snezhkko for your patience. @edilmedeiros you can now git pull and rebase #2153 on it, if needed (edit: this doesn't appear to conflict).

  17. jonatack closed this on May 8, 2026


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bips. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-19 06:50 UTC