[RPC] Expand help text for importmulti changes #15122

pull jnewbery wants to merge 1 commits into bitcoin:master from jnewbery:pr14565_release_notes changing 1 files +4 −2
  1. jnewbery commented at 5:07 PM on January 7, 2019: member

    Expands the RPC help text for changes to the importmulti RPC method.

  2. jnewbery commented at 5:08 PM on January 7, 2019: member

    Requested here: #14565 (comment)

    cc @Sjors @instagibbs

  3. jnewbery added the label Docs on Jan 7, 2019
  4. jnewbery added the label Wallet on Jan 7, 2019
  5. in doc/release-notes.md:250 in 1c8e7a64ef outdated
     245 | +input data is validated before attempting to import the scripts and keys.
     246 | +
     247 | +Imported scripts/addresses are categorised by solvability and spendability:
     248 | +
     249 | +- A script is *solvable* if the the wallet can construct the txIn to spend outputs
     250 | +  to the script, but cannnot necessarily produce the required signatures for
    


    instagibbs commented at 5:18 PM on January 7, 2019:

    cannnot


    jnewbery commented at 7:20 PM on January 7, 2019:

    fixed

  6. in doc/release-notes.md:249 in 1c8e7a64ef outdated
     244 | +Error handling in the `importmulti` RPC method has been much improved. All
     245 | +input data is validated before attempting to import the scripts and keys.
     246 | +
     247 | +Imported scripts/addresses are categorised by solvability and spendability:
     248 | +
     249 | +- A script is *solvable* if the the wallet can construct the txIn to spend outputs
    


    instagibbs commented at 5:19 PM on January 7, 2019:

    Not sure txIn saves a lot of space versus readability?


    jnewbery commented at 7:20 PM on January 7, 2019:

    agree. Changed txIn -> transaction input.

  7. in doc/release-notes.md:252 in 1c8e7a64ef outdated
     247 | +Imported scripts/addresses are categorised by solvability and spendability:
     248 | +
     249 | +- A script is *solvable* if the the wallet can construct the txIn to spend outputs
     250 | +  to the script, but cannnot necessarily produce the required signatures for
     251 | +  that txIn.
     252 | +- A script is *spendable* if the wallet can construct the txIn to spend outputs
    


    instagibbs commented at 5:20 PM on January 7, 2019:

    suggested rephrase:

    A script is spendable if the wallet can construct the txIn to spend outputs with all required signatures or witness data.


    jnewbery commented at 7:21 PM on January 7, 2019:

    Changed.

  8. in doc/release-notes.md:263 in 1c8e7a64ef outdated
     258 | +  a P2SH script), witness script (for a P2WSH script) and private keys for all
     259 | +  the pubkeys and pubkey hashes must be provided.
     260 | +- for a script/address to be **solvable but not spendable** the redeem script
     261 | +  (for a P2SH script), witness script (for a P2WSH script) and public keys for
     262 | +  all the pubkey hashes must be provided. Additionally some (but not all) of
     263 | +  the private keys can be provided. The 'watchonly' flag should be set.
    


    instagibbs commented at 5:22 PM on January 7, 2019:

    should be set to avoid warnings*


    jnewbery commented at 7:21 PM on January 7, 2019:

    Yep. Fixed.

  9. jnewbery commented at 7:21 PM on January 7, 2019: member

    Thanks for the quick review @instagibbs . Pushed a fixup commit 6b55e629b22843ac53e8e37be4995a0dc3d6c0c1 to address your comments.

  10. jnewbery commented at 9:52 PM on January 7, 2019: member

    Spurious travis failure here: https://travis-ci.org/bitcoin/bitcoin/jobs/476515100

    Kicking travis.

  11. fanquake approved
  12. fanquake commented at 3:08 PM on January 8, 2019: member

    utACK 1c8e7a6

  13. laanwj commented at 3:18 PM on January 8, 2019: member

    utACK after squash

  14. jnewbery force-pushed on Jan 8, 2019
  15. jnewbery commented at 3:46 PM on January 8, 2019: member

    Squashed. @harding - do you mind taking a quick look?

  16. ryanofsky commented at 4:11 PM on January 8, 2019: member

    This would be great documentation to add to importmulti help, but it's a bad release note because it tells you almost nothing about how the new behavior is different than the old behavior, and it sounds like everything described is new when in reality most of it is unchanged, and most existing uses of importmulti should be unaffected.

    A better release note would be a simple bulleted list of changes like: #14565 (comment)

  17. jnewbery commented at 4:28 PM on January 8, 2019: member

    I agree that the release notes aren't necessarily the perfect place for this, but I also don't think the solvability/spendability definition should go in the importmulti help text, since those concepts are more widely applicable. I added these to the release notes because I think it's better to have them there than nowhere at all, but if you have a suggestion for improving how the docs are structured and a better place for his should live, I'd be very happy to make those changes.

  18. harding commented at 6:33 PM on January 8, 2019: contributor

    I'm mildly opposed to this approach. I would really like to see the existing bullet points kept, as they quickly describe the user-visible changes in the section where readers would expect to learn about those changes.

    If you then remove the corresponding changes from the new section, you have a section that describes the long-standing behavior of Bitcoin Core---which is not something that belongs in a new release note. And, while I agree that it's better to have documentation somewhere than nowhere, I don't think understanding this concept is important enough for most users of Bitcoin Core (who don't use it as a waching-only or multisig wallet) that we should subject them to learning about it in the release notes we want all users to read before upgrading.

    Although solvability and spendability are mostly wallet concepts, the only way the user can really interface with those concepts right now is through the RPC, so I think it would not be inappropriate to add that documentation to the RPC overview: https://github.com/bitcoin/bitcoin/blob/master/doc/JSON-RPC-interface.md If that is done, than a link can be added to the release notes pointing to that documentation (e.g. one of the getaddressinfo bullet points in the current release notes describes solvability; a link can be added to the end of it for "Learn more").

    As for the actual text, I'd suggest rearranging the first two bullet points so that you can describe the second in terms of differences from the first:

    • A script is spendable if the wallet can construct the transaction input to spend outputs to the script and produce all required signatures or witness data.

    • If you can do everything except produce the required signatures or witness data, then a script is solvable.

  19. ryanofsky commented at 6:47 PM on January 8, 2019: member

    Agree with @harding, but I actually don't know why users need to think about solvability and spendability in these terms unless they are importing external keys, so it seems ideal to me to have these definitions in the importmulti help text. But defining them in the JSON-RPC markdown documentation instead as suggested, or in another markdown file and then referencing them from the RPC help also seems fine.

  20. Sjors commented at 7:26 PM on January 9, 2019: member

    I like @harding's suggestion of moving the detailed explanation to the (painfully short) doc/JSON-RPC-interface.md. In addition to pointing to it from the release notes, the RPC help could also point to it (as we do with descriptors.md).

  21. in doc/release-notes.md:249 in 0d84719fe9 outdated
     244 | +Error handling in the `importmulti` RPC method has been much improved. All
     245 | +input data is validated before attempting to import the scripts and keys.
     246 | +
     247 | +Imported scripts/addresses are categorised by solvability and spendability:
     248 | +
     249 | +- A script is *solvable* if the the wallet can construct the transaction input
    


    practicalswift commented at 8:43 PM on January 9, 2019:

    Accidental repeating of "the" :-)

  22. jnewbery commented at 10:50 PM on January 9, 2019: member

    I don't think understanding this concept is important enough for most users of Bitcoin Core (who don't use it as a waching-only or multisig wallet) that we should subject them to learning about it in the release notes we want all users to read before upgrading.

    Yes, I think that's reasonable. I've changed this branch to only add text about the watchonly flag to the rpc help text.

    I think the information about solvability and spendability is useful, but I don't think it fits naturally in the JSON-RPC-interface.md doc. For now, I'm just including it in my own wallet design notes gist. If people think there's something there of wider use, then I can perhaps add a docs/wallet_design.md file to this repo.

    I'm very receptive to feedback on this. If people don't think the added text in the RPC help is useful, then I'm fine to close this PR (and apologise for the noise).

  23. harding commented at 1:51 PM on January 11, 2019: contributor

    @jnewbery

    I've changed this branch to only add text about the watchonly flag to the rpc help text.

    I think maybe you didn't push; I don't see that.

  24. jnewbery force-pushed on Jan 11, 2019
  25. jnewbery commented at 3:12 PM on January 11, 2019: member

    I think maybe you didn't push

    Oops. Sorry. Pushed!

  26. DrahtBot commented at 5:57 PM on January 11, 2019: member

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #14987 (RPCHelpMan: Pass through Result and Examples by MarcoFalke)
    • #14918 (RPCHelpMan: Check default values are given at compile-time by MarcoFalke)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  27. harding commented at 6:08 PM on January 11, 2019: contributor

    Partially tested ACK 319047318b1c06d286f7dfcd37262d1e2a10890d (looked at rendered help message; did not check modified warning message). Thanks!

  28. in src/wallet/rpcdump.cpp:1153 in 319047318b outdated
    1147 | @@ -1148,7 +1148,9 @@ UniValue importmulti(const JSONRPCRequest& mainRequest)
    1148 |      if (mainRequest.fHelp || mainRequest.params.size() < 1 || mainRequest.params.size() > 2)
    1149 |          throw std::runtime_error(
    1150 |              RPCHelpMan{"importmulti",
    1151 | -                "\nImport addresses/scripts (with private or public keys, redeem script (P2SH)), rescanning all addresses in one-shot-only (rescan can be disabled via options). Requires a new wallet backup.\n",
    1152 | +                "\nImport addresses/scripts (with private or public keys, redeem script (P2SH)), optionally rescanning the blockchain from the earliest creation time of the imported scripts. Requires a new wallet backup.\n"
    1153 | +                "If an address/script is imported without all of the private keys required to spend from that address, it will be watchonly. The 'watchonly' option must be set to True or a warning will be returned.\n"
    1154 | +                "Conversely, if all the private keys are provided and the address/script is spendable, the watchonly option must be set to False, or a warning will be returned.\n",
    


    promag commented at 2:41 PM on January 15, 2019:

    I think in this case it should fail instead of warn, and a separate PR should fix that. It's easy to call again with watchonly=false but it's not so easy to undo the import.


    jnewbery commented at 3:53 PM on January 15, 2019:

    That's a fair point, and was discussed in the original PR: #14565 (review).

    This PR simply updates the help text to better explain the current functionality. Any discussion of changes to that functionality should be in a separate PR/issue.

  29. jnewbery renamed this:
    [docs] Expand release notes for importmulti changes
    [RPC] Expand help text for importmulti changes
    on Jan 15, 2019
  30. in src/wallet/rpcdump.cpp:1152 in 319047318b outdated
    1147 | @@ -1148,7 +1148,9 @@ UniValue importmulti(const JSONRPCRequest& mainRequest)
    1148 |      if (mainRequest.fHelp || mainRequest.params.size() < 1 || mainRequest.params.size() > 2)
    1149 |          throw std::runtime_error(
    1150 |              RPCHelpMan{"importmulti",
    1151 | -                "\nImport addresses/scripts (with private or public keys, redeem script (P2SH)), rescanning all addresses in one-shot-only (rescan can be disabled via options). Requires a new wallet backup.\n",
    1152 | +                "\nImport addresses/scripts (with private or public keys, redeem script (P2SH)), optionally rescanning the blockchain from the earliest creation time of the imported scripts. Requires a new wallet backup.\n"
    1153 | +                "If an address/script is imported without all of the private keys required to spend from that address, it will be watchonly. The 'watchonly' option must be set to True or a warning will be returned.\n"
    


    ryanofsky commented at 4:47 PM on January 15, 2019:

    Would s/True/true in this case/ and s/False/false/. True and False are only capitalized in python, not javascript, and without qualifying True, the sentence doesn't sound connected to the previous text.


    ryanofsky commented at 5:00 PM on January 15, 2019:

    Maybe /spend from that address/spend it/


    jnewbery commented at 8:00 PM on January 15, 2019:

    fixed


    jnewbery commented at 8:00 PM on January 15, 2019:

    I think 'spend from that address' is more precise. Addresses aren't spent, UTXOs are.

  31. ryanofsky approved
  32. ryanofsky commented at 5:02 PM on January 15, 2019: member

    utACK 319047318b1c06d286f7dfcd37262d1e2a10890d

  33. jnewbery force-pushed on Jan 15, 2019
  34. jnewbery commented at 8:01 PM on January 15, 2019: member

    Addressed @ryanofsky's comments.

  35. in src/wallet/rpcdump.cpp:1152 in a79fcd667a outdated
    1147 | @@ -1148,7 +1148,9 @@ UniValue importmulti(const JSONRPCRequest& mainRequest)
    1148 |      if (mainRequest.fHelp || mainRequest.params.size() < 1 || mainRequest.params.size() > 2)
    1149 |          throw std::runtime_error(
    1150 |              RPCHelpMan{"importmulti",
    1151 | -                "\nImport addresses/scripts (with private or public keys, redeem script (P2SH)), rescanning all addresses in one-shot-only (rescan can be disabled via options). Requires a new wallet backup.\n",
    1152 | +                "\nImport addresses/scripts (with private or public keys, redeem script (P2SH)), optionally rescanning the blockchain from the earliest creation time of the imported scripts. Requires a new wallet backup.\n"
    1153 | +                "If an address/script is imported without all of the private keys required to spend from that address, it will be watchonly. The 'watchonly' option must be set to true or a warning will be returned.\n"
    


    ryanofsky commented at 9:39 PM on January 15, 2019:

    Again would say "must be set to true in this case"


    jnewbery commented at 10:23 PM on January 15, 2019:

    ah, sorry. Missed that last time.


    jnewbery commented at 10:25 PM on January 15, 2019:

    now fixed

  36. ryanofsky approved
  37. ryanofsky commented at 9:40 PM on January 15, 2019: member

    utACK a79fcd667a1d47c46864068d7a30ef58d1002b9d

  38. inkedup369 commented at 9:51 PM on January 15, 2019: none

    I'm so confused what happened

    On Tue, Jan 15, 2019, 10:56 John Newbery <notifications@github.com wrote:

    @jnewbery commented on this pull request.

    In src/wallet/rpcdump.cpp https://github.com/bitcoin/bitcoin/pull/15122#discussion_r247949302:

    @@ -1148,7 +1148,9 @@ UniValue importmulti(const JSONRPCRequest& mainRequest) if (mainRequest.fHelp || mainRequest.params.size() < 1 || mainRequest.params.size() > 2) throw std::runtime_error( RPCHelpMan{"importmulti",

    •            "\nImport addresses/scripts (with private or public keys, redeem script (P2SH)), rescanning all addresses in one-shot-only (rescan can be disabled via options). Requires a new wallet backup.\n",
    •            "\nImport addresses/scripts (with private or public keys, redeem script (P2SH)), optionally rescanning the blockchain from the earliest creation time of the imported scripts. Requires a new wallet backup.\n"
    •            "If an address/script is imported without all of the private keys required to spend from that address, it will be watchonly. The 'watchonly' option must be set to True or a warning will be returned.\n"
    •            "Conversely, if all the private keys are provided and the address/script is spendable, the watchonly option must be set to False, or a warning will be returned.\n",

    That's a fair point, and was discussed in the original PR: #14565 (comment) https://github.com/bitcoin/bitcoin/pull/14565#discussion_r238422419.

    This PR simply updates the help text to better explain the current functionality. Any discussion of changes to that functionality should be in a separate PR/issue.

    — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/bitcoin/bitcoin/pull/15122#discussion_r247949302, or mute the thread https://github.com/notifications/unsubscribe-auth/AsfTHlK65mIOE-Ajpxsz9fFxry6oNueJks5vDfoogaJpZM4Zz4f1 .

  39. [docs] Expand help text for importmulti changes b745e149c2
  40. jnewbery force-pushed on Jan 15, 2019
  41. laanwj merged this on Jan 16, 2019
  42. laanwj closed this on Jan 16, 2019

  43. laanwj referenced this in commit f71c2ea662 on Jan 16, 2019
  44. jnewbery deleted the branch on Jan 16, 2019
  45. inkedup369 commented at 7:14 PM on January 16, 2019: none

    Damn I'm sorry I dont know ow I copied the wrong mnemonic.. I'm completely lost now. I apologize if I made more work for any1 or caused issues

  46. jnewbery locked this on Jan 16, 2019

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-21 15:14 UTC

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