-
Notifications
You must be signed in to change notification settings - Fork 809
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Best way to monitor HD wallet balance using only xpub (watch mode) #673
Comments
You can run a pruned node or an SPV node. (Soon we will have Neutrino client available as well!) Pruned node: SPV node: Once you have a node running you can create a watch-only wallet and import your xpub.
Then you can query the wallet any time (lots more at https://bcoin.io/api-docs)
...etc Let me know if this helps. If you really want to run a wallet without any network at all, the wallet is a separate module and can be run without a node, but you wouldn't be able to get its balance or tx history, just generate addresses basically. |
Ok got it. I will consider |
There are socket events that are also useful for this, so that you can get live updates of when you receive a transaction |
Thanks for your anwsers. @pinheadmz I'm wondering if when running in Also, how slower is |
In prune mode you can only rescan as many blocks as you have on disk, which is only two days worth. Actually now it is a dangerous unchecked situation, I have a PR to return an error: #532 Prune takes as long as Full - it must download and verify the entire blockchain. SPV is very fast (less than hour depending on your machine) If you want to describe more the application you are building here or on slack, I might have more ideas for you |
Hey, I'm creating a watch-only wallet with a full node. If I'm only given an xpub and the user of this wallet is generating receiving addresses in their private wallet. Will bcoin be able to detect transactions that are outside of the "account depth" of the wallet? I want to use the sockets API to be alerted when transaction occur in the wallet. But my impression is that we will have to create some mechanism that guarantees that any receiving address the end-user has generated is within the account depth index. Is this correct? |
@JoePotentier For each account, bcoin has a Line 54 in f1abba5
So if the user generates more than 10 addresses without receiving any transactions then yes, potentially the watch only wallet will fall behind. If the user actually receives TXs on the blockchain within that window, your watch-only wallet will be able to keep up. If you think the user might end up large gaps in the BIP32 account, you may want to pre-derive more addresses on your side. |
Hello,
I was wondering what is the easiest way to monitor a wallet whole balance having only the wallet xpub key (implementing a simple watch service) without having to maintain my own bitcoin node.
Any recommendation on this, using bcoin?
Many thanks!
The text was updated successfully, but these errors were encountered: