Bitcoin Forum
May 10, 2024, 11:21:10 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Easy way for remote transactions and wallet operations?  (Read 236 times)
ziggybtc9 (OP)
Newbie
*
Offline Offline

Activity: 9
Merit: 3


View Profile
August 17, 2019, 12:59:56 PM
Last edit: August 17, 2019, 01:11:35 PM by ziggybtc9
Merited by LoyceV (2)
 #1

I want to set up a server that will receive http requests (using a simple protocol I define) and perform some simple bitcoin related operations, including import of a HD wallet and pushing transactions.

I wonder what is a good way to do it. I will use an NGINX web server to receive the requests and process them with PHP (I'm also comfortable with python, just for background).

As for the operations themselves, I thought about the following options:
- Run a full bitcoin node on the server and send JSON-RPC requests to bitcoind
- Run a full node + an electrum server and send the requests to the electrum server (with electrum dameon)
- Send them to electrum daemon. No full node / electrum server.
- Don't run anything locally (except the web server) - use a third party API, such as of blockchain.com. Problem is I didn't see an api that allows import / restore of a HD wallet.

I assume there are other options I didn't think. I will appreciate your input on this.
There are several different types of Bitcoin clients. The most secure are full nodes like Bitcoin Core, but full nodes are more resource-heavy, and they must do a lengthy initial syncing process. As a result, lightweight clients with somewhat less security are commonly used.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715340070
Hero Member
*
Offline Offline

Posts: 1715340070

View Profile Personal Message (Offline)

Ignore
1715340070
Reply with quote  #2

1715340070
Report to moderator
1715340070
Hero Member
*
Offline Offline

Posts: 1715340070

View Profile Personal Message (Offline)

Ignore
1715340070
Reply with quote  #2

1715340070
Report to moderator
1715340070
Hero Member
*
Offline Offline

Posts: 1715340070

View Profile Personal Message (Offline)

Ignore
1715340070
Reply with quote  #2

1715340070
Report to moderator
ziggybtc9 (OP)
Newbie
*
Offline Offline

Activity: 9
Merit: 3


View Profile
August 18, 2019, 01:11:50 PM
 #2

Anyone?  Embarrassed
ziggybtc9 (OP)
Newbie
*
Offline Offline

Activity: 9
Merit: 3


View Profile
August 19, 2019, 10:06:11 AM
 #3

Electrum can restore a HD wallet but indeed it's tricky to handle multiple wallets at the same time there.

Another way is do it with a python library. I see that https://github.com/primal100/pybitcointools
 is archived and not maintained any longer. Any good alternatives?
ABCbits
Legendary
*
Offline Offline

Activity: 2870
Merit: 7492


Crypto Swap Exchange


View Profile
August 19, 2019, 05:15:10 PM
Merited by ziggybtc9 (1)
 #4

Electrum can restore a HD wallet but indeed it's tricky to handle multiple wallets at the same time there.

Yes, but what i meant is there's no Electrum command to import HD wallet. You don't plan to import it manually, do you?

Another way is do it with a python library. I see that https://github.com/primal100/pybitcointools
 is archived and not maintained any longer. Any good alternatives?

I don't know if it's good or not, but i'd recommend https://github.com/ofek/bit.

I tried it once and like it since it's very easy to use even for geeks like me.

█▀▀▀











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











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
ziggybtc9 (OP)
Newbie
*
Offline Offline

Activity: 9
Merit: 3


View Profile
August 20, 2019, 04:33:37 AM
Merited by ABCbits (1)
 #5

Electrum can restore a HD wallet but indeed it's tricky to handle multiple wallets at the same time there.

Yes, but what i meant is there's no Electrum command to import HD wallet. You don't plan to import it manually, do you?

The "restore" command works in the console, command line and through an RPC call. It takes a text that can have various formats including a mnemonic word list or a master private key.

See lines 151-166 in https://github.com/spesmilo/electrum/blob/master/electrum/commands.py

With Curl:
curl --data-binary '{"id":"curltext","method":"restore","params":{"text":"word1 word2 word3...""}}' http://user:password@127.0.0.1:7777

As for working with multiple wallets, that's a bit hacky but I figured out switching between them can be done by using the "setconfig" command. For example:

curl --data-binary '{"id":"curltext","method":"setconfig","params":{"key":"wallet_path","value":"path/to/wallet1"}}' http://user:password@127.0.0.1:7777

switches to wallet1 file. It's then possible to work with any number of wallet files without restarting the electrum daemon (as I previously thought will be necessary).

I wish they'd publish a full reference for the RPC API, it is tricky to figure out what goes where.

Quote
I don't know if it's good or not, but i'd recommend https://github.com/ofek/bit (https://github.com/ofek/bit).
Thanks a lot, I'll check that one as well.
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!