wallet, rpc: Return normalized descriptor in parent_descs #32594

pull achow101 wants to merge 3 commits into bitcoin:master from achow101:getaddrinfo-normalized-parent changing 2 files +83 −19
  1. achow101 commented at 9:18 pm on May 22, 2025: member

    Instead of prividing the descriptor string as stored in the db, use the normalized descriptor as is done for getaddressinfo’s parent_desc field.

    Split from #32489

  2. DrahtBot commented at 9:18 pm on May 22, 2025: contributor

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

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32594.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK janb84
    Concept ACK Sjors

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  3. achow101 renamed this:
    Getaddrinfo normalized parent
    wallet, rpc: Return normalized descriptor in parent_descs
    on May 22, 2025
  4. Sjors commented at 10:31 am on May 23, 2025: member

    Concept ACK

    In general normalized descriptors are more useful, because you can’t derive addresses from e.g. xpub/1h/*. So it makes sense to use them for the parent.

    ACK 107517ea7d29d959e7a0b94d8217dcb894680547

    I checked that the tests fail if I revert the first commit.

    nit: “prividing” -> “providing”

  5. janb84 commented at 12:34 pm on May 23, 2025: contributor

    ACK 107517ea7d29d959e7a0b94d8217dcb894680547

    Before change listtransactions (and others) shows un-normalized descriptors, after the descriptors are normalized

     0 {
     1    "address": "bcrt1qgymj02gx6dzrkh49d9sj0cj8rxfcrut7dyxz7r",
     2    "parent_descs": [
     3      "wpkh(tpubD6NzVbkrYhZ4YdzwuYwQLEypddJ64KVEG9tyZibLxLKMxyMCaru1c7RFX2S8NEQ7dZuNccdzk5qikw51rxzXYWdkeuREgxgdqbJy3ty68qy/84h/1h/0h/0/*)#tz7s9af2"
     4    ],
     5    "category": "immature",
     6    "amount": 50.00000000,
     7    "label": "",
     8    "vout": 0,
     9    "abandoned": false,
    10    "confirmations": 1,
    11    "generated": true,
    12  [...]
    

    this commit:

     0    "address": "bcrt1qgwme02jk087aessn9tht9yjkawdxys3xm36cy8",
     1    "parent_descs": [
     2      "wpkh([83869ebd/84h/1h/0h]tpubDCS1CwM385BY77ffiamcKJ4CnZc2G15YxGXeisvNhkYzocxNcSjLrPZL8KaMtYLXSCo9ng7XRrX7q7Yn7oh2652QU79ybjh4YoY7m5zZxgN/0/*)#ettrwdmf"
     3    ],
     4    "category": "immature",
     5    "amount": 50.00000000,
     6    "label": "",
     7    "vout": 0,
     8    "abandoned": false,
     9    "confirmations": 1,
    10    "generated": true,
    11    [...]
    
  6. DrahtBot requested review from Sjors on May 23, 2025
  7. wallet, rpc: Push the normalized parent descriptor
    Instead of providing the descriptor string as stored in the db, use the
    normalized descriptor as is done for getaddressinfo's parent_desc field.
    2bdc5aeef0
  8. test: Enable default wallet for wallet_descriptor.py 039a09dee1
  9. test: Verify parent_desc in RPCs
    getaddressinfo, listunspent, listtransactions, listsinceblock, and
    gettransaction all include parent_desc(s). Make sure that these are
    consistent with each other, as well as being in normalized form.
    a759a22d59
  10. achow101 commented at 6:26 pm on May 23, 2025: member

    nit: “prividing” -> “providing”

    Fixed

  11. achow101 force-pushed on May 23, 2025
  12. janb84 commented at 9:41 pm on May 23, 2025: contributor

    re ACK a759a22d59e805834d077a28c95695e4834983a9

    Changes since last ACK:

    • small typo change in commit

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-05-25 18:12 UTC

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