Author

Topic: How can I use electrum to receive payments on my site? (Read 160 times)

legendary
Activity: 2744
Merit: 3096
Top Crypto Casino
* Create 1 bitcoin address for every user that registers (I don't know if this is is how would I should be doing it since it could be resource intensive, but either this or 1 for every X users.
I wouldn't recommend doing that. If you value your customer's privacy then you should generate a unique address for each one of them. It would be even better if you assign a new/unused address for each order. This will also make tracking orders much easier as you won't be confused about who paid for what.

Here is the documentation on how to use Electrum as a payment gateway:
How to accept Bitcoin on a website using Electrum
It looks like the Electrum merchant project hasn't been updated for too long! You should probably look for a better alternative.
legendary
Activity: 3668
Merit: 6382
Looking for campaign manager? Contact icopress!
* Create 1 bitcoin address for every user that registers (I don't know if this is is how would I should be doing it since it could be resource intensive, but either this or 1 for every X users.

If the number of users is going to be at least thousands, Electrum may start showing performance issues. So it would be much better to use software designed for your kind of use cases. I think that BTCPay should be much more appropriate.
legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
Electrum RPC is okay, it gets increasingly slower as you increase the number of addresses to query. Bitcoin Core would offer a far better solution than this. Unless your estimated total number of addresses it <1000, then you need to seek an alternative. Most servers don't allow for that many addresses to be subscribed to at the same time.

If you insist on using Electrum, you can subscribe to a callback address and a POST will be sent to your indicated address once the status changes (new TX, >1 confirmation). You have to query it yourself for the actual transaction details after.
copper member
Activity: 2142
Merit: 1305
Limited in number. Limitless in potential.
* Create 1 bitcoin address for every user that registers (I don't know if this is is how would I should be doing it since it could be resource intensive, but either this or 1 for every X users.
I guess blockonomics btc address generation getNewAddress() and getBalance(address) for checking balance can help you, it's much easier to use imo.

They didn't charge fee for this if you don't use their callback feature for payment status which probably you'll use for receiving payment, good thing the first 10 tx is free.

To avoid having the same address, just insert it to your database along with the users' info.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
Electrum is a lightweight client. It's a wallet designed to be used for your transactions using Bitcoin, not for automated receival, if that's what you want. You'll find it much easier to use the BTCPay Server which is mentioned above. You can, then, be able to see your addresses' balance through Electrum personally.

* Create 1 bitcoin address for every user that registers (I don't know if this is is how would I should be doing it since it could be resource intensive, but either this or 1 for every X users.
Make that “X” —> “1”. You should never reuse any addresses. Each customer should be asked to fund a unique address for a specific purchase.
legendary
Activity: 3472
Merit: 3217
Playbet.io - Crypto Casino and Sportsbook
I think if you are going to use BTCpayserver as suggested above you will need to implement API on NodeJS.

You can follow this guide below for installation.

- https://github.com/btcpayserver/node-btcpay

Blockonomics is another alternative check the installation guide below.

- https://github.com/blockonomics/blockonomics-node

Then check the Blockonomics API documentation here https://www.blockonomics.co/views/api.html
legendary
Activity: 2702
Merit: 4002
Hey, so I am creating a website and I do know there exists several solutions already but I want to learn more and create something myself, even tho it's common to say "do not reinvent the wheel", I want to do just this to simply learn.
You can learn more with perfect tools. Not all tools are good for all things.
Electrum was developed to be a personal wallet with an easy interface, so it is not designed for sites that require multiple addresses and their management. There is a lot of open source software above link or build a new tool yourself.

You can then attach it to Electrum or any hardware wallet for more security.
legendary
Activity: 2730
Merit: 7065
I know that it's not what you are asking for, but if it doesn't have to be Electrum, have you given any thoughts on BTCPay Server? It's free, fully open-source, and you pay no additional fees.

I have bookmarked Awesome Bitcoin Payment Processors some time ago after someone recommended it in a post.
It's a list of different bitcoin processors that you can integrate within your website to accept bitcoin. Take a look and see if you can find anything useful on the list.
newbie
Activity: 1
Merit: 0
Hey, so I am creating a website and I do know there exists several solutions already but I want to learn more and create something myself, even tho it's common to say "do not reinvent the wheel", I want to do just this to simply learn. I am using a nodejs backend, and I am just confused by the electrum docs (http://docs.electrum.org/en/latest/), I want to know how I could, or if this is an bad idea.

* Create 1 bitcoin address for every user that registers (I don't know if this is is how would I should be doing it since it could be resource intensive, but either this or 1 for every X users.

* Actively check for payments on that address and then credit the user.


I saw something on github which is sort of what I want (https://github.com/guerrerocarlos/bitcoin-receive-payments)

But I want some more explanation on the topic and would be grateful for such, maybe even an explanation on how I could use electrum for this as I know ElectrumX exists.
Jump to: