Bitcoin Forum

Bitcoin => Electrum => Topic started by: nahlawi on December 15, 2016, 08:41:20 PM



Title: Payment Forwarder
Post by: nahlawi on December 15, 2016, 08:41:20 PM
I'm building a commerce page accepting BTC based on Electrum (not bitcoind to avoid blockchain download).
Currently using Ubuntu 16.04 (without GUI) and Electrum 2.7.12 client
Looking to aggregate store payments to autopay into a another merchant wallet in the background (without password prompt if possible) to avoid stealing amounts of online wallet.
something similar to: getbalance "if > 0" then payto someaddress

most appreciated in advance

If possible, can someone post "best-Practices" for installing SECURE electrum wallet for a web server?


Title: Re: Payment Forwarder
Post by: Abdussamad on December 16, 2016, 12:00:00 PM
Since electrum is a deterministic wallet it is possible to derive all the addresses in the wallet with the extended public key which is also known as the master public key (MPK). You cannot derive private keys with just the MPK and without the private keys you cannot spend your bitcoins. So it is safe to install the MPK on your web server and let it generate addresses for users to send money to without any risk of theft. This is how bitcoin payments for woocommerce (https://wordpress.org/plugins/bitcoin-payments-for-woocommerce/) does it. It is also how mycelium gear (https://gear.mycelium.com) works. It is how you should do things too.

You haven't mentioned which shopping cart software you are using? Perhaps there is a bitcoin plugin for that. Otherwise I can point you to opensource deterministic address derivation libraries in the programming language that cart is written in so you can make your own.


Title: Re: Payment Forwarder
Post by: nahlawi on December 16, 2016, 08:09:10 PM
Yeah, I've been discovering MPK option on Web server to generate addresses while controlling payments from real wallet somewhere else.
For shopping cart, I'm still wondering around bitpay. It would be lovely if you could point me to one working with Electrum with minimum hustle. Note we'll have Dollars and BTC and might add other Crypto coins (Electrum integration is key driver here).
One more request, I noticed somewhere in the forum that Elecrum uses mBTC and not BTC in command line? Can you please confirm and if there's comething we can do other than modifying our calculations in code.
Thanks