Bitcoin Forum
May 09, 2024, 10:35:11 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Setting up a Hot Wallet  (Read 99 times)
JJCeni2019 (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
November 11, 2020, 02:02:21 PM
 #1

Hello guys,

I'm trying to create a business that works similar to an Exchange and I need to setup a hot wallet because I'm starting to spend too much with mining fees due to the number of inputs in a transaction.

What I have:
  • a node wallet that has many addresses and when users want to deposit Bitcoin, they are given a specific address
  • sometimes I need to send Bitcoin and since I'm sending this from the same wallet, there are many inputs in the transaction and the mining fee is getting really big

I'm using Bitcore 0.19 as my node.

What is the best approach here? I think I need a Hot wallet and start sending Bitcoin from this wallet, but how can I set up it?

1. Can I run the hot wallet in the same node?
2. How could I send Bitcoin from the deposit wallet to the hot wallet without paying too much fee because of the high number of inputs?

Thanks a lot,
1715294111
Hero Member
*
Offline Offline

Posts: 1715294111

View Profile Personal Message (Offline)

Ignore
1715294111
Reply with quote  #2

1715294111
Report to moderator
1715294111
Hero Member
*
Offline Offline

Posts: 1715294111

View Profile Personal Message (Offline)

Ignore
1715294111
Reply with quote  #2

1715294111
Report to moderator
1715294111
Hero Member
*
Offline Offline

Posts: 1715294111

View Profile Personal Message (Offline)

Ignore
1715294111
Reply with quote  #2

1715294111
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715294111
Hero Member
*
Offline Offline

Posts: 1715294111

View Profile Personal Message (Offline)

Ignore
1715294111
Reply with quote  #2

1715294111
Report to moderator
1715294111
Hero Member
*
Offline Offline

Posts: 1715294111

View Profile Personal Message (Offline)

Ignore
1715294111
Reply with quote  #2

1715294111
Report to moderator
o_e_l_e_o
In memoriam
Legendary
*
Offline Offline

Activity: 2268
Merit: 18510


View Profile
November 11, 2020, 02:29:55 PM
 #2

I think you are confused about what a hot wallet is. It will not solve the issue of you having many inputs in a transaction.

Indeed, there is no way to solve the issue of many inputs in a transaction. If you have lots of customers depositing bitcoin separately, then you are always going to end up with lots of inputs. The only way to save money here is to consolidate all the small inputs in to one large one when the fees are low, which is usually around 0200 - 0700 UTC time.

Essentially you take many small inputs, use them all in the same transaction to pay to another address you own with a fee of 1 sat/vbyte. Then, when you need to process a withdrawal, you can do so from this one large input at a higher fee rate, but a much lower overall fee. Even better, you can process multiple withdrawals all in the same transaction using the same large input, which again would save fees over processing each withdrawal separately.
BitMaxz
Legendary
*
Online Online

Activity: 3248
Merit: 2969


Block halving is coming.


View Profile WWW
November 11, 2020, 02:42:57 PM
 #3



I don't think if this is the time to consolidate your inputs to get less fee because after 4hrs there is a big spike recently on the mempool stats and it still rising. According to https://jochen-hoenicke.de/queue/#0,2h the fastest transaction with 1mb+ is around 20+sats/bytes.

I think you will need to wait a bit or the next day if the mempool size drops to get a lesser fee.
Read this "Fees are low, use this opportunity to Consolidate your small inputs!"

About your question #1 yes you can run a hot wallet on the same PC like Electrum.
You can read this guide "Creating an Electrum Wallet"

█▀▀▀











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











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

Activity: 3
Merit: 0


View Profile
November 11, 2020, 02:59:16 PM
 #4

I think you are confused about what a hot wallet is. It will not solve the issue of you having many inputs in a transaction.

Indeed, there is no way to solve the issue of many inputs in a transaction. If you have lots of customers depositing bitcoin separately, then you are always going to end up with lots of inputs. The only way to save money here is to consolidate all the small inputs in to one large one when the fees are low, which is usually around 0200 - 0700 UTC time.

Essentially you take many small inputs, use them all in the same transaction to pay to another address you own with a fee of 1 sat/vbyte. Then, when you need to process a withdrawal, you can do so from this one large input at a higher fee rate, but a much lower overall fee. Even better, you can process multiple withdrawals all in the same transaction using the same large input, which again would save fees over processing each withdrawal separately.


Thank you for the repply!

When I was thinking about a hot wallet, it is just so I can consolidate every small input from my "deposit wallet" into another address in the hot wallet.

What I imagined was:

 - Hot Wallet used only for withdrawal, in which I would keep some Bitcoin
 - Deposit Wallet used to receive small amounts from users in several addresses
 - On a daily basis my system would consolidate some small inputs from my Deposit wallet into a single address of Hot wallet, using low fees

Another way I think is that I could use a specific address for this purpose in the same deposit wallet, but I don't know how I could consolidate small inputs into this address using bitcoin-cli.

I would probably need to select the input address manually, right?
jackg
Copper Member
Legendary
*
Offline Offline

Activity: 2856
Merit: 3071


https://bit.ly/387FXHi lightning theory


View Profile
November 11, 2020, 03:48:47 PM
 #5


When I was thinking about a hot wallet, it is just so I can consolidate every small input from my "deposit wallet" into another address in the hot wallet.

What I imagined was:

 - Hot Wallet used only for withdrawal, in which I would keep some Bitcoin
 - Deposit Wallet used to receive small amounts from users in several addresses
 - On a daily basis my system would consolidate some small inputs from my Deposit wallet into a single address of Hot wallet, using low fees

Another way I think is that I could use a specific address for this purpose in the same deposit wallet, but I don't know how I could consolidate small inputs into this address using bitcoin-cli.

I would probably need to select the input address manually, right?

Did you say how many transactions you're wanting to receive? I think you'll want to keep transactions it less than around 500 inputs and smaller transactions will confirm faster for example imo. Since blocks have more space at the end of the block they could dump a smaller transaction into but many small transactions will be more expensive.

I think you could look at setting some sor tof threshold to get an alert or send those funds when you're over that threshold (and if an individual input sends you over 10% of that target you could look to send in its own transaction (or use 25, 50 or 100%)...

Is your plan to keep the deposit wallet offline if you're saying you'll have a separate hot wallet? If that's the case you'll probably want to make a watching only wallet(if completely possible in core) which would allow you to return a raw unsigned transaction you could then sign on the offline device.
JJCeni2019 (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
November 11, 2020, 04:38:29 PM
 #6


When I was thinking about a hot wallet, it is just so I can consolidate every small input from my "deposit wallet" into another address in the hot wallet.

What I imagined was:

 - Hot Wallet used only for withdrawal, in which I would keep some Bitcoin
 - Deposit Wallet used to receive small amounts from users in several addresses
 - On a daily basis my system would consolidate some small inputs from my Deposit wallet into a single address of Hot wallet, using low fees

Another way I think is that I could use a specific address for this purpose in the same deposit wallet, but I don't know how I could consolidate small inputs into this address using bitcoin-cli.

I would probably need to select the input address manually, right?

Did you say how many transactions you're wanting to receive? I think you'll want to keep transactions it less than around 500 inputs and smaller transactions will confirm faster for example imo. Since blocks have more space at the end of the block they could dump a smaller transaction into but many small transactions will be more expensive.

I think you could look at setting some sor tof threshold to get an alert or send those funds when you're over that threshold (and if an individual input sends you over 10% of that target you could look to send in its own transaction (or use 25, 50 or 100%)...

Is your plan to keep the deposit wallet offline if you're saying you'll have a separate hot wallet? If that's the case you'll probably want to make a watching only wallet(if completely possible in core) which would allow you to return a raw unsigned transaction you could then sign on the offline device.

I already have a node up and running a deposit wallet with Bitcore. My system already identifies these deposits and there are usually more than 20 deposits a day. However, they are usually small amounts in separate addresses.

I also have a cold wallet, in which I save most of the bitcoin received.
I have users that sometime withdrawal bitcoin from the system and since I don't have a hot wallet or a specific address to send it from, I'm sending these bitcoins from my "deposit wallet".

This is where my problem is. Since my deposit wallet has many inputs, the transaction is heavy and I'm spending too much with mining fee.

What I need is a way to consolidate every small input into a single address and then, when needed (user asks for withdrawal), I would send it from this specific address (in which my system would always keep some amount of bitcoin).

My main concerns are:

- Should I create a new wallet to work as this "sending address"?

- Or can I use the same "deposit wallet" if I create a specific address just to do that?
  If so, how can I consolidate every other inputs into this specific address?
  For instance, imagine that I have 4 inputs in this wallet:
     Input A: 0.001 BTC
     Input B: 0.003 BTC
     Input C: 0.004 BTC
     Input D: 0.1 BTC <- this being the "withdrawal address"
  How could I start a transaction that would get 0.006 BTC and send it to Input D? I think I won't be able to use the "sendtoaddress" command. Will I need to create the transaction manually, sign it and then broadcast?
bob123
Legendary
*
Offline Offline

Activity: 1624
Merit: 2481



View Profile WWW
November 11, 2020, 05:39:47 PM
 #7

You shouldn't receive coins to your hot wallet at all.

What you really want is to receive coins to your cold wallet and then top up your hot wallet from your cold wallet (which automatically consolidates inputs).

You'll face two problems:
  • High fees and/or
  • Long confirmation times

It really depends on how fast your user should be able to withdraw their coins.
Does it need to happen fast? In this case, your hot wallet needs to be topped up and ready for withdrawals to be send with a relatively large fee.
Can it take a few hours/days? In this case, you can use a lower fee to top up your hot wallet (doesn't always needs to be topped up) and you can send with a lower fee by batching withdrawals.


If you are receiving lots of small transactions, you are facing the problem that you need to consolidate them.
The best way would be to consolidate them with a very small fee and use these consolidated outputs to withdraw coins with a larger fee if necessary.
Or, if the withdrawals can take time, use all the small inputs with a very small fee to pay withdrawals and to consolidate the rest at the same time.

BitMaxz
Legendary
*
Online Online

Activity: 3248
Merit: 2969


Block halving is coming.


View Profile WWW
November 11, 2020, 06:46:53 PM
 #8


- Should I create a new wallet to work as this "sending address"?

- Or can I use the same "deposit wallet" if I create a specific address just to do that?
  If so, how can I consolidate every other inputs into this specific address?
  For instance, imagine that I have 4 inputs in this wallet:
     Input A: 0.001 BTC
     Input B: 0.003 BTC
     Input C: 0.004 BTC
     Input D: 0.1 BTC <- this being the "withdrawal address"
  How could I start a transaction that would get 0.006 BTC and send it to Input D? I think I won't be able to use the "sendtoaddress" command. Will I need to create the transaction manually, sign it and then broadcast?


It would be easy if you just make a new wallet with hot wallets it won't be a problem to have them both if you know your machine is safe. You can also set up the hot wallet like electrum to act as an offline wallet by changing server or enabling proxy like this image below



Then just send all of your small inputs from Bitcoin core to Electrum to consolidate and you can send them later if someone request for withdrawal(for offline you need to make unsign transaction from 3rd party sample here https://coinb.in/#newTransaction ).

The 2nd option sending them to one of your Bitcoin core address to consolidate is great idea but why not send them all inputs from A,B and C to D?
If you actually want to get lesser fee then you should combine all inputs and turn them into a single input.

█▀▀▀











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











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

Activity: 2408
Merit: 5593


Self-proclaimed Genius


View Profile
November 12, 2020, 04:25:29 AM
 #9

 For instance, imagine that I have 4 inputs in this wallet:
     Input A: 0.001 BTC
     Input B: 0.003 BTC
     Input C: 0.004 BTC
     Input D: 0.1 BTC <- this being the "withdrawal address"
  How could I start a transaction that would get 0.006 BTC and send it to Input D? I think I won't be able to use the "sendtoaddress" command. Will I need to create the transaction manually, sign it and then broadcast?
"sendtoaddress" will work is that case.
Given the example, the "coin selection algorithm" will automatically select the best input(s) from those available 4.
I'd say it will pick Input B + Input C if you want to send 0.006 BTC using sendtoaddress.

However, you'll be needing to consolidate in real-world case since there will be a lot of much smaller UTXOs.
For that, you will definitely have to create the transaction, sign and broadcast manually if you're using Bitcoin Core's RPC.
Alternatively, the GUI have a "coin-control" feature that can be toggled on.

BTW, since you've mentioned "Bitcore", there may be more alternatives using its wallet service; but I can't help you with that.

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

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

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

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

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

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











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











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