Bitcoin Forum
May 07, 2024, 09:54:55 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How can I use electrum to receive payments on my site?  (Read 132 times)
Pysend (OP)
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
July 21, 2021, 07:12:22 PM
 #1

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.
1715118895
Hero Member
*
Offline Offline

Posts: 1715118895

View Profile Personal Message (Offline)

Ignore
1715118895
Reply with quote  #2

1715118895
Report to moderator
1715118895
Hero Member
*
Offline Offline

Posts: 1715118895

View Profile Personal Message (Offline)

Ignore
1715118895
Reply with quote  #2

1715118895
Report to moderator
"If you don't want people to know you're a scumbag then don't be a scumbag." -- margaritahuyan
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
Pmalek
Legendary
*
Offline Offline

Activity: 2758
Merit: 7135



View Profile
July 22, 2021, 07:39:04 AM
 #2

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.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
hugeblack
Legendary
*
Offline Offline

Activity: 2506
Merit: 3647


Buy/Sell crypto at BestChange


View Profile WWW
July 22, 2021, 07:54:10 AM
 #3

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.

.BEST..CHANGE.███████████████
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
███████████████
..BUY/ SELL CRYPTO..
BitMaxz
Legendary
*
Offline Offline

Activity: 3248
Merit: 2965


Block halving is coming.


View Profile WWW
July 22, 2021, 09:04:40 AM
 #4

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

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
BlackHatCoiner
Legendary
*
Online Online

Activity: 1512
Merit: 7357


Farewell, Leo


View Profile
July 22, 2021, 09:24:30 AM
Merited by The Sceptical Chymist (2)
 #5

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.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
bL4nkcode
Copper Member
Legendary
*
Offline Offline

Activity: 2142
Merit: 1305


Limited in number. Limitless in potential.


View Profile
July 22, 2021, 02:22:31 PM
 #6

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

Activity: 2968
Merit: 4168



View Profile
July 22, 2021, 03:09:45 PM
 #7

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.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
NeuroticFish
Legendary
*
Offline Offline

Activity: 3668
Merit: 6381


Looking for campaign manager? Contact icopress!


View Profile
July 22, 2021, 06:30:00 PM
 #8

* 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.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
khaled0111
Legendary
*
Online Online

Activity: 2520
Merit: 2853


Top Crypto Casino


View Profile WWW
July 22, 2021, 10:54:10 PM
 #9

* 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.

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


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
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!