1

I am using the bitcoin-rpc and everytime i create an invoice from a PHP script, i create a new address. All is ok, i get the money after, i have a script that checks number of confirmations, then when i try to send my money back to another wallet i see 300 400 usd in fees

bitcoin-cli sendtoaddress "MY_BIG_WALLET" 0.1 "" "" true

When i look on blockchain i see that that everything were sent from every address that i have created

ADDRESS1 ... 0.06

ADDRESS2 ... 0.03

ADDRESS2 ... 0.078

... and so on

Fees are way to big ... How can i send everything from one big address and pay only 20$ usd fee [the default bitcoin fee, i see on some services, 5 usd]?

I believe i pay per vbyte ... but i want to send internally with low or no fees or something.

How big payment gateways like coingate/coinpayments/bitpay are doing this? They too create an adress for every transaction ...

Thank you.

1 Answer 1

1

Fees are way to big ... How can i send everything from one big address and pay only 20$ usd fee [the default bitcoin fee, i see on some services, 5 usd]?

To spend from a bigger amount instead of several small, you must have it. If you fragment your bitcoin holdings sending small amount (for testing purpose or any other reason) to your other addresses, then when you would send it further, you should bind several of them, taking up more space on the blockchain and consequently paying higher fee.
You choose the fee amount, maybe you overpay it ... anyway there is many factor that are involved in fee calculation so there is many ways to minimizing them, you can start here: https://en.bitcoin.it/wiki/Techniques_to_reduce_transaction_fees

I believe i pay per vbyte ... but i want to send internally with low or no fees or something.

There is not "send internally": either you can use Bitcoin testnet, that works with valueless testbitcoin you can have for free, or you use mainnet and your transactions pay as any other.

How big payment gateways like coingate/coinpayments/bitpay are doing this? They too create an address for every transaction ...

When payment gateways make payments, they aggregate them: they aggregate multiple inputs (customer deposits) with multiple output (customer withdrawals) in a single big transaction that pay a very big fee, but which is always lower than they would pay with many small transactions; moreover they collecting 5$ you say from any single customer that is paid with the big transaction (and some service also from customers who deposit).

16
  • i have like 100 address sending on one big wallet, i pay 500usd sometimes ... for a transaction ... so the big payment gateways are making some sort of custom transaction for what i understood ... more details for that please ? i mean how can i have a payment system that accepts on multiple wallets, lets say 100 but don't have to pay such amount of big fee ...
    – dotifag851
    Commented Mar 30, 2021 at 10:07
  • I'm not sure i understood why you want to send from 100 addresses to one ... if you setup an address for each of your customer, all these address belong to your wallet (and then contribute to your total wallet balance) but when users deposit funds to the address you assigned them, they will pay the bitcoin network fees. After that if you should pay customers withdrawals, you can wait minutes or hours to have a large number of withdrawals and then aggregate them in one big transaction that take funds from all (or many) deposits made on your addresses and pay all withdrawals users requested. Commented Mar 30, 2021 at 12:22
  • a Bitcoin transaction with multiple input and multiple output is the standard, is not a "sort of custom transaction". Commented Mar 30, 2021 at 12:23
  • "i'm not sure i understood why you want to send from 100 addresses to one" - i am getting the funds from them trough multiple addresses so i can know who sent what then i must send all those coins to my big account, there is no such thing as user withdrawing, only i get all the coins to my big wallet ... big payment gateway do the same, they create a wallet for every transaction ...
    – dotifag851
    Commented Mar 31, 2021 at 7:44
  • 1
    This is unrelated to the number of addresses involved. Any output being spent costs fees, regardless of whether they're to the same address or not. Commented Apr 28, 2021 at 18:30

Not the answer you're looking for? Browse other questions tagged or ask your own question.