Author

Topic: WalletNotify with Multiple Wallet on Same Node (Read 304 times)

newbie
Activity: 38
Merit: 0
December 09, 2020, 11:31:40 AM
#9
gladiator9120, have you found a solution?
newbie
Activity: 21
Merit: 0
Yes, your point sounds much more feasible.

Sorry to ask for more, but can you link me to some document that describes the implementation in bit more details. I understood the overall concept, but just want to understand it better.

To be precise, Let's say we have 1000 wallets and every wallet has two wallet addresses. That brings that total to 2000 wallet addresses that may receive BTC.

If I am understanding this correctly, I need to store all these 2000 address in DB #1 and all txID in DB #2. But what I still don't understand is that I will still have to make call to bitcoin-cli for all the txID with gettransaction to find the wallet address and then compare it with the DB #1.

Correct me if I am wrong. 

Thanks.
member
Activity: 378
Merit: 53
Telegram @keychainX
Just out of curiosity, then how does wallets like blockchain.com manage millions of wallet? They may be receiving walletnotify callback every second.

I got your point and we also thought of the same, to run loop for every wallet on our node to check for gettransaction.

You run two databases, one which is storing all tx for all transactions, one which is holding all public keys for your wallets. for each mined block you update databse #1, compare with number 2, then send notify. You can do this in python.

/KX
newbie
Activity: 21
Merit: 0
Gotcha ! Thanks.
staff
Activity: 3458
Merit: 6793
Just writing some code
Just out of curiosity, then how does wallets like blockchain.com manage millions of wallet? They may be receiving walletnotify callback every second.
They don't use Bitcoin Core. They use their own custom software to receive blocks and transactions and notify other systems.
HCP
legendary
Activity: 2086
Merit: 4361
blockchain.com don't control or manage the wallets... they are effectively just "storage" for the encrypted wallet data. So they don't need to know when coins are received to be able to "credit" a user's balance. That happens when a user logs in and the wallet then queries the server for transactions etc. via API calls.

Custodial wallets like the exchanges etc that do manage user wallets, are most likely running custom software... not a "simple" Bitcoin Core node.

newbie
Activity: 21
Merit: 0
Just out of curiosity, then how does wallets like blockchain.com manage millions of wallet? They may be receiving walletnotify callback every second.

I got your point and we also thought of the same, to run loop for every wallet on our node to check for gettransaction.
staff
Activity: 3458
Merit: 6793
Just writing some code
There is currently no way to use walletnotify with released versions of Bitcoin Core. The PR implementing the necessary changes is not yet merged and is still under review.

A dumb way to get around this issue is to just go through each wallet and call gettransaction in each one until you get the wallet that responds correctly.
newbie
Activity: 21
Merit: 0
Hi,

I am part of a fintech project and we have thousands of users. Instead of getnewaddress, we are using createwallet for all users. Everything is working pretty perfectly, except one critical part.

We are stuck with walletnotify. In our earlier mechanism, we were using one wallet with multiple addresses and thus, walletnotify was helpful. But now the problem is that walletnofity sends the txID, and when we pass the txID in separate gettransaction call, in response we get "specify -rpcwallet=<>"

Now as we ourself don't know which user has made the deposit, how do we keep track of it.

I have check github and there are a few commits on expanding the walletnotify functionality with %s and %w for wallet name. However, that still seems to be in work in progress as the latest pull didn't bring that functionality.

Can someone help how to maintain wallet per user bases and also use walletnotify ?
Jump to: