doc: add tr() descriptor example to deriveaddresses #26558

pull FractalEncrypt wants to merge 1 commits into bitcoin:master from FractalEncrypt:FractalEncrypt changing 1 files +5 −4
  1. FractalEncrypt commented at 2:14 PM on November 23, 2022: none

    This simple PR adds a missing tr() descriptor example to the help deriveaddresses examples.

    • The functionality added in #24043 is a significant departure from legacy multisig address creation, yet there is no corresponding tr() descriptor example in the help.
    • Having this example in combination with the examples in the descriptors documentation will be helpful to users.

    I needed this information to correctly create a tr multisig address but was unable. I had to leave the software and use a 3rd party site to ask two separate questions (1, 2) to create an address using the new functionality.

    Note: This specific example is not provided in the descriptors.md documentation, though there is a similar example with sortedmulti_a.

  2. DrahtBot commented at 2:14 PM on November 23, 2022: 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.

    Type Reviewers
    ACK instagibbs, kouloumos, w0xlt
  3. DrahtBot added the label Docs on Nov 23, 2022
  4. doc: add tr() descriptor example to deriveaddresses
    add a tr() descriptor example to the help deriveaddresses examples
    92a4ed05d1
  5. in src/rpc/output_script.cpp:229 in 63f76d6976 outdated
     228 | -         "    raw(<hex script>)                    Outputs whose scriptPubKey equals the specified hex scripts\n"
     229 | +         "    pkh(<pubkey>)                                 P2PKH outputs for the given pubkey\n"
     230 | +         "    wpkh(<pubkey>)                                Native segwit P2PKH outputs for the given pubkey\n"
     231 | +         "    sh(multi(<n>,<pubkey>,<pubkey>,...))          P2SH-multisig outputs for the given threshold and pubkeys\n"
     232 | +         "    raw(<hex script>)                             Outputs whose scriptPubKey equals the specified hex scripts\n"
     233 | +         "    tr(KI,multi_a(<n>,<pubkey>,<pubkey>,...))     P2TR-multisig outputs for the given threshold and pubkeys\n"
    


    instagibbs commented at 2:21 PM on November 23, 2022:

    why not <pubkey> instead of KI? I think it's more confusing trying to explain everything vs giving a hint then pointing the user to the doc.


    FractalEncrypt commented at 3:05 PM on November 23, 2022:

    Thanks! I'm not clear on your question though.

    When you say "why not instead of KI"? Instead of what?


    instagibbs commented at 3:06 PM on November 23, 2022:

    oh github ate the term: <pubkey>


    FractalEncrypt commented at 3:13 PM on November 23, 2022:

    I agree this would be cleaner. I will make the change.


    FractalEncrypt commented at 3:59 PM on November 23, 2022:

    Thanks, I've updated the commit to address your review comments. Most appreciated.

  6. FractalEncrypt force-pushed on Nov 23, 2022
  7. instagibbs commented at 4:02 PM on November 23, 2022: member

    ACK 92a4ed05d1036b45e8274d8bbadfd59b3d487365

  8. fanquake commented at 5:28 PM on November 23, 2022: member

    Also seems like a worthwhile backport to 24.x.

  9. kouloumos commented at 5:59 PM on November 23, 2022: contributor

    ACK 92a4ed05d1036b45e8274d8bbadfd59b3d487365 Verified that the help text is displayed correctly and that the RPC actually accepts this kind of output descriptor.

    It's worth noting that from the RPCs (as mentioned in descriptors.md) that accept an output descriptor as input, only this one and scantxoutset display specific examples as part of the help text. If the length of the help text is not consider a usability issue it might worth displaying those examples in all of them.

  10. w0xlt approved
  11. fanquake merged this on Nov 25, 2022
  12. fanquake closed this on Nov 25, 2022

  13. FractalEncrypt deleted the branch on Nov 25, 2022
  14. sidhujag referenced this in commit 5935c81a28 on Nov 25, 2022
  15. bitcoin locked this on Nov 25, 2023

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: 2026-04-22 18:13 UTC

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