Tracking incoming transactions using nodejs and own node

790 views Asked by At

I need to verify that user from my database has sent btc to my wallet.

Ideally I want to generate a unique address for each user transaction and then track all those addresses but I suppose it will be difficult to implement due to address gap limit, so I decided to just ask users for their bitcoin address and then expecting tx with funds transfer from that address to my wallet so I can verify funds were sent by them.

So let's say I want to track all txs just to my wallet address using my own bitcoin node . As I understand, when I connect to node in live network I'll be notified about all txs that are happening in the network?

How can I validate transactions with transferring funds only to my wallet and decode address from which funds were transferred?

Are there some easy ways to implement this and maybe some code/project examples?

1

There are 1 answers

0
Fabricio Espinoza On

You should use ElectrumX protocol, its based on Satoshis Simple Payment Verification.

Its a server were you can subscribe to a Public Key so the client will receive a notification when the status of the 'script hash' changes using this method:

blockchain.scripthash.subscribe(scripthash)

You can read more on: https://electrumx.readthedocs.io/en/latest/index.html