Bitcoin Forum
April 25, 2024, 05:04:19 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: WalletNotify with Multiple Wallet on Same Node  (Read 278 times)
gladiator9120 (OP)
Newbie
*
Offline Offline

Activity: 21
Merit: 0


View Profile WWW
June 10, 2019, 02:20:25 PM
 #1

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 ?
Be very wary of relying on JavaScript for security on crypto sites. The site can change the JavaScript at any time unless you take unusual precautions, and browsers are not generally known for their airtight security.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714021459
Hero Member
*
Offline Offline

Posts: 1714021459

View Profile Personal Message (Offline)

Ignore
1714021459
Reply with quote  #2

1714021459
Report to moderator
1714021459
Hero Member
*
Offline Offline

Posts: 1714021459

View Profile Personal Message (Offline)

Ignore
1714021459
Reply with quote  #2

1714021459
Report to moderator
1714021459
Hero Member
*
Offline Offline

Posts: 1714021459

View Profile Personal Message (Offline)

Ignore
1714021459
Reply with quote  #2

1714021459
Report to moderator
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3374
Merit: 6535


Just writing some code


View Profile WWW
June 10, 2019, 08:29:40 PM
 #2

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.

gladiator9120 (OP)
Newbie
*
Offline Offline

Activity: 21
Merit: 0


View Profile WWW
June 11, 2019, 05:14:27 AM
 #3

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.
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
June 11, 2019, 08:55:48 AM
 #4

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.


█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3374
Merit: 6535


Just writing some code


View Profile WWW
June 11, 2019, 05:09:16 PM
 #5

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.

gladiator9120 (OP)
Newbie
*
Offline Offline

Activity: 21
Merit: 0


View Profile WWW
June 12, 2019, 03:19:10 PM
 #6

Gotcha ! Thanks.
keychainX
Member
**
Offline Offline

Activity: 374
Merit: 53

Telegram @keychainX


View Profile WWW
June 21, 2019, 06:36:21 AM
 #7

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

gladiator9120 (OP)
Newbie
*
Offline Offline

Activity: 21
Merit: 0


View Profile WWW
June 21, 2019, 03:52:44 PM
Last edit: June 21, 2019, 04:03:46 PM by gladiator9120
 #8

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 <txID> to find the wallet address and then compare it with the DB #1.

Correct me if I am wrong. 

Thanks.
Sapphire
Newbie
*
Offline Offline

Activity: 38
Merit: 0


View Profile
December 09, 2020, 04:31:40 PM
 #9

gladiator9120, have you found a solution?
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!