2

I've exported my xpub from bluewallet and generated a few derived addresses from it using invoice numbers as derivation indexes. Then I sent a few sats to one of those address as a test. As I'm new learning this technology, I got surprised because the wallet didn't show the balance. I made a small research and realized that the wallet doesn't monitor all the addresses derived from my xpub, it only tracks incoming transactions for 20 addresses by default.

Said that I have a few questions:

1- To maintain a record of the real balance, should I request a Bitcoin/API node asking for info related to each derived addresses?

2- There's any wallet I can use to monitor specific derived addresses and allows me to spend that balance?

3- How can I spend that balance without a wallet or compromising my seed?

Context: I'm learning how to process Bitcoin payments with nodejs.

Thanks so much in advance!

2
  • Increasing gap limit or importing specific addresses can fix this issue IMO
    – user103136
    Commented Mar 2, 2022 at 11:42
  • How can I import a specific address? Commented Mar 3, 2022 at 3:31

1 Answer 1

1

I have spent many hours learning about this and now I have the answers for all my questions.

1- To maintain a real balance of how many sats I have, I needed to make calls to an API as I'm not running a full Bitcoin node. The API requires an address and gives you UTXOs for each address (Unspent transactions outputs). I had to collect all the addresses, make an API call for each address, and sum the value of all those UTXOs to obtain my real balance.

2- At the moment I haven't found a wallet that monitor a large number of addresses. In my case addresses are derived using invoice numbers as derivation index. Just imagine that a client that make a purchase in my website generates the order_id number 2567, this means that if he/she chooses to pay with Bitcoin I will use BIP84 to generate an address from my extended public key using 2567 as derivation index. So the wallet should be able to monitor thousands of addresses, and I haven't seen that so far.

3- Finally, without a wallet to monitor all the required address and spend sats received on them, I had to learn how to create PSBT by myself. That allows me to use specific addresses as inputs, outputs, define optimum fees based in the Blockchain information and also define a new address to receive change. And the most important, I can create this PSTB offline and sign it without compromising my private keys, and then just broadcast the transition hex.

All these three points may be obvious for many devs here, but I'm a newbie so I'm very happy to learn new things and answer my own questions...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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