Expands the RPC help text for changes to the importmulti RPC method.
[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-
jnewbery commented at 5:07 PM on January 7, 2019: member
-
jnewbery commented at 5:08 PM on January 7, 2019: member
Requested here: #14565 (comment)
- jnewbery added the label Docs on Jan 7, 2019
- jnewbery added the label Wallet on Jan 7, 2019
-
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
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.
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.
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.
jnewbery commented at 7:21 PM on January 7, 2019: memberThanks for the quick review @instagibbs . Pushed a fixup commit 6b55e629b22843ac53e8e37be4995a0dc3d6c0c1 to address your comments.
jnewbery commented at 9:52 PM on January 7, 2019: memberSpurious travis failure here: https://travis-ci.org/bitcoin/bitcoin/jobs/476515100
Kicking travis.
fanquake approvedfanquake commented at 3:08 PM on January 8, 2019: memberutACK 1c8e7a6
laanwj commented at 3:18 PM on January 8, 2019: memberutACK after squash
jnewbery force-pushed on Jan 8, 2019ryanofsky commented at 4:11 PM on January 8, 2019: memberThis 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)
jnewbery commented at 4:28 PM on January 8, 2019: memberI 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.
harding commented at 6:33 PM on January 8, 2019: contributorI'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.
ryanofsky commented at 6:47 PM on January 8, 2019: memberAgree 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
importmultihelp 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.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" :-)
jnewbery commented at 10:50 PM on January 9, 2019: memberI 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
watchonlyflag 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).
jnewbery force-pushed on Jan 11, 2019jnewbery commented at 3:12 PM on January 11, 2019: memberI think maybe you didn't push
Oops. Sorry. Pushed!
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.
harding commented at 6:08 PM on January 11, 2019: contributorPartially tested ACK 319047318b1c06d286f7dfcd37262d1e2a10890d (looked at rendered help message; did not check modified warning message). Thanks!
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=falsebut 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.
jnewbery renamed this:[docs] Expand release notes for importmulti changes
[RPC] Expand help text for importmulti changes
on Jan 15, 2019in 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.
ryanofsky approvedryanofsky commented at 5:02 PM on January 15, 2019: memberutACK 319047318b1c06d286f7dfcd37262d1e2a10890d
jnewbery force-pushed on Jan 15, 2019jnewbery commented at 8:01 PM on January 15, 2019: memberAddressed @ryanofsky's comments.
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
ryanofsky approvedryanofsky commented at 9:40 PM on January 15, 2019: memberutACK a79fcd667a1d47c46864068d7a30ef58d1002b9d
inkedup369 commented at 9:51 PM on January 15, 2019: noneI'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 .
[docs] Expand help text for importmulti changes b745e149c2jnewbery force-pushed on Jan 15, 2019laanwj merged this on Jan 16, 2019laanwj closed this on Jan 16, 2019laanwj referenced this in commit f71c2ea662 on Jan 16, 2019jnewbery deleted the branch on Jan 16, 2019inkedup369 commented at 7:14 PM on January 16, 2019: noneDamn 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
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