{"id":3129,"date":"2022-08-15T13:51:29","date_gmt":"2022-08-15T04:51:29","guid":{"rendered":"https:\/\/blog.wsd.sh\/?p=3129"},"modified":"2022-08-22T22:08:14","modified_gmt":"2022-08-22T13:08:14","slug":"3129","status":"publish","type":"post","link":"https:\/\/blog.wsd.sh\/?p=3129","title":{"rendered":"<small>bitcoin-core: dumpprivkey, dumpwallet    <\/small>"},"content":{"rendered":"<p>1. Set rpcAuth to bobAuth<\/p>\n<pre>\r\n$ export bobAuth='bob:87fb0fbdd610473af0f18666f60c0311$7aac966ea1ef5a0f6b547dc7af4408ad8d262fc0a1c8c34924f653e19a64e789'\r\n$ echo $bobAuth\r\nbob:87fb0fbdd610473af0f18666f60c0311$7aac966ea1ef5a0f6b547dc7af4408ad8d262fc0a1c8c34924f653e19a64e789\r\n<\/pre>\n<p>2. getnetworkinfo<br \/>\n&#8211; &#8220;version&#8221;:230000<\/p>\n<pre>\r\n$ curl -u \"${bobAuth}\" --data-binary '{\"jsonrpc\": \"1.0\", \"id\": \"curltest\", \"method\": \"getnetworkinfo\", \"params\": []}' -H 'content-type: te\r\nxt\/plain;' http:\/\/127.0.0.1:10002\/\r\n{\"result\":{\"version\":230000,\"subversion\":\"\/Satoshi:23.0.0\/\",\"protocolversion\":70016,\"localservices\":\"0000000000000409\",\"localservicesnames\":[\"NETWORK\",\"WITNESS\",\"NETWORK_LIMITED\"],\"localrelay\":true,\"timeoffset\":0,\"networkactive\":true,\"connections\":1,\"connections_in\":0,\"connections_out\":1,\"networks\":[{\"name\":\"ipv4\",\"limited\":false,\"reachable\":true,\"proxy\":\"\",\"proxy_randomize_credentials\":false},{\"name\":\"ipv6\",\"limited\":false,\"reachable\":true,\"proxy\":\"\",\"proxy_randomize_credentials\":false},{\"name\":\"onion\",\"limited\":true,\"reachable\":false,\"proxy\":\"\",\"proxy_randomize_credentials\":false},{\"name\":\"i2p\",\"limited\":true,\"reachable\":false,\"proxy\":\"\",\"proxy_randomize_credentials\":false},{\"name\":\"cjdns\",\"limited\":true,\"reachable\":false,\"proxy\":\"\",\"proxy_randomize_credentials\":false}],\"relayfee\":0.00001000,\"incrementalfee\":0.00001000,\"localaddresses\":[],\"warnings\":\"\"},\"error\":null,\"id\":\"curltest\"}\r\n<\/pre>\n<p>3. getbalance<br \/>\n&#8211; &#8220;result&#8221;:1.09224200<\/p>\n<pre>\r\n$ curl -u \"${bobAuth}\" --data-binary '{\"jsonrpc\": \"1.0\", \"id\": \"curltest\", \"method\": \"getbalance\", \"params\": []}' -H 'content-type: text\/plain;' http:\/\/127.0.0.1:10002\/\r\n{\"result\":1.09224200,\"error\":null,\"id\":\"curltest\"}\r\n<\/pre>\n<p>4. dumpprivkey<br \/>\n&#8211; &#8220;result&#8221;:null<br \/>\n&#8211; &#8220;message&#8221;:&#8221;This type of wallet does not support this command&#8221;<\/p>\n<pre>\r\n$ curl -u \"${bobAuth}\" --data-binary '{\"jsonrpc\": \"1.0\", \"id\": \"curltest\", \"method\": \"dumpprivkey\", \"params\": [\"bcrt1qj8mle4z5vw4pkx3mvjn9kkvqmrap55yd6gj4hk\"]}' -H 'content-type: text\/plain;' http:\/\/127.0.0.1:10002\/\r\n{\"result\":null,\"error\":{\"code\":-4,\"message\":\"This type of wallet does not support this command\"},\"id\":\"curltest\"}\r\n<\/pre>\n<p>5. dumpwallet<br \/>\n&#8211; &#8220;result&#8221;:null<br \/>\n&#8211; &#8220;message&#8221;:&#8221;This type of wallet does not support this command&#8221;<\/p>\n<pre>\r\n$ curl -u \"${bobAuth}\" --data-binary '{\"jsonrpc\": \"1.0\", \"id\": \"curltest\", \"method\": \"dumpwallet\", \"params\": [\"\/home\/user02\/dev\/bob\/bitc\r\noin.conf\"]}' -H 'content-type: text\/plain;' http:\/\/127.0.0.1:10002\/\r\n{\"result\":null,\"error\":{\"code\":-4,\"message\":\"This type of wallet does not support this command\"},\"id\":\"curltest\"}\r\n<\/pre>\n<p>6.<br \/>\nhttps:\/\/bitcointalk.org\/index.php?topic=5351210.0<\/p>\n<pre>\r\nAs Legacy Wallets and Descriptor Wallets use different mechanisms for storing and importing scripts and keys the existing import RPCs have been disabled for descriptor wallets. New export RPCs for Descriptor Wallets have not yet been added.\r\n\r\nThe following RPCs are disabled for Descriptor Wallets:\r\n\r\n- importprivkey\r\n- importpubkey\r\n- importaddress\r\n- importwallet\r\n- dumpprivkey\r\n- dumpwallet\r\n- importmulti\r\n- addmultisigaddress\r\n- sethdseed\r\n<\/pre>\n<p>7.methods.js<\/p>\n<pre>\r\n$ grep list bitcoin-core\/src\/methods.js\r\n  listAccounts: {\r\n  listAddressGroupings: {\r\n  listBanned: {\r\n  listLabels: {\r\n  listLockUnspent: {\r\n  listReceivedByAccount: {\r\n  listReceivedByAddress: {\r\n  listReceivedByLabel: {\r\n  listSinceBlock: {\r\n  listTransactions: {\r\n  listUnspent: {\r\n  listWalletDir: {\r\n  listWallets: {\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>1. Set rpcAuth to bobAuth $ export bobAuth=&#8217;bob:87fb0fbdd610473af0f18666f60c0311$7aac966ea1ef5a0f6b547dc7af440&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=\/wp\/v2\/posts\/3129"}],"collection":[{"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3129"}],"version-history":[{"count":11,"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=\/wp\/v2\/posts\/3129\/revisions"}],"predecessor-version":[{"id":3131,"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=\/wp\/v2\/posts\/3129\/revisions\/3131"}],"wp:attachment":[{"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3129"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3129"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.wsd.sh\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3129"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}