Add wallet backup text to import* and add* RPCs #11289

pull meshcollider wants to merge 2 commits into bitcoin:master from meshcollider:201709_add_help_text changing 2 files +10 −7
  1. meshcollider commented at 12:23 pm on September 8, 2017: contributor

    Closes #11243

    Adds “Requires a new wallet backup” text to addwitnessaddress, importprivkey, importmulti, importaddress, importpubkey, and addmultisigaddress. Also adds a warning to dumpwallet that backing up the seed alone is not sufficient to back up non-HD addresses

  2. fanquake added the label RPC/REST/ZMQ on Sep 8, 2017
  3. in src/wallet/rpcdump.cpp:65 in 979cc37440 outdated
    61@@ -62,7 +62,7 @@ std::string DecodeDumpString(const std::string &str) {
    62     for (unsigned int pos = 0; pos < str.length(); pos++) {
    63         unsigned char c = str[pos];
    64         if (c == '%' && pos+2 < str.length()) {
    65-            c = (((str[pos+1]>>6)*9+((str[pos+1]-'0')&15)) << 4) | 
    66+            c = (((str[pos+1]>>6)*9+((str[pos+1]-'0')&15)) << 4) |
    


    achow101 commented at 7:47 pm on September 8, 2017:
    Unrelated whitespace change.

    meshcollider commented at 9:08 pm on September 8, 2017:
    I mentioned that in the PR, is it an issue?

    achow101 commented at 9:20 pm on September 8, 2017:
    I isn’t really a problem, but you should try to avoid making such changes. Atom can be set to not make any whitespace changes at all.

    MarcoFalke commented at 2:34 am on September 10, 2017:
    It is a problem, as it often breaks backporting cherry-picks.

    meshcollider commented at 3:30 am on September 10, 2017:
    Fixed.
  4. in src/wallet/rpcdump.cpp:658 in 979cc37440 outdated
    643@@ -644,7 +644,7 @@ UniValue dumpwallet(const JSONRPCRequest& request)
    644     file << strprintf("#   mined on %s\n", EncodeDumpTime(chainActive.Tip()->GetBlockTime()));
    645     file << "\n";
    646 
    647-    // add the base58check encoded extended master if the wallet uses HD 
    648+    // add the base58check encoded extended master if the wallet uses HD
    


    achow101 commented at 7:47 pm on September 8, 2017:
    Unrelated whitespace change.
  5. achow101 commented at 7:47 pm on September 8, 2017: member
    Concept ACK
  6. MarcoFalke commented at 9:16 pm on September 9, 2017: member
    Mind to add to dumpwallet that just backing up the private masterkey is likely insufficient?
  7. meshcollider commented at 11:09 pm on September 9, 2017: contributor
    Done :+1:
  8. MarcoFalke added this to the milestone 0.15.1 on Sep 10, 2017
  9. MarcoFalke added the label Docs and Output on Sep 10, 2017
  10. MarcoFalke added the label Needs backport on Sep 10, 2017
  11. meshcollider commented at 6:24 am on September 11, 2017: contributor
    Rebased to fix .bitcoin directory travis failure
  12. achow101 commented at 3:39 pm on September 15, 2017: member
    utACK 288dfaea9d987399b92514121f98a674e74d5580
  13. in src/wallet/rpcdump.cpp:604 in 288dfaea9d outdated
    600@@ -601,6 +601,7 @@ UniValue dumpwallet(const JSONRPCRequest& request)
    601         throw std::runtime_error(
    602             "dumpwallet \"filename\"\n"
    603             "\nDumps all wallet keys in a human-readable format.\n"
    604+            "Note that if your wallet contains keys which are not derived from your HD seed (e.g. imported keys), these are not covered by only backing up the seed itself, and must be backed up too.\n"
    


    TheBlueMatt commented at 9:18 pm on September 21, 2017:
    This leaves me confused. The things I need to back up are in dumpwallet, just not the master key listed in dump wallet, right? So just the dumpwallet file is a sufficient backup (with rescan, including imported segwit addresses and p2sh redeemScripts?), but not only the master key?

    meshcollider commented at 2:27 am on September 30, 2017:
    I’ve changed it, lmk what you think now
  14. TheBlueMatt commented at 9:28 pm on September 21, 2017: member

    I suppose for completeness importwallet may need the (rather astoundingly obvious) “Requires a new backup” note.

    I guess we dont want to note anything about keypool topup leading to needing backups in things like “getnewaddress” (for non-HD wallets)? What about explicit ones like “keypoolrefill”? And things that always wipe keypool like encryptwallet? I guess probably not?

    Similarly, I suppose we dont care about listing things like move/sendfrom which change wallet fileds for F$#King accounts?

  15. in src/wallet/rpcdump.cpp:603 in 288dfaea9d outdated
    600@@ -601,6 +601,7 @@ UniValue dumpwallet(const JSONRPCRequest& request)
    601         throw std::runtime_error(
    602             "dumpwallet \"filename\"\n"
    603             "\nDumps all wallet keys in a human-readable format.\n"
    


    mess110 commented at 8:57 pm on September 27, 2017:
    @TheBlueMatt would changing this string to something like Dumps all wallet derived keys in a human-readable format. help cleanup the confusion?
  16. meshcollider commented at 2:44 am on September 30, 2017: contributor
    Rebased + hopefully clarified the text as per @TheBlueMatt comments
  17. TheBlueMatt commented at 7:57 pm on October 2, 2017: member
    Wait, now I’m even more confused. AFAICT, dumpwallet does dump all imported keys, not just “derived” keys, so no need to back those up. It does not, however, dump imported scripts, so witness addresses and multisig addresses will be missed, right?
  18. meshcollider commented at 9:52 pm on October 2, 2017: contributor
    That’s what I meant by (e.g. ensure you back up the whole dumpfile) (note that I didn’t follow the suggested edit by mess110 because it’s wrong, is that what you were looking at?). Are you suggesting mentioning that those imported scripts aren’t backed up, or?
  19. TheBlueMatt commented at 0:10 am on October 4, 2017: member
    Hmm, maybe I missed the parenthetical. Do we want to mention anything about the segwit addresses and imported scripts?
  20. meshcollider commented at 5:34 am on October 4, 2017: contributor
    The description does currently specifically refer to ‘keys’ not scripts or segwit addresses. But is there any reason scripts aren’t also dumped too?
  21. laanwj commented at 10:25 am on October 5, 2017: member

    The description does currently specifically refer to ‘keys’ not scripts or segwit addresses. But is there any reason scripts aren’t also dumped too?

    No. just that (AFAIK) no one implemented that yet. Ideally a dumpwallet would not lose any relevant information.

  22. TheBlueMatt commented at 9:31 pm on October 5, 2017: member
    I dont see why scripts shouldnt be dumped either. I’m not sure if its really in scope for this PR, but would be a welcome addition IMO.
  23. meshcollider commented at 9:43 pm on October 5, 2017: contributor
    @laanwj @TheBlueMatt I’ll look into it and try get a PR open for that soon too then
  24. meshcollider commented at 10:49 pm on October 13, 2017: contributor
    Rebased
  25. Add wallet backup text to import*, add* and dumpwallet RPCs a38bfbc51d
  26. in src/wallet/rpcdump.cpp:604 in a38bfbc51d outdated
    600@@ -601,6 +601,7 @@ UniValue dumpwallet(const JSONRPCRequest& request)
    601         throw std::runtime_error(
    602             "dumpwallet \"filename\"\n"
    603             "\nDumps all wallet keys in a human-readable format to a server-side file. This does not allow overwriting existing files.\n"
    604+            "Note that if your wallet contains keys which are not derived from your HD seed (e.g. imported keys), these are not covered by only backing up the seed itself, and must be backed up too (e.g. ensure you back up the whole dumpfile).\n"
    


    TheBlueMatt commented at 5:46 pm on October 17, 2017:
    Note that you may want to wrap this line.
  27. TheBlueMatt commented at 5:47 pm on October 17, 2017: member
    utACK a38bfbc51d0b98fffd8d79457f31c6fb196ff580. Would like to see the dumpwallet-includes-imported-scripts followup.
  28. Wrap dumpwallet warning and note scripts aren't dumped c098c58196
  29. meshcollider commented at 9:03 am on October 19, 2017: contributor
    I’ve wrapped the text, and added a note about scripts not being included, until I get the other PR up. Will remove that note in the other PR when it happens.
  30. in src/wallet/rpcwallet.cpp:1113 in c098c58196
    1109@@ -1110,7 +1110,7 @@ UniValue addmultisigaddress(const JSONRPCRequest& request)
    1110     if (request.fHelp || request.params.size() < 2 || request.params.size() > 3)
    1111     {
    1112         std::string msg = "addmultisigaddress nrequired [\"key\",...] ( \"account\" )\n"
    1113-            "\nAdd a nrequired-to-sign multisignature address to the wallet.\n"
    1114+            "\nAdd a nrequired-to-sign multisignature address to the wallet. Requires a new wallet backup.\n"
    


    JohnVonNeumann commented at 11:42 pm on November 7, 2017:

    “nrequired-to-sign multisignature”

    Only comment, I’m assuming this isn’t a typo, and is a reference to the number of required signatures needed for the multisig address?


    meshcollider commented at 0:03 am on November 8, 2017:
    Correct :) And note that that text is not changed in this PR, it was there before

    JohnVonNeumann commented at 0:09 am on November 8, 2017:
    Ok sweet, yeah I saw that it wasn’t a change from this commit, but wasn’t sure so figured I’d ask. Thanks! Is it typically frowned upon to comment on things not directly changed by the PR/Commit/Issue in question?

    meshcollider commented at 0:25 am on November 8, 2017:
    No, if something looks wrong then feel free to point it out :) I was just clarifying

    JohnVonNeumann commented at 1:17 am on November 8, 2017:
    Awesome, thanks again.
  31. laanwj merged this on Nov 8, 2017
  32. laanwj closed this on Nov 8, 2017

  33. laanwj referenced this in commit 77546a3182 on Nov 8, 2017
  34. MarcoFalke removed the label Needs backport on Nov 9, 2017
  35. MarcoFalke removed this from the milestone 0.15.2 on Nov 9, 2017
  36. MarcoFalke referenced this in commit 42ea47db42 on Nov 9, 2017
  37. MarcoFalke referenced this in commit 3f1db56bc1 on Nov 9, 2017
  38. laanwj referenced this in commit 711d16ca4a on Dec 21, 2017
  39. virtload referenced this in commit 6153cd6dc8 on Apr 4, 2018
  40. codablock referenced this in commit 799b047714 on Sep 26, 2019
  41. codablock referenced this in commit 617c886233 on Sep 30, 2019
  42. barrystyle referenced this in commit d22b26f664 on Jan 22, 2020
  43. PastaPastaPasta referenced this in commit 3832d7201d on Mar 23, 2020
  44. PastaPastaPasta referenced this in commit 48829094b5 on Mar 28, 2020
  45. PastaPastaPasta referenced this in commit cea5ee4125 on Mar 29, 2020
  46. PastaPastaPasta referenced this in commit 7b8095c2a9 on Mar 31, 2020
  47. UdjinM6 referenced this in commit e492322f12 on Mar 31, 2020
  48. PastaPastaPasta referenced this in commit 02ab2efe4a on Apr 1, 2020
  49. ckti referenced this in commit 8c8486e21b on Mar 28, 2021
  50. random-zebra referenced this in commit 2d50b6e3b9 on Jun 9, 2021
  51. gades referenced this in commit 8dd4f6f99b on Jun 30, 2021
  52. DrahtBot locked this on Sep 8, 2021

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: 2024-09-29 01:12 UTC

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