Bitcoin Forum
May 14, 2024, 04:34:08 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Electrum on server for receiving and sending payments  (Read 268 times)
iron888 (OP)
Newbie
*
Offline Offline

Activity: 17
Merit: 0


View Profile
November 07, 2018, 07:00:44 AM
 #1

Hello,
I would like to use Electrum in the following way:
  • Generate new deposit address
  • User sends their funds to this address
  • After user deposit is received, electrum sends the funds to a different address, e.g. in cold storage
So basically use Electrum to generate addresses, receive funds and redirect funds to another place.

It is possible to do with Electrum? I was not able to find any docs how to do such things, especially working on server for receiving and redirecting.
1715661248
Hero Member
*
Offline Offline

Posts: 1715661248

View Profile Personal Message (Offline)

Ignore
1715661248
Reply with quote  #2

1715661248
Report to moderator
1715661248
Hero Member
*
Offline Offline

Posts: 1715661248

View Profile Personal Message (Offline)

Ignore
1715661248
Reply with quote  #2

1715661248
Report to moderator
"Your bitcoin is secured in a way that is physically impossible for others to access, no matter for what reason, no matter how good the excuse, no matter a majority of miners, no matter what." -- Greg Maxwell
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
bob123
Legendary
*
Offline Offline

Activity: 1624
Merit: 2481



View Profile WWW
November 07, 2018, 09:21:27 AM
 #2

Yes, you can do this with electrum.

There is no automatic 'redirection' of funds available. You'll need to program that logic yourself.

You can use RPCs to generate new addresses, check whether funds have been received and to send funds.
There isn't much more necessary to implement your concept.


Further information can be found in the documentation (http://docs.electrum.org/en/latest/). Especially under 'How to accept Bitcoin on a website using Electrum'

iron888 (OP)
Newbie
*
Offline Offline

Activity: 17
Merit: 0


View Profile
November 07, 2018, 10:14:37 AM
 #3

Thank you for the reply. Is it possible to install Electrum (not ElectrumX, just standard one) on server and access it commands?

I also saw Electrum for LTC and DASH for example. Looks like they all share the same Python command interface. Does that mean that they are also capable to do the same things as Electrum BTC does?
bob123
Legendary
*
Offline Offline

Activity: 1624
Merit: 2481



View Profile WWW
November 07, 2018, 10:46:30 AM
 #4

Thank you for the reply. Is it possible to install Electrum (not ElectrumX, just standard one) on server and access it commands?

Yes, of course.

ElectrumX is an electrum server (Clients (standard electrum) contacts electrum servers to get the block header and all necessary information).
You don't need to (and according to your post: don't want to) run an electrum server.

Note that running electrum on a server is NOT the same as running an electrum server.

Simply install electrum on your server.



I also saw Electrum for LTC and DASH for example. Looks like they all share the same Python command interface. Does that mean that they are also capable to do the same things as Electrum BTC does?

The official electrum only supports BTC. All other versions for other coins are forks.

IF they support the same commands, then yes.. they can do the same as the original electrum. But you'll have to check that first.

mocacinno
Legendary
*
Offline Offline

Activity: 3388
Merit: 4922


https://merel.mobi => buy facemasks with BTC/LTC


View Profile WWW
November 07, 2018, 10:51:22 AM
Merited by Abdussamad (1)
 #5

Just a remark here... Wouldn't it be easyer to run electrum as a daemon and create a watch only wallet by importing the cold wallet's xpub?

This way the online electrum daemon would derive addresses from the xpub, but there would be no way for a hacker to rob you, since the xprv is only stored in an offline machine. This setup will save you a lot of headache, time and fees...

I know this doesn't answer your questions directly, i was merely trying to give you a different perspective... Sometimes we get caught up in a sollution that's stuck in our mind without considering there might be better sollutions to begin with Wink

█▀▀▀











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











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
November 07, 2018, 10:56:29 AM
 #6

I also saw Electrum for LTC and DASH for example. Looks like they all share the same Python command interface. Does that mean that they are also capable to do the same things as Electrum BTC does?
Not necessarily.

NONE of the Electrum forks are created by the original Electrum Devs... they are all created by other people and may or may not support any features of the original Electrum... you would need to check with the Devs of each fork to see if it still works as intended.

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


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
iron888 (OP)
Newbie
*
Offline Offline

Activity: 17
Merit: 0


View Profile
November 07, 2018, 12:02:09 PM
 #7

Thank you for the replies guys. I will start with installation of Electrum on Linux and read the docs on commands.
Abdussamad
Legendary
*
Offline Offline

Activity: 3612
Merit: 1564



View Profile
November 08, 2018, 02:14:35 AM
Merited by mocacinno (1)
 #8

As mocacinno said there is no need for that last step. You can simply create a cold storage wallet on an offline device or via a linux live cd with the net disconnected. Then grab the master public key of that wallet via wallet menu > information and copy that to a text file on a removable drive. On the server you can create a watch only wallet with that mpk like so:

Code:
electrum restore <mpk here>

(replace <mpk here> with the actual mpk starting with xpub...)

The watch only wallet will let you generate receive addresses but not spend your bitcoins. So you basically will be receiving funds directly to your cold storage wallet without exposing your private keys to an online device.

To generate receive addresses using addrequest with the --force switch:

Code:
electrum addrequest --force 0.1

0.1 can be any amount. The command requires an amount but that doesn't affect how much someone can send you.

iron888 (OP)
Newbie
*
Offline Offline

Activity: 17
Merit: 0


View Profile
November 08, 2018, 07:54:33 AM
 #9

Thanks for the tip with watch only wallet. The thing is - I also need to send bitcoins from Electrum. Would this cold wallet solution, perhaps with some modifications, work for sending or a completely different approach is neede then?
mocacinno
Legendary
*
Offline Offline

Activity: 3388
Merit: 4922


https://merel.mobi => buy facemasks with BTC/LTC


View Profile WWW
November 08, 2018, 08:02:21 AM
 #10

Thanks for the tip with watch only wallet. The thing is - I also need to send bitcoins from Electrum. Would this cold wallet solution, perhaps with some modifications, work for sending or a completely different approach is neede then?

Sure, you can use your watch-only wallet to create unsigned transactions, then transfer them to your cold wallet for signing and back to your watch-only wallet for broadcasting.

Or, you can just install electrum on a 100% clean desktop PC that can actually connect to the internet, generate a new seed (write it down), export the xpub to your server for a watch only wallet. In this case, you can just spend your funds from the electrum wallet on your online desktop PC.. Offcourse, this setup is less secure than a real cold wallet.
A different, safer, sollution would be to use a hardware wallet and export it's xpub (and import it on your watch-only wallet on your server). This way, you could spend your funds by using your hardware wallet Wink

█▀▀▀











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











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
bob123
Legendary
*
Offline Offline

Activity: 1624
Merit: 2481



View Profile WWW
November 08, 2018, 08:03:13 AM
 #11

The idea would be that your offline-wallet (which holds the private keys) won't be vulnerable to attacks.
A wallet on an online server does always create a risk. With a watch-only wallet, you'll be able to generate receiving addresses but won't be able to send funds (since no private keys are stored).

If you then want to move funds, you'll need to do that from your offline-wallet (which is the only wallet holding the private keys).


You can't modify the watch-only wallet so that it will be able to send funds (if that's what your question was). This would be an oxymoron.

Generally this 2-wallet-setup is the best approach. Storing private keys on an online server is never a good idea. But in some cases it is required (e.g. hot wallet of an exchange).

iron888 (OP)
Newbie
*
Offline Offline

Activity: 17
Merit: 0


View Profile
November 08, 2018, 01:23:56 PM
 #12

Basically yes, I would like to create a hot wallet, but didn't really think that it is called "hot". Are there any tutorials or resources how to make an Electrum-based hot wallet on server?
mocacinno
Legendary
*
Offline Offline

Activity: 3388
Merit: 4922


https://merel.mobi => buy facemasks with BTC/LTC


View Profile WWW
November 08, 2018, 05:40:44 PM
 #13

Basically yes, I would like to create a hot wallet, but didn't really think that it is called "hot". Are there any tutorials or resources how to make an Electrum-based hot wallet on server?

If you install any full, funded wallet (be it core, electrum, btcd,...) on an online webserver and use it to automatically handle payouts, it is per defenition a hot wallet.

You can find info about the json rpc interface: http://docs.electrum.org/en/latest/merchant.html

█▀▀▀











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











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