<p>There are several factors that could be causing the discrepancy.</p>

<ul>
<li>Make sure you are running the latest version of bcoin (v2.0.0 was just released)</li>
<li>Make sure your node is fully synced to the testnet blockchain.</li>
<li>Make sure all the transactions in the Copay wallet history are confirmed.</li>
</ul>

<p>Other possible issues:</p>

<ul>
<li><p>Do you make a lot of transactions with this wallet? Like, more than 10 or so in a single block? It's possible you've exceeded the BIP44 lookahead and some manual configuration may be necessary to recover all the transactions (although this particular behavior is usually fixed with an additional rescan)</p></li>
<li><p>When you rescan, do you specify a block height to rescan from? Make sure that is low enough to catch your complete transaction history.</p></li>
</ul>

<p>Compare the history of the two wallets (<a href="https://bcoin.io/api-docs/?shell--cli#get-wallet-tx-history" rel="nofollow noreferrer">https://bcoin.io/api-docs/?shell--cli#get-wallet-tx-history</a>). Can you determine which TXs are missing from the bcoin wallet? It might be helpful for debugging if we can identify a pattern.</p>

<p>If you want more interactive help debugging, you can find the developers on IRC #bcoin or on slack: <a href="https://bcoin.io/slack-signup.html" rel="nofollow noreferrer">https://bcoin.io/slack-signup.html</a></p>

CC BY-SA 4.0
2020-04-27T12:22:45.463Z
thanks for the hints. besides the history comparisson of the transaction I´ve done/checked all several times. As I use this wallet for testing purpose it might be possible that there are several transactions within the same block.
Michael
CC BY-SA 4.0
2020-04-27T12:50:13.300Z
I´ve started rescans with different height. Also started one now with heigth: 1 which should get all affected addresses, right? Also is there a way to totally drop the wallet or do I have to stop bcoin and drop the wallet files manually? thanks in advance.
Michael
CC BY-SA 4.0
2020-04-27T13:32:00.443Z
Yes rescanning from 0 or 1 should scan the entire blockchain. There are methods in the library to delete a wallet but they are not exposed in the API for obvious reasons. You could remove the directory `~/.bcoin/testnet/wallet` and relaunch to generate a new wallet database. You can also just create a new wallet with the API and ignore the old one.
pinhead
CC BY-SA 4.0
2020-04-27T14:58:03.720Z
comparing the transactions showed up with some trx not known by bcoin. can those be imported by api in any way or how to update bcoin?
Michael
CC BY-SA 4.0
2020-04-27T15:16:56.690Z
You could try https://bcoin.io/api-docs/#importprunedfunds but I'm more concerned with why bcoin didn't import the tx during the rescan. It could be you have large gaps in the bip44 path, and bcoin is not deriving enough addresses in advance.
pinhead
CC BY-SA 4.0
2020-04-27T15:24:17.387Z
I´m confused why they are not imported... here a sample (1. imported, 2. not, 3. imported, 4. not) ```2019-02-13T08:39:56.000Z,,,0.01000000,BTC,c1e055df1d09fb2a57a04b60493f3874a2d48eac40cc511d744f53ec9368799c,,,
2019-02-13T08:19:48.000Z,,,0.11430071,BTC,b436c66d6d445352dcc650756656d8582bf2a7b946c2218afc669d73d44099ff,,,
2019-02-12T07:39:14.000Z,,,0.01000000,BTC,abeb2f54429f26a004162f5206d666dcc423c660f669f37225fab0b98c80f311,,,
2019-02-12T07:39:14.000Z,,,0.01000000,BTC,d23cc9771182248548b9023a9c855fdea7c3c700d2813e9d78c023f9462972f5,,,```
Michael
CC BY-SA 4.0
2020-04-27T15:36:34.690Z
221/305 trx unknown by bcoin.
Michael
CC BY-SA 4.0
2020-04-27T16:00:17.740Z
Change this value to `1000` and rescan again: https://github.com/bcoin-org/bcoin/blob/master/lib/wallet/account.js#L54
pinhead
CC BY-SA 4.0
2020-04-27T17:25:44.980Z
does not bring the expected result. is there any way to check the status of the node? I´m currently using https://bcoin.io/api-docs/#get-server-info but this gives me only a limited result, and not the full dataset like in the documentation:(see OP)
Michael
CC BY-SA 4.0
2020-04-27T17:55:08.810Z
Use the HTTP API getinfo (the call you actually linked to in this last comment) instead of the RPC call. But your node looks synced. Please join us on slack or IRC so we can chat and debug more, I think this is getting a little too long for SE.
pinhead
CC BY-SA 4.0
2020-04-27T11:59:51.103Z
2020-04-27T11:59:51.103Z
pinhead
<p>I´ve got a copay wallet for test purpose. In there I have used a wallet for quite a while. Now I´ve started to play around with bcoin and wanted to import the wallet from copay to bcoin. therefore I´ve imported the tpriv into bcoin with <code>/wallet/importedDemoWallet</code>:</p>

<pre><code>{
    "witness":false, 
    "passphrase":"sample", 
    "watchOnly": false, 
    "accountKey":"tprvxxxxxxxxxxxxx[...]"
}
</code></pre>

<p>Here I´ve got the problem that in bcoin it only shows me a balance around 1.4 tBTC while in the copay wallet it shows 2.4 tBTC. even after a rescan the result does not change. can someone tell me whats wrong here? shouldn´t be the balance in both case the same?</p>

<p>UPDATE:</p>

<p>result from get server info:</p>

<pre><code>    "result": {
        "version": "2.0.0-dev",
        "protocolversion": 70015,
        "walletversion": 0,
        "balance": 0,
        "blocks": 1722115,
        "timeoffset": 0,
        "connections": 12,
        "proxy": "",
        "difficulty": 1,
        "testnet": true,
        "keypoololdest": 0,
        "keypoolsize": 0,
        "unlocked_until": 0,
        "paytxfee": 0.0002,
        "relayfee": 0.00001,
        "errors": ""
    },
    "error": null,
    "id": null
}
</code></pre>

<copay><bcoin>
Different balance for same private key using bcoin and copay
Michael
# Different balance for same private key using bcoin and copay

(Asked by: username_0 on 2020-04-27)

I´ve got a copay wallet for test purpose. In there I have used a wallet for quite a while. Now I´ve started to play around with bcoin and wanted to import the wallet from copay to bcoin. therefore I´ve imported the tpriv into bcoin with `/wallet/importedDemoWallet`:

```
{
    "witness":false, 
    "passphrase":"sample", 
    "watchOnly": false, 
    "accountKey":"tprvxxxxxxxxxxxxx[...]"
}

```

Here I´ve got the problem that in bcoin it only shows me a balance around 1.4 tBTC while in the copay wallet it shows 2.4 tBTC. even after a rescan the result does not change. can someone tell me whats wrong here? shouldn´t be the balance in both case the same?

UPDATE:

result from get server info:

```
    "result": {
        "version": "2.0.0-dev",
        "protocolversion": 70015,
        "walletversion": 0,
        "balance": 0,
        "blocks": 1722115,
        "timeoffset": 0,
        "connections": 12,
        "proxy": "",
        "difficulty": 1,
        "testnet": true,
        "keypoololdest": 0,
        "keypoolsize": 0,
        "unlocked_until": 0,
        "paytxfee": 0.0002,
        "relayfee": 0.00001,
        "errors": ""
    },
    "error": null,
    "id": null
}

```

**Tags:** copay, bcoin


---

## 1 answers

### Answer by username_1 on 2020-04-27. Score: 1 | Accepted answer

There are several factors that could be causing the discrepancy.

* Make sure you are running the latest version of bcoin (v2.0.0 was just released)
* Make sure your node is fully synced to the testnet blockchain.
* Make sure all the transactions in the Copay wallet history are confirmed.

Other possible issues:

* Do you make a lot of transactions with this wallet? Like, more than 10 or so in a single block? It's possible you've exceeded the BIP44 lookahead and some manual configuration may be necessary to recover all the transactions (although this particular behavior is usually fixed with an additional rescan)
* When you rescan, do you specify a block height to rescan from? Make sure that is low enough to catch your complete transaction history.

Compare the history of the two wallets (<https://bcoin.io/api-docs/?shell--cli#get-wallet-tx-history>). Can you determine which TXs are missing from the bcoin wallet? It might be helpful for debugging if we can identify a pattern.

If you want more interactive help debugging, you can find the developers on IRC #bcoin or on slack: <https://bcoin.io/slack-signup.html>

> **Comments:**
> **username_0**: thanks for the hints. besides the history comparisson of the transaction I´ve done/checked all several times. As I use this wallet for testing purpose it might be possible that there are several transactions within the same block.  
> **username_0**: I´ve started rescans with different height. Also started one now with heigth: 1 which should get all affected addresses, right? Also is there a way to totally drop the wallet or do I have to stop bcoin and drop the wallet files manually? thanks in advance.  
> **username_1**: Yes rescanning from 0 or 1 should scan the entire blockchain. There are methods in the library to delete a wallet but they are not exposed in the API for obvious reasons. You could remove the directory `~/.bcoin/testnet/wallet` and relaunch to generate a new wallet database. You can also just create a new wallet with the API and ignore the old one.  
> **username_0**: comparing the transactions showed up with some trx not known by bcoin. can those be imported by api in any way or how to update bcoin?  
> **username_1**: You could try https://bcoin.io/api-docs/#importprunedfunds but I'm more concerned with why bcoin didn't import the tx during the rescan. It could be you have large gaps in the bip44 path, and bcoin is not deriving enough addresses in advance.  
> **username_0**: I´m confused why they are not imported... here a sample (1. imported, 2. not, 3. imported, 4. not) ```2019-02-13T08:39:56.000Z,,,0.01000000,BTC,c1e055df1d09fb2a57a04b60493f3874a2d48eac40cc511d744f53ec9368799c,,, 2019-02-13T08:19:48.000Z,,,0.11430071,BTC,b436c66d6d445352dcc650756656d8582bf2a7b946c2218afc669d73d44099ff,,, 2019-02-12T07:39:14.000Z,,,0.01000000,BTC,abeb2f54429f26a004162f5206d666dcc423c660f669f37225fab0b98c80f311,,, 2019-02-12T07:39:14.000Z,,,0.01000000,BTC,d23cc9771182248548b9023a9c855fdea7c3c700d2813e9d78c023f9462972f5,,,```  
> **username_0**: 221/305 trx unknown by bcoin.  
> **username_1**: Change this value to `1000` and rescan again: https://github.com/bcoin-org/bcoin/blob/master/lib/wallet/account.js#L54  
> **username_0**: does not bring the expected result. is there any way to check the status of the node? I´m currently using https://bcoin.io/api-docs/#get-server-info but this gives me only a limited result, and not the full dataset like in the documentation:(see OP)  
> **username_1**: Use the HTTP API getinfo (the call you actually linked to in this last comment) instead of the RPC call. But your node looks synced. Please join us on slack or IRC so we can chat and debug more, I think this is getting a little too long for SE.  

---

