0

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
}
1

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

| improve this answer | |
  • 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 Apr 27 at 12:22
  • 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 Apr 27 at 12:50
  • 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. – pinhead Apr 27 at 13:32
  • 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 Apr 27 at 14:58
  • 1
    Change this value to 1000 and rescan again: github.com/bcoin-org/bcoin/blob/master/lib/wallet/… – pinhead Apr 27 at 16:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.