synonymdev / bitkit

Self-custodial Bitcoin and Lightning Wallet for Android and iOS.
https://bitkit.to
MIT License
116 stars 22 forks source link

[Bug]: Bitkit misses address indexes when switching networks #780

Closed limpbrains closed 1 year ago

limpbrains commented 1 year ago

Describe the bug

After switching wallet network addresses at one or more indexes are missing. Unused address indexes are skipped when generating addresses when switching networks.

Reproduce

  1. Create new wallet
  2. Switch to regtest
  3. Check Redux store wallet -> wallets -> wallet0 -> addresses -> bitcoinRegtest -> p2wpkh

Addresses should start from index 0, but they starts with 1:

1a42c8f5e92577267cc1595c53d5f476f4b32a8f9d0f391cfc0e4a5b689851d4: {
    address: "bcrt1qxsvz97cp99ll3d3p55nfvs4ynwf2vuzw5wudcy"
    index: 2
    path: "m/84'/0'/0'/0/2"
    publicKey: "03a8f6bb568e2ac4135d0f7501e664625c0988983a632c3503f0e28ce4bfc957dd"
    scriptHash: "1a42c8f5e92577267cc1595c53d5f476f4b32a8f9d0f391cfc0e4a5b689851d4"
},
222088841d13b644374c36420a27bd2bee613c97f43c725618c55a65116cb696: {
    address: "bcrt1q389nnnnua2q9d8h48asn5fvkugumk3dh74vthn"
    index: 4
    path: "m/84'/0'/0'/0/4"
    publicKey: "02432d476301b983e7096c5cf481706722c8d146f305c648375e44fae0260a6fe0"
    scriptHash: "222088841d13b644374c36420a27bd2bee613c97f43c725618c55a65116cb696"
},
a517806b70620a720fe571e3449176092876e6575a3b54d9fc01223db533fbbb: {
    address: "bcrt1qg7hrrg0swlh6mepm7r6cjy6gkr3zr9pwtcxekd"
    index: 1
    path: "m/84'/0'/0'/0/1"
    publicKey: "025d38a2e7f02a7448072bf34e53b28e78c23f48c56f322d398e5b48ac97a57552"
    scriptHash: "a517806b70620a720fe571e3449176092876e6575a3b54d9fc01223db533fbbb"
},
bc9e5d449d70377b350ec2cb45228bb22d91f04516cddce8c0db57c248e9743c: {
    address: "bcrt1q5cmptwr4gh0d78uqv8v06tr3w5suuv2y44a9v6"
    index: 5
    path: "m/84'/0'/0'/0/5"
    publicKey: "0216503106f7f0efe34569548f387cd07d9726dc654eb333925b7ed4883623c809"
    scriptHash: "bc9e5d449d70377b350ec2cb45228bb22d91f04516cddce8c0db57c248e9743c"
},
ca28648ab53e145c9835504c974293ceea4257fd1d7da93b2fdad66dcc3448d8: {
    address: "bcrt1qvd47eknexlkgrumgzuvad893qy0elj8257wqq9"
    index: 3
    path: "m/84'/0'/0'/0/3"
    publicKey: "03d1c3dd66f91343f255b7d0c5cc54fed0e0497c3ed9853eccef7c187658741d1b"
    scriptHash: "ca28648ab53e145c9835504c974293ceea4257fd1d7da93b2fdad66dcc3448d8"
}

Screenshots / Recording

No response

Operating system

iOS

Bitkit version

No response

Log output

No response

pwltr commented 1 year ago

I can reproduce this in very rare cases but also for mainnet addresses. Steps to reproduce were Wipe App -> Create new wallet (optionally switch to Regtest to create another set of addresses).

Here is an example case where wallets.wallet0.addresses.bitcoin.p2pkh does not start with index 0 (only relevant redux state):

{
  "wallet": {
    "wallets": {
      "wallet0": {
        "addressIndex": {
          "bitcoinRegtest": {
            "p2pkh": {
              "address": "mkqfzvUcnZAWSgXq9XovGA7MRFwQUSE41t",
              "scriptHash": "ba32eed6ff91b8acf35a3ab2fc6f1d392b04e3da24c13bbc7148698da57c1da9",
              "publicKey": "037fc2e2fb7a221777b3ea6a71dab2a46cee1feb7c2c7719a90ede95cb49efdbf3",
              "index": 1,
              "path": "m/44'/0'/0'/0/1"
            },
            "p2sh": {
              "address": "2MuWo4y6hKi8R3MH1xVzqCv5VjrWrUqw5X9",
              "scriptHash": "2ad72614e7e1aafad0080d48a7c007cb89e7b79e107c248bd946ef79089e873d",
              "publicKey": "02e5710c2d37902e5a5ac2830f94997a97c4d48ee049227820d8194ceba4cc6939",
              "index": 0,
              "path": "m/49'/0'/0'/0/0"
            },
            "p2wpkh": {
              "address": "bcrt1q2nyv56dq5e8f3rzth83hgd5hjuvypdu29szse7",
              "scriptHash": "20efaf7dd6693cf7e651bdeec8b8b6bf1fe54d639b54269221968a1779accf94",
              "publicKey": "020f8ad7697cfc9ca2b95595d3894978c9fd893931382219b4284a99d47d56f41f",
              "index": 0,
              "path": "m/84'/0'/0'/0/0"
            }
          },
          "bitcoin": {
            "p2pkh": {
              "address": "16KihsPdyXjFfa4DRxqYSEu2ZGLhWt6HEo",
              "scriptHash": "ba32eed6ff91b8acf35a3ab2fc6f1d392b04e3da24c13bbc7148698da57c1da9",
              "publicKey": "037fc2e2fb7a221777b3ea6a71dab2a46cee1feb7c2c7719a90ede95cb49efdbf3",
              "index": 1,
              "path": "m/44'/0'/0'/0/1"
            },
            "p2sh": {
              "address": "33xb1EAfiFd4qZeUHNNxay6EXWJggU4x8S",
              "scriptHash": "2ad72614e7e1aafad0080d48a7c007cb89e7b79e107c248bd946ef79089e873d",
              "publicKey": "02e5710c2d37902e5a5ac2830f94997a97c4d48ee049227820d8194ceba4cc6939",
              "index": 0,
              "path": "m/49'/0'/0'/0/0"
            },
            "p2wpkh": {
              "address": "bc1q2nyv56dq5e8f3rzth83hgd5hjuvypdu2dlqw4y",
              "scriptHash": "20efaf7dd6693cf7e651bdeec8b8b6bf1fe54d639b54269221968a1779accf94",
              "publicKey": "020f8ad7697cfc9ca2b95595d3894978c9fd893931382219b4284a99d47d56f41f",
              "index": 0,
              "path": "m/84'/0'/0'/0/0"
            }
          },
          "timestamp": null,
          "bitcoinTestnet": {
            "p2pkh": {
              "scriptHash": "",
              "publicKey": "",
              "address": "",
              "index": -1,
              "path": ""
            },
            "p2sh": {
              "scriptHash": "",
              "publicKey": "",
              "address": "",
              "index": -1,
              "path": ""
            },
            "p2wpkh": {
              "scriptHash": "",
              "publicKey": "",
              "address": "",
              "index": -1,
              "path": ""
            }
          }
        },
        "changeAddresses": {
          "bitcoinRegtest": {
            "p2pkh": {
              "c34481664ad50ac6878d9ac27e417089146af1711770dcd0fa1406946d580e53": {
                "path": "m/44'/0'/0'/1/3",
                "index": 3,
                "publicKey": "02c6009cde50e1a022e4ed59a7f9fc9893a4ce2461e098d0c65e4fe8d7ec870e04",
                "scriptHash": "c34481664ad50ac6878d9ac27e417089146af1711770dcd0fa1406946d580e53",
                "address": "mumHCQge98rYk113PkyARCgqfQs47gpDvs"
              },
              "dfa06da1fdc26023ae42b704f42f5c6d4d10232e1b8e07a5193d3db7ba52da7c": {
                "path": "m/44'/0'/0'/1/1",
                "index": 1,
                "publicKey": "03dda1bbebe10956bef70903ae94387ab5741710bea47bf60167a32e5709c1e591",
                "scriptHash": "dfa06da1fdc26023ae42b704f42f5c6d4d10232e1b8e07a5193d3db7ba52da7c",
                "address": "myqGb2PmLSHoHwR5e4YTC1RjumnbB1qpN7"
              },
              "1a88e6adca9f20cf1c08002c03576a5e62e9782e97100162040bb53c66736eab": {
                "path": "m/44'/0'/0'/1/0",
                "index": 0,
                "publicKey": "030e9ffd02b5fb00128d7053fa8a35fd5f954f9e2771ed54496fee9187146fadb8",
                "scriptHash": "1a88e6adca9f20cf1c08002c03576a5e62e9782e97100162040bb53c66736eab",
                "address": "muZY4xVminJNqaCjaivRDYCumrBd8MzdGy"
              },
              "9e740009b19a29326ef76c08654536950fa5aaf29bdb0880b9cbd78241d32479": {
                "path": "m/44'/0'/0'/1/4",
                "index": 4,
                "publicKey": "02f674465ef84f9b3083d154f3dd517134349146c167c482ce2e5ee4af1397cbd1",
                "scriptHash": "9e740009b19a29326ef76c08654536950fa5aaf29bdb0880b9cbd78241d32479",
                "address": "mqxBWgzMh9B6Fhkgu5J9PVS7mtMopF42nt"
              },
              "373ea5b947df64fc16bb44559a78283be16b23ea211da0f8da5e19a0c6a21e45": {
                "path": "m/44'/0'/0'/1/2",
                "index": 2,
                "publicKey": "033d75ba6d830dbc5cad77ba832f08e85751a0456395537905cf630f94ade5217a",
                "scriptHash": "373ea5b947df64fc16bb44559a78283be16b23ea211da0f8da5e19a0c6a21e45",
                "address": "mn4t6UJgjTcDWXvQ7eFzKthPz9Lp5oqwKs"
              }
            },
            "p2sh": {
              "36279d3bb74d93c93e205143faf9d3c299431e98e29b369c75f6208a8948ded4": {
                "path": "m/49'/0'/0'/1/4",
                "index": 4,
                "publicKey": "02683a0859a879adb1f1a915ea40e892f93462a17ebe0fb1cc0402a957854b6c63",
                "scriptHash": "36279d3bb74d93c93e205143faf9d3c299431e98e29b369c75f6208a8948ded4",
                "address": "2N5gBWTyyEuGanDdCw7FQE9jsYsUXLkQ4Z1"
              },
              "9a9c8ace5420d4f1fd79058491e4c73f093ce4b1c8851529a7989d1492080f08": {
                "path": "m/49'/0'/0'/1/0",
                "index": 0,
                "publicKey": "037fbe89163ff7da1ccc25c2451f75020d29b31ec2d3f7cf5571edc6786f1d9e7c",
                "scriptHash": "9a9c8ace5420d4f1fd79058491e4c73f093ce4b1c8851529a7989d1492080f08",
                "address": "2N3XvXRPUuifRN3CEZBLVJjm32q4KqM6Pj4"
              },
              "9fefedfe659da0f0eb2661cfada956042589fc4dba53cf0ce5892c06a10a6236": {
                "path": "m/49'/0'/0'/1/1",
                "index": 1,
                "publicKey": "0327ad78eea8193e15da92b88b9d0a1311047e5fde630905f139f1d9b9baf6ab4b",
                "scriptHash": "9fefedfe659da0f0eb2661cfada956042589fc4dba53cf0ce5892c06a10a6236",
                "address": "2N7szNXDPkXbY2xCmTLGWogJaXUtP21wYQW"
              },
              "5db780e1940fd9dfc12392160c8b29abb045ddfe7ef84f57ddbc9d35e76be725": {
                "path": "m/49'/0'/0'/1/2",
                "index": 2,
                "publicKey": "03aed51a63dbd88fc19c214aa10abd32bb238a4b837e176c7abd235b6a60dde954",
                "scriptHash": "5db780e1940fd9dfc12392160c8b29abb045ddfe7ef84f57ddbc9d35e76be725",
                "address": "2NGXBvQ21aJkvDQYWVonm7tkXAhjcxjRKzw"
              },
              "2f92c20de4965062f9f3f3ae0a81957b5916ba4fbcdc41238b617e1b70c9da92": {
                "path": "m/49'/0'/0'/1/3",
                "index": 3,
                "publicKey": "03b4c16aca425a0ec437bd22119d01d4a6249d3d13f69bbc1c0d0fd3bedb5f8cab",
                "scriptHash": "2f92c20de4965062f9f3f3ae0a81957b5916ba4fbcdc41238b617e1b70c9da92",
                "address": "2N4GdQgnEMtpnZ4qtg5jseq9BfPWKb1Qnc3"
              }
            },
            "p2wpkh": {
              "ab3e1582f8c3762d41ecb3b6666fbccaedb8bcb207e5108e52f3a5e25afc582c": {
                "path": "m/84'/0'/0'/1/0",
                "index": 0,
                "publicKey": "02c80c01d4b6e6360d0cea5f554bbfe52329e3068e682b8b3c7ff561c877210690",
                "scriptHash": "ab3e1582f8c3762d41ecb3b6666fbccaedb8bcb207e5108e52f3a5e25afc582c",
                "address": "bcrt1qdfvjpz8scp7tgh04cck05mtwfd0zxg0pp2gzhe"
              },
              "36ccca7185539207033f80e07cad38f01f88f027023915f4abc7f2cd73090a4c": {
                "path": "m/84'/0'/0'/1/4",
                "index": 4,
                "publicKey": "02a0cd8b46d7534a5bf4abfa189e22d850263b1e4b2a5e694e7562ad486f39b72e",
                "scriptHash": "36ccca7185539207033f80e07cad38f01f88f027023915f4abc7f2cd73090a4c",
                "address": "bcrt1q3we9pxa2sk7ge8upg9dagnan4p67jp94ag6eeg"
              },
              "823e6b5c2e812c9f640e8511ec3eb70a07e57122023c4ac319b9c020c7bee482": {
                "path": "m/84'/0'/0'/1/1",
                "index": 1,
                "publicKey": "021bb62c790ef35457c163a582967818414a12fff908301476afcee15a35c55728",
                "scriptHash": "823e6b5c2e812c9f640e8511ec3eb70a07e57122023c4ac319b9c020c7bee482",
                "address": "bcrt1qhtvvgwnzfqt506yfzv7en0ar4wxvvnjcqjxy7x"
              },
              "ea7d78920ee88657869bf4d1b3d73b9325c36b0f395170fcfeaaca9d3656ad58": {
                "path": "m/84'/0'/0'/1/2",
                "index": 2,
                "publicKey": "02f55106c694f8bd172c25970e2bbcb16904791b819238f13204f2d2aec87a5832",
                "scriptHash": "ea7d78920ee88657869bf4d1b3d73b9325c36b0f395170fcfeaaca9d3656ad58",
                "address": "bcrt1qnruygmwrgh37g0993dxaqy5pdpdexsa8fsrz5z"
              },
              "ebe1d5ab92ca3af1678580c6d6dcb4d08157820614957d8cc3d41ed7e78a8cbc": {
                "path": "m/84'/0'/0'/1/3",
                "index": 3,
                "publicKey": "038c5a7227f1e720fc069772bef960135fb563952b15cf4cea44ee8394e6c7e201",
                "scriptHash": "ebe1d5ab92ca3af1678580c6d6dcb4d08157820614957d8cc3d41ed7e78a8cbc",
                "address": "bcrt1qq375h0sxmql9n2terstwcxle0w7hwpxd8nv4ae"
              }
            }
          },
          "bitcoin": {
            "p2pkh": {
              "c34481664ad50ac6878d9ac27e417089146af1711770dcd0fa1406946d580e53": {
                "path": "m/44'/0'/0'/1/3",
                "index": 3,
                "publicKey": "02c6009cde50e1a022e4ed59a7f9fc9893a4ce2461e098d0c65e4fe8d7ec870e04",
                "scriptHash": "c34481664ad50ac6878d9ac27e417089146af1711770dcd0fa1406946d580e53",
                "address": "1FFKuMbfL7RHxtXRgBznbHUWoRGM8UsWtq"
              },
              "dfa06da1fdc26023ae42b704f42f5c6d4d10232e1b8e07a5193d3db7ba52da7c": {
                "path": "m/44'/0'/0'/1/1",
                "index": 1,
                "publicKey": "03dda1bbebe10956bef70903ae94387ab5741710bea47bf60167a32e5709c1e591",
                "scriptHash": "dfa06da1fdc26023ae42b704f42f5c6d4d10232e1b8e07a5193d3db7ba52da7c",
                "address": "1KKKHyJnXQrYWpwTvVa5N6DR3nBtEVtj3o"
              },
              "1a88e6adca9f20cf1c08002c03576a5e62e9782e97100162040bb53c66736eab": {
                "path": "m/44'/0'/0'/1/0",
                "index": 0,
                "publicKey": "030e9ffd02b5fb00128d7053fa8a35fd5f954f9e2771ed54496fee9187146fadb8",
                "scriptHash": "1a88e6adca9f20cf1c08002c03576a5e62e9782e97100162040bb53c66736eab",
                "address": "1F3amuQnuks84Tj7s9x3Pczaurav8e3AV9"
              },
              "9e740009b19a29326ef76c08654536950fa5aaf29bdb0880b9cbd78241d32479": {
                "path": "m/44'/0'/0'/1/4",
                "index": 4,
                "publicKey": "02f674465ef84f9b3083d154f3dd517134349146c167c482ce2e5ee4af1397cbd1",
                "scriptHash": "9e740009b19a29326ef76c08654536950fa5aaf29bdb0880b9cbd78241d32479",
                "address": "1BSEDduNt7jqUbH5BWKmZaDnutm6qbdR6h"
              },
              "373ea5b947df64fc16bb44559a78283be16b23ea211da0f8da5e19a0c6a21e45": {
                "path": "m/44'/0'/0'/1/2",
                "index": 2,
                "publicKey": "033d75ba6d830dbc5cad77ba832f08e85751a0456395537905cf630f94ade5217a",
                "scriptHash": "373ea5b947df64fc16bb44559a78283be16b23ea211da0f8da5e19a0c6a21e45",
                "address": "17YvoRDhvSAxjRSnQ5HcVyV589k7AXShiv"
              }
            },
            "p2sh": {
              "36279d3bb74d93c93e205143faf9d3c299431e98e29b369c75f6208a8948ded4": {
                "path": "m/49'/0'/0'/1/4",
                "index": 4,
                "publicKey": "02683a0859a879adb1f1a915ea40e892f93462a17ebe0fb1cc0402a957854b6c63",
                "scriptHash": "36279d3bb74d93c93e205143faf9d3c299431e98e29b369c75f6208a8948ded4",
                "address": "3E7ySj3wdSmEaRzfFydXcCkcLXGMUrGmyo"
              },
              "9a9c8ace5420d4f1fd79058491e4c73f093ce4b1c8851529a7989d1492080f08": {
                "path": "m/49'/0'/0'/1/0",
                "index": 0,
                "publicKey": "037fbe89163ff7da1ccc25c2451f75020d29b31ec2d3f7cf5571edc6786f1d9e7c",
                "scriptHash": "9a9c8ace5420d4f1fd79058491e4c73f093ce4b1c8851529a7989d1492080f08",
                "address": "3ByiTgTTJGA5AFZgt3icgnmmpUrA3G355p"
              },
              "9fefedfe659da0f0eb2661cfada956042589fc4dba53cf0ce5892c06a10a6236": {
                "path": "m/49'/0'/0'/1/1",
                "index": 1,
                "publicKey": "0327ad78eea8193e15da92b88b9d0a1311047e5fde630905f139f1d9b9baf6ab4b",
                "scriptHash": "9fefedfe659da0f0eb2661cfada956042589fc4dba53cf0ce5892c06a10a6236",
                "address": "3GKnJnHN956BqAaDnCeeBjKKK8gDAREAXH"
              },
              "5db780e1940fd9dfc12392160c8b29abb045ddfe7ef84f57ddbc9d35e76be725": {
                "path": "m/49'/0'/0'/1/2",
                "index": 2,
                "publicKey": "03aed51a63dbd88fc19c214aa10abd32bb238a4b837e176c7abd235b6a60dde954",
                "scriptHash": "5db780e1940fd9dfc12392160c8b29abb045ddfe7ef84f57ddbc9d35e76be725",
                "address": "3Qxyrf5yxrFa1cuxpgAtVwmFxMXT9YYDYd"
              },
              "2f92c20de4965062f9f3f3ae0a81957b5916ba4fbcdc41238b617e1b70c9da92": {
                "path": "m/49'/0'/0'/1/3",
                "index": 3,
                "publicKey": "03b4c16aca425a0ec437bd22119d01d4a6249d3d13f69bbc1c0d0fd3bedb5f8cab",
                "scriptHash": "2f92c20de4965062f9f3f3ae0a81957b5916ba4fbcdc41238b617e1b70c9da92",
                "address": "3CiRLwrCkSKSMHDLzx812t9vT3J9oF78yZ"
              }
            },
            "p2wpkh": {
              "ab3e1582f8c3762d41ecb3b6666fbccaedb8bcb207e5108e52f3a5e25afc582c": {
                "path": "m/84'/0'/0'/1/0",
                "index": 0,
                "publicKey": "02c80c01d4b6e6360d0cea5f554bbfe52329e3068e682b8b3c7ff561c877210690",
                "scriptHash": "ab3e1582f8c3762d41ecb3b6666fbccaedb8bcb207e5108e52f3a5e25afc582c",
                "address": "bc1qdfvjpz8scp7tgh04cck05mtwfd0zxg0pf92umr"
              },
              "36ccca7185539207033f80e07cad38f01f88f027023915f4abc7f2cd73090a4c": {
                "path": "m/84'/0'/0'/1/4",
                "index": 4,
                "publicKey": "02a0cd8b46d7534a5bf4abfa189e22d850263b1e4b2a5e694e7562ad486f39b72e",
                "scriptHash": "36ccca7185539207033f80e07cad38f01f88f027023915f4abc7f2cd73090a4c",
                "address": "bc1q3we9pxa2sk7ge8upg9dagnan4p67jp9448c84j"
              },
              "823e6b5c2e812c9f640e8511ec3eb70a07e57122023c4ac319b9c020c7bee482": {
                "path": "m/84'/0'/0'/1/1",
                "index": 1,
                "publicKey": "021bb62c790ef35457c163a582967818414a12fff908301476afcee15a35c55728",
                "scriptHash": "823e6b5c2e812c9f640e8511ec3eb70a07e57122023c4ac319b9c020c7bee482",
                "address": "bc1qhtvvgwnzfqt506yfzv7en0ar4wxvvnjcgay6ju"
              },
              "ea7d78920ee88657869bf4d1b3d73b9325c36b0f395170fcfeaaca9d3656ad58": {
                "path": "m/84'/0'/0'/1/2",
                "index": 2,
                "publicKey": "02f55106c694f8bd172c25970e2bbcb16904791b819238f13204f2d2aec87a5832",
                "scriptHash": "ea7d78920ee88657869bf4d1b3d73b9325c36b0f395170fcfeaaca9d3656ad58",
                "address": "bc1qnruygmwrgh37g0993dxaqy5pdpdexsa8plpucc"
              },
              "ebe1d5ab92ca3af1678580c6d6dcb4d08157820614957d8cc3d41ed7e78a8cbc": {
                "path": "m/84'/0'/0'/1/3",
                "index": 3,
                "publicKey": "038c5a7227f1e720fc069772bef960135fb563952b15cf4cea44ee8394e6c7e201",
                "scriptHash": "ebe1d5ab92ca3af1678580c6d6dcb4d08157820614957d8cc3d41ed7e78a8cbc",
                "address": "bc1qq375h0sxmql9n2terstwcxle0w7hwpxd0uwt3r"
              }
            }
          },
          "timestamp": null,
          "bitcoinTestnet": {
            "p2pkh": {},
            "p2sh": {},
            "p2wpkh": {}
          }
        },
        "addresses": {
          "bitcoinRegtest": {
            "p2pkh": {
              "c1d1d6576f684a0bd8a0d69f185139f0eef530c30908427322a10b93f9122a96": {
                "path": "m/44'/0'/0'/0/2",
                "index": 2,
                "publicKey": "03e8614dab4d652e05f5eb176ec6cc3434832b56f08ac84b7f21b3fe545fd5d6d7",
                "scriptHash": "c1d1d6576f684a0bd8a0d69f185139f0eef530c30908427322a10b93f9122a96",
                "address": "muKTNxR9njV7iV9gByg5KXHZ7hCdxGL2yZ"
              },
              "21d88304fb593954d7bea06fc196610ee0109c82673d0073475c232a539293c6": {
                "path": "m/44'/0'/0'/0/3",
                "index": 3,
                "publicKey": "0386874f95ccd78cfa546af7a321f489b68ca71fb9d24f77eada168896e94f25e0",
                "scriptHash": "21d88304fb593954d7bea06fc196610ee0109c82673d0073475c232a539293c6",
                "address": "n1fRypSFLdEetznjaSffggycd7Pjnbt4MG"
              },
              "773fc6693778a85106668cfd8f28dc8e1d8e840251d5aa224490c843b2f8d9c5": {
                "path": "m/44'/0'/0'/0/4",
                "index": 4,
                "publicKey": "025d3694cb279134107de26ea5b9edb9f0fcaae48766dd85908a33e55204a51a9d",
                "scriptHash": "773fc6693778a85106668cfd8f28dc8e1d8e840251d5aa224490c843b2f8d9c5",
                "address": "n2MQ3d4i6rXkpTkNDHgDY6xUCgcMtncNo4"
              },
              "9dbc4211b69ae33e39e77290c86c9b69ab1b81578cfddd33a12635b33f0b9071": {
                "path": "m/44'/0'/0'/0/5",
                "index": 5,
                "publicKey": "027c13fd6190a68a06ac07bd9254847308163dcfd635cfe9a7c724f3b1fed36369",
                "scriptHash": "9dbc4211b69ae33e39e77290c86c9b69ab1b81578cfddd33a12635b33f0b9071",
                "address": "miF2FyMJgbzm1MXYRXo8dvBEg824Uv12cM"
              },
              "ba32eed6ff91b8acf35a3ab2fc6f1d392b04e3da24c13bbc7148698da57c1da9": {
                "path": "m/44'/0'/0'/0/1",
                "index": 1,
                "publicKey": "037fc2e2fb7a221777b3ea6a71dab2a46cee1feb7c2c7719a90ede95cb49efdbf3",
                "scriptHash": "ba32eed6ff91b8acf35a3ab2fc6f1d392b04e3da24c13bbc7148698da57c1da9",
                "address": "mkqfzvUcnZAWSgXq9XovGA7MRFwQUSE41t"
              }
            },
            "p2sh": {
              "87310ea98ed0aa7e5e4d0012b6ff147635a5a532188b04a61675fec31f640b34": {
                "path": "m/49'/0'/0'/0/2",
                "index": 2,
                "publicKey": "021ce214d090986ca7c31b54f0182e62792b4880b0d7c03ef3c63f87563505ecc9",
                "scriptHash": "87310ea98ed0aa7e5e4d0012b6ff147635a5a532188b04a61675fec31f640b34",
                "address": "2MzCG64nS57da238sJjV7VZdi8uzWWYEQwe"
              },
              "2ad72614e7e1aafad0080d48a7c007cb89e7b79e107c248bd946ef79089e873d": {
                "path": "m/49'/0'/0'/0/0",
                "index": 0,
                "publicKey": "02e5710c2d37902e5a5ac2830f94997a97c4d48ee049227820d8194ceba4cc6939",
                "scriptHash": "2ad72614e7e1aafad0080d48a7c007cb89e7b79e107c248bd946ef79089e873d",
                "address": "2MuWo4y6hKi8R3MH1xVzqCv5VjrWrUqw5X9"
              },
              "5b9a5d431dfacbd4624ef2414e24ad94acae76ed9002b1fbf82d703630ac403a": {
                "path": "m/49'/0'/0'/0/1",
                "index": 1,
                "publicKey": "033c115cb15c83fc620df2d0b66e3e55f6f6fc68e947bbf62a12ecf694f4f096c7",
                "scriptHash": "5b9a5d431dfacbd4624ef2414e24ad94acae76ed9002b1fbf82d703630ac403a",
                "address": "2NAUKaJZVyyfdTNt43Fd3T3SEsU873NPib9"
              },
              "e7749a9f206933102694b8e9fafc8cc50dd03db5952735564e0f2577ec6f5735": {
                "path": "m/49'/0'/0'/0/3",
                "index": 3,
                "publicKey": "02714c93b1244de00a260646a93b2e280ee0af054aec3732e29f3db071948b0c94",
                "scriptHash": "e7749a9f206933102694b8e9fafc8cc50dd03db5952735564e0f2577ec6f5735",
                "address": "2N8JZ213EtSrYpHCf6Xb72T9Uzs58MqR5oH"
              },
              "43942bff09517bcf4a25557f91473ad06ce76b71f030757f5ea7bdbcebec27b9": {
                "path": "m/49'/0'/0'/0/4",
                "index": 4,
                "publicKey": "0213b60c3436a9204e4752a245c9853fd685aa32fdc1f6cd3e3606ee3d131edd75",
                "scriptHash": "43942bff09517bcf4a25557f91473ad06ce76b71f030757f5ea7bdbcebec27b9",
                "address": "2N6ZycunsHC47Hq2SCe1VE5CHYjBUErXm2R"
              }
            },
            "p2wpkh": {
              "20efaf7dd6693cf7e651bdeec8b8b6bf1fe54d639b54269221968a1779accf94": {
                "path": "m/84'/0'/0'/0/0",
                "index": 0,
                "publicKey": "020f8ad7697cfc9ca2b95595d3894978c9fd893931382219b4284a99d47d56f41f",
                "scriptHash": "20efaf7dd6693cf7e651bdeec8b8b6bf1fe54d639b54269221968a1779accf94",
                "address": "bcrt1q2nyv56dq5e8f3rzth83hgd5hjuvypdu29szse7"
              },
              "f54ee051bf8c1171db63bdd59a5164b0569dd0b8210b643955fc5ed013d89c98": {
                "path": "m/84'/0'/0'/0/1",
                "index": 1,
                "publicKey": "031921690b9904742b4e6aa44ac149ab83d1c12adcd44a2a3fa389b1fca2b17df1",
                "scriptHash": "f54ee051bf8c1171db63bdd59a5164b0569dd0b8210b643955fc5ed013d89c98",
                "address": "bcrt1q3mq3xjmupww895m6khk4fpp62vjdvld07py5ue"
              },
              "42ecc86674fea2ce026f12477a409bd9d4d96949bb41d062539bf2082208d684": {
                "path": "m/84'/0'/0'/0/4",
                "index": 4,
                "publicKey": "021e1b1a973a7068e8826ca1de0bf8945b2f3be90e2ea1525ea1e25964259529e0",
                "scriptHash": "42ecc86674fea2ce026f12477a409bd9d4d96949bb41d062539bf2082208d684",
                "address": "bcrt1q0494hr6a80czvaprny4qreqs2cp7k0zl0nmctc"
              },
              "32be936588150ec39b4211618f445c6bcc75dba852b2a125d10daafa4894eaa7": {
                "path": "m/84'/0'/0'/0/3",
                "index": 3,
                "publicKey": "02f3afa7dfdfe3a69326cb249fc98eb58d27126ca7d9d2d7afe6ea66ab49cf3e27",
                "scriptHash": "32be936588150ec39b4211618f445c6bcc75dba852b2a125d10daafa4894eaa7",
                "address": "bcrt1qlywh7gq2vhezw5rq8mv3e8wyj03328vutj5ktn"
              },
              "8ee131e7e795bad487234f57d1b9cacefc39f3cfc07ec6c11b13457df50a8680": {
                "path": "m/84'/0'/0'/0/2",
                "index": 2,
                "publicKey": "03d5fad847cf2e15fd7e4237225437db6ce3f84da17728ea920bc7cef50942756b",
                "scriptHash": "8ee131e7e795bad487234f57d1b9cacefc39f3cfc07ec6c11b13457df50a8680",
                "address": "bcrt1qehvasmguwg48n583rslnwj4etuufguyn3g507q"
              }
            }
          },
          "bitcoin": {
            "p2pkh": {
              "c1d1d6576f684a0bd8a0d69f185139f0eef530c30908427322a10b93f9122a96": {
                "path": "m/44'/0'/0'/0/2",
                "index": 2,
                "publicKey": "03e8614dab4d652e05f5eb176ec6cc3434832b56f08ac84b7f21b3fe545fd5d6d7",
                "scriptHash": "c1d1d6576f684a0bd8a0d69f185139f0eef530c30908427322a10b93f9122a96",
                "address": "1EoW5uLAyi3rwNg4UQhhVc5EFhbvzW8ZnZ"
              },
              "21d88304fb593954d7bea06fc196610ee0109c82673d0073475c232a539293c6": {
                "path": "m/44'/0'/0'/0/3",
                "index": 3,
                "publicKey": "0386874f95ccd78cfa546af7a321f489b68ca71fb9d24f77eada168896e94f25e0",
                "scriptHash": "21d88304fb593954d7bea06fc196610ee0109c82673d0073475c232a539293c6",
                "address": "1M9UgmMGXboQ7tK7rshHrmmHm7o2rq26G9"
              },
              "773fc6693778a85106668cfd8f28dc8e1d8e840251d5aa224490c843b2f8d9c5": {
                "path": "m/44'/0'/0'/0/4",
                "index": 4,
                "publicKey": "025d3694cb279134107de26ea5b9edb9f0fcaae48766dd85908a33e55204a51a9d",
                "scriptHash": "773fc6693778a85106668cfd8f28dc8e1d8e840251d5aa224490c843b2f8d9c5",
                "address": "1MqSkZyjHq6W3MGkVihqiBk9Lh1ewJiVYB"
              },
              "9dbc4211b69ae33e39e77290c86c9b69ab1b81578cfddd33a12635b33f0b9071": {
                "path": "m/44'/0'/0'/0/5",
                "index": 5,
                "publicKey": "027c13fd6190a68a06ac07bd9254847308163dcfd635cfe9a7c724f3b1fed36369",
                "scriptHash": "9dbc4211b69ae33e39e77290c86c9b69ab1b81578cfddd33a12635b33f0b9071",
                "address": "13j4xvGKsaZWEF3vhxpkozxup8RMbsBS9C"
              },
              "ba32eed6ff91b8acf35a3ab2fc6f1d392b04e3da24c13bbc7148698da57c1da9": {
                "path": "m/44'/0'/0'/0/1",
                "index": 1,
                "publicKey": "037fc2e2fb7a221777b3ea6a71dab2a46cee1feb7c2c7719a90ede95cb49efdbf3",
                "scriptHash": "ba32eed6ff91b8acf35a3ab2fc6f1d392b04e3da24c13bbc7148698da57c1da9",
                "address": "16KihsPdyXjFfa4DRxqYSEu2ZGLhWt6HEo"
              }
            },
            "p2sh": {
              "87310ea98ed0aa7e5e4d0012b6ff147635a5a532188b04a61675fec31f640b34": {
                "path": "m/49'/0'/0'/0/2",
                "index": 2,
                "publicKey": "021ce214d090986ca7c31b54f0182e62792b4880b0d7c03ef3c63f87563505ecc9",
                "scriptHash": "87310ea98ed0aa7e5e4d0012b6ff147635a5a532188b04a61675fec31f640b34",
                "address": "38e42KrQTf8DpFWKdbsEsceSvZnLf3czXT"
              },
              "2ad72614e7e1aafad0080d48a7c007cb89e7b79e107c248bd946ef79089e873d": {
                "path": "m/49'/0'/0'/0/0",
                "index": 0,
                "publicKey": "02e5710c2d37902e5a5ac2830f94997a97c4d48ee049227820d8194ceba4cc6939",
                "scriptHash": "2ad72614e7e1aafad0080d48a7c007cb89e7b79e107c248bd946ef79089e873d",
                "address": "33xb1EAfiFd4qZeUHNNxay6EXWJggU4x8S"
              },
              "5b9a5d431dfacbd4624ef2414e24ad94acae76ed9002b1fbf82d703630ac403a": {
                "path": "m/49'/0'/0'/0/1",
                "index": 1,
                "publicKey": "033c115cb15c83fc620df2d0b66e3e55f6f6fc68e947bbf62a12ecf694f4f096c7",
                "scriptHash": "5b9a5d431dfacbd4624ef2414e24ad94acae76ed9002b1fbf82d703630ac403a",
                "address": "3Jv7WZdUNXAHFbFWN81Aq6Syf7uwFPGTQG"
              },
              "e7749a9f206933102694b8e9fafc8cc50dd03db5952735564e0f2577ec6f5735": {
                "path": "m/49'/0'/0'/0/3",
                "index": 3,
                "publicKey": "02714c93b1244de00a260646a93b2e280ee0af054aec3732e29f3db071948b0c94",
                "scriptHash": "e7749a9f206933102694b8e9fafc8cc50dd03db5952735564e0f2577ec6f5735",
                "address": "3GkLxG7DGzMCcVa7RPyEQWADnWrxVfsdoJ"
              },
              "43942bff09517bcf4a25557f91473ad06ce76b71f030757f5ea7bdbcebec27b9": {
                "path": "m/49'/0'/0'/0/4",
                "index": 4,
                "publicKey": "0213b60c3436a9204e4752a245c9853fd685aa32fdc1f6cd3e3606ee3d131edd75",
                "scriptHash": "43942bff09517bcf4a25557f91473ad06ce76b71f030757f5ea7bdbcebec27b9",
                "address": "3F1mZArqfjYm63PtXWPcc8D2LNyJPZTszB"
              }
            },
            "p2wpkh": {
              "20efaf7dd6693cf7e651bdeec8b8b6bf1fe54d639b54269221968a1779accf94": {
                "path": "m/84'/0'/0'/0/0",
                "index": 0,
                "publicKey": "020f8ad7697cfc9ca2b95595d3894978c9fd893931382219b4284a99d47d56f41f",
                "scriptHash": "20efaf7dd6693cf7e651bdeec8b8b6bf1fe54d639b54269221968a1779accf94",
                "address": "bc1q2nyv56dq5e8f3rzth83hgd5hjuvypdu2dlqw4y"
              },
              "f54ee051bf8c1171db63bdd59a5164b0569dd0b8210b643955fc5ed013d89c98": {
                "path": "m/84'/0'/0'/0/1",
                "index": 1,
                "publicKey": "031921690b9904742b4e6aa44ac149ab83d1c12adcd44a2a3fa389b1fca2b17df1",
                "scriptHash": "f54ee051bf8c1171db63bdd59a5164b0569dd0b8210b643955fc5ed013d89c98",
                "address": "bc1q3mq3xjmupww895m6khk4fpp62vjdvld0kwx2sr"
              },
              "42ecc86674fea2ce026f12477a409bd9d4d96949bb41d062539bf2082208d684": {
                "path": "m/84'/0'/0'/0/4",
                "index": 4,
                "publicKey": "021e1b1a973a7068e8826ca1de0bf8945b2f3be90e2ea1525ea1e25964259529e0",
                "scriptHash": "42ecc86674fea2ce026f12477a409bd9d4d96949bb41d062539bf2082208d684",
                "address": "bc1q0494hr6a80czvaprny4qreqs2cp7k0zl8uex8z"
              },
              "32be936588150ec39b4211618f445c6bcc75dba852b2a125d10daafa4894eaa7": {
                "path": "m/84'/0'/0'/0/3",
                "index": 3,
                "publicKey": "02f3afa7dfdfe3a69326cb249fc98eb58d27126ca7d9d2d7afe6ea66ab49cf3e27",
                "scriptHash": "32be936588150ec39b4211618f445c6bcc75dba852b2a125d10daafa4894eaa7",
                "address": "bc1qlywh7gq2vhezw5rq8mv3e8wyj03328vurakg8f"
              },
              "8ee131e7e795bad487234f57d1b9cacefc39f3cfc07ec6c11b13457df50a8680": {
                "path": "m/84'/0'/0'/0/2",
                "index": 2,
                "publicKey": "03d5fad847cf2e15fd7e4237225437db6ce3f84da17728ea920bc7cef50942756b",
                "scriptHash": "8ee131e7e795bad487234f57d1b9cacefc39f3cfc07ec6c11b13457df50a8680",
                "address": "bc1qehvasmguwg48n583rslnwj4etuufguyne8k3j6"
              }
            }
          },
          "timestamp": null,
          "bitcoinTestnet": {
            "p2pkh": {},
            "p2sh": {},
            "p2wpkh": {}
          }
        },
        "utxos": {
          "bitcoinRegtest": [],
          "bitcoin": [],
          "timestamp": null,
          "bitcoinTestnet": []
        },
        "keyDerivationPath": {
          "bitcoinRegtest": {
            "purpose": "84",
            "account": "0",
            "coinType": "0",
            "change": "0",
            "addressIndex": "0"
          },
          "bitcoinTestnet": {
            "purpose": "84",
            "account": "0",
            "coinType": "0",
            "change": "0",
            "addressIndex": "0"
          },
          "bitcoin": {
            "purpose": "84",
            "account": "0",
            "coinType": "0",
            "change": "0",
            "addressIndex": "0"
          }
        },
        "lastUpdated": {
          "bitcoinRegtest": 0,
          "bitcoin": 0,
          "timestamp": null,
          "bitcoinTestnet": 0
        },
        "lastUsedAddressIndex": {
          "bitcoinRegtest": {
            "p2pkh": {
              "scriptHash": "",
              "publicKey": "",
              "address": "",
              "index": -1,
              "path": ""
            },
            "p2sh": {
              "scriptHash": "",
              "publicKey": "",
              "address": "",
              "index": -1,
              "path": ""
            },
            "p2wpkh": {
              "scriptHash": "",
              "publicKey": "",
              "address": "",
              "index": -1,
              "path": ""
            }
          },
          "bitcoin": {
            "p2pkh": {
              "scriptHash": "",
              "publicKey": "",
              "address": "",
              "index": -1,
              "path": ""
            },
            "p2sh": {
              "scriptHash": "",
              "publicKey": "",
              "address": "",
              "index": -1,
              "path": ""
            },
            "p2wpkh": {
              "scriptHash": "",
              "publicKey": "",
              "address": "",
              "index": -1,
              "path": ""
            }
          },
          "timestamp": null,
          "bitcoinTestnet": {
            "p2pkh": {
              "scriptHash": "",
              "publicKey": "",
              "address": "",
              "index": -1,
              "path": ""
            },
            "p2sh": {
              "scriptHash": "",
              "publicKey": "",
              "address": "",
              "index": -1,
              "path": ""
            },
            "p2wpkh": {
              "scriptHash": "",
              "publicKey": "",
              "address": "",
              "index": -1,
              "path": ""
            }
          }
        },
        "transactions": {
          "bitcoinRegtest": {},
          "bitcoin": {},
          "timestamp": null,
          "bitcoinTestnet": {}
        },
        "lastUsedChangeAddressIndex": {
          "bitcoinRegtest": {
            "p2pkh": {
              "scriptHash": "",
              "publicKey": "",
              "address": "",
              "index": -1,
              "path": ""
            },
            "p2sh": {
              "scriptHash": "",
              "publicKey": "",
              "address": "",
              "index": -1,
              "path": ""
            },
            "p2wpkh": {
              "scriptHash": "",
              "publicKey": "",
              "address": "",
              "index": -1,
              "path": ""
            }
          },
          "bitcoin": {
            "p2pkh": {
              "scriptHash": "",
              "publicKey": "",
              "address": "",
              "index": -1,
              "path": ""
            },
            "p2sh": {
              "scriptHash": "",
              "publicKey": "",
              "address": "",
              "index": -1,
              "path": ""
            },
            "p2wpkh": {
              "scriptHash": "",
              "publicKey": "",
              "address": "",
              "index": -1,
              "path": ""
            }
          },
          "timestamp": null,
          "bitcoinTestnet": {
            "p2pkh": {
              "scriptHash": "",
              "publicKey": "",
              "address": "",
              "index": -1,
              "path": ""
            },
            "p2sh": {
              "scriptHash": "",
              "publicKey": "",
              "address": "",
              "index": -1,
              "path": ""
            },
            "p2wpkh": {
              "scriptHash": "",
              "publicKey": "",
              "address": "",
              "index": -1,
              "path": ""
            }
          }
        },
        "changeAddressIndex": {
          "bitcoinRegtest": {
            "p2pkh": {
              "address": "muZY4xVminJNqaCjaivRDYCumrBd8MzdGy",
              "scriptHash": "1a88e6adca9f20cf1c08002c03576a5e62e9782e97100162040bb53c66736eab",
              "publicKey": "030e9ffd02b5fb00128d7053fa8a35fd5f954f9e2771ed54496fee9187146fadb8",
              "index": 0,
              "path": "m/44'/0'/0'/1/0"
            },
            "p2sh": {
              "address": "2N3XvXRPUuifRN3CEZBLVJjm32q4KqM6Pj4",
              "scriptHash": "9a9c8ace5420d4f1fd79058491e4c73f093ce4b1c8851529a7989d1492080f08",
              "publicKey": "037fbe89163ff7da1ccc25c2451f75020d29b31ec2d3f7cf5571edc6786f1d9e7c",
              "index": 0,
              "path": "m/49'/0'/0'/1/0"
            },
            "p2wpkh": {
              "address": "bcrt1qdfvjpz8scp7tgh04cck05mtwfd0zxg0pp2gzhe",
              "scriptHash": "ab3e1582f8c3762d41ecb3b6666fbccaedb8bcb207e5108e52f3a5e25afc582c",
              "publicKey": "02c80c01d4b6e6360d0cea5f554bbfe52329e3068e682b8b3c7ff561c877210690",
              "index": 0,
              "path": "m/84'/0'/0'/1/0"
            }
          },
          "bitcoin": {
            "p2pkh": {
              "address": "1F3amuQnuks84Tj7s9x3Pczaurav8e3AV9",
              "scriptHash": "1a88e6adca9f20cf1c08002c03576a5e62e9782e97100162040bb53c66736eab",
              "publicKey": "030e9ffd02b5fb00128d7053fa8a35fd5f954f9e2771ed54496fee9187146fadb8",
              "index": 0,
              "path": "m/44'/0'/0'/1/0"
            },
            "p2sh": {
              "address": "3ByiTgTTJGA5AFZgt3icgnmmpUrA3G355p",
              "scriptHash": "9a9c8ace5420d4f1fd79058491e4c73f093ce4b1c8851529a7989d1492080f08",
              "publicKey": "037fbe89163ff7da1ccc25c2451f75020d29b31ec2d3f7cf5571edc6786f1d9e7c",
              "index": 0,
              "path": "m/49'/0'/0'/1/0"
            },
            "p2wpkh": {
              "address": "bc1qdfvjpz8scp7tgh04cck05mtwfd0zxg0pf92umr",
              "scriptHash": "ab3e1582f8c3762d41ecb3b6666fbccaedb8bcb207e5108e52f3a5e25afc582c",
              "publicKey": "02c80c01d4b6e6360d0cea5f554bbfe52329e3068e682b8b3c7ff561c877210690",
              "index": 0,
              "path": "m/84'/0'/0'/1/0"
            }
          },
          "timestamp": null,
          "bitcoinTestnet": {
            "p2pkh": {
              "scriptHash": "",
              "publicKey": "",
              "address": "",
              "index": -1,
              "path": ""
            },
            "p2sh": {
              "scriptHash": "",
              "publicKey": "",
              "address": "",
              "index": -1,
              "path": ""
            },
            "p2wpkh": {
              "scriptHash": "",
              "publicKey": "",
              "address": "",
              "index": -1,
              "path": ""
            }
          }
        }
      }
    },
    "addressTypes": {
      "p2wpkh": {
        "path": "m/84'/0'/0'/0/0",
        "type": "p2wpkh",
        "label": "bech32"
      },
      "p2sh": {
        "path": "m/49'/0'/0'/0/0",
        "type": "p2sh",
        "label": "segwit"
      },
      "p2pkh": {
        "path": "m/44'/0'/0'/0/0",
        "type": "p2pkh",
        "label": "legacy"
      }
    }
  },
}