Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: chainofzee on June 02, 2020, 02:57:58 PM



Title: Trx Fee
Post by: chainofzee on June 02, 2020, 02:57:58 PM
hi,

do we pay anything other than miners' fee for a transaction?
if not, why isn't it possible to send a dust even by setting the miner fee to zero?


Title: Re: Trx Fee
Post by: AB de Royse777 on June 02, 2020, 03:02:57 PM
If no miner includes your Tx in a block then your Tx never gets confirmed so it's not going to work without paying the miners.

Quote
do we pay anything other than miners' fee for a transaction?
No, as I understand.


Title: Re: Trx Fee
Post by: bob123 on June 02, 2020, 03:11:50 PM
do we pay anything other than miners' fee for a transaction?

No.


if not, why isn't it possible to send a dust even by setting the miner fee to zero?

Because the minimum fee is 1 sat/B.
Anything below that, won't get relayed by the nodes. Therefore such a transaction would never reach a miner and would never be included.
If you are running a mining pool, you are of course free to include 0 sat/B transactions. They are valid. It is just that they won't get relayed by nodes.

A dust output is an output which costs more in fees to be transferred. You would lose money transferring it.


Title: Re: Trx Fee
Post by: chainofzee on June 02, 2020, 04:24:07 PM
thank u both;very useful answers :)


Title: Re: Trx Fee
Post by: Csmiami on June 02, 2020, 06:59:44 PM
Since this thread is in the Electrum board; I'd like to point out that in the event of using Electrum with 2FA, you do pay a fee to TrustedCoin. The charge the following fees, depending on what you choose:

Pay every 20 transactions:   0.00005 BTC/tx        0.001 BTC total
Pay every 100 transactions:   0.000025 BTC/tx        0.0025 BTC total

Other than that, the only fee that you pay goes to miners (in Electrum)


Title: Re: Trx Fee
Post by: Rath_ on June 02, 2020, 08:32:10 PM
Because the minimum fee is 1 sat/B.
Anything below that, won't get relayed by the nodes. Therefore such a transaction would never reach a miner and would never be included.

minRelayFee is freely configurable by node operators, so there should be some nodes accepting < 1 sat/byte transactions. As far as I remember, the default value was supposed to be decreased in some Bitcoin Core update, but I am not sure if it's still relevant. I could only find this (https://github.com/bitcoin/bitcoin/issues/14012).


Title: Re: Trx Fee
Post by: bob123 on June 03, 2020, 10:45:15 AM
minRelayFee is freely configurable by node operators, so there should be some nodes accepting < 1 sat/byte transactions. As far as I remember, the default value was supposed to be decreased in some Bitcoin Core update, but I am not sure if it's still relevant. I could only find this (https://github.com/bitcoin/bitcoin/issues/14012).

While this is true, i doubt that a lot of people did change their settings to relay transactions with a fee lower than 1 sat/B.
The majority of the network won't accept them, and it will probably never reach a miner (and even if it does, i doubt they would accept them given the fact that there are almost always transactions with at least 1 sat/B waiting to get confirmed).


Title: Re: Trx Fee
Post by: konfuzius5278 on June 03, 2020, 11:17:50 AM
Just I am curious:
There is also a minimum Transaction size I think in Bitcoin Core. Yuu can not send 100 sat.

I tried that when I wanted to send 100 sat to Waren Buffet wallet.



Title: Re: Trx Fee
Post by: bob123 on June 03, 2020, 11:39:34 AM
Just I am curious:
There is also a minimum Transaction size I think in Bitcoin Core. Yuu can not send 100 sat.

The size of a transaction is not determined by the amount of BTC you are transacting.
It is determined by the amount of Inputs and Outputs of a transaction. For a legacy transaction, thats ~192 bytes. Segwit is at ~138 vbytes (assuming  the minimum of 1 input and 1 output).
Whether this is 100 sats or 10 BTC doesn't matter as long as its 1 input.

You were not able to send 100 sats because the fee with 1 sat/B (smallest fee for your TX to be relayed) and more than 100 bytes in transaction size, results in a fee higher than the amount you are going to send.
You would be generating a dust output. And therefore the electrum server did not accept that.




Title: Re: Trx Fee
Post by: Pmalek on June 03, 2020, 07:44:52 PM
You never specified where you are sending from. If it is from your own private wallet, you will only be paying the miners to include your transaction in a block. If you are sending or withdrawing from a 3rd party service, like an exchange, you are also paying withdrawal/service fees.   


Title: Re: Trx Fee
Post by: chainofzee on June 03, 2020, 07:55:45 PM
The size of a transaction is not determined by the amount of BTC you are transacting.
It is determined by the amount of Inputs and Outputs of a transaction. For a legacy transaction, thats ~192 bytes. Segwit is at ~138 vbytes (assuming  the minimum of 1 input and 1 output).
Whether this is 100 sats or 10 BTC doesn't matter as long as its 1 input.

how could sb include more than 1 inputs?
as I understand we could only have 1 input and 1/more outputs.
isn't that the case?


Title: Re: Trx Fee
Post by: hosseinimr93 on June 03, 2020, 09:00:30 PM
how could sb include more than 1 inputs?
as I understand we could only have 1 input and 1/more outputs.
isn't that the case?
You can send from any number of inputs to any number of outputs.

Let's say you have a wallet with addresses A and B. You receive 0.01 BTC in address A and 0.02 BTC in address B. If you want to send 0.03 BTC to someone, your wallet will send the 0.03 BTC from addresses A and B. Here the transaction you make includes 2 inputs.

Even if addresses A and B belong to different wallets, you can import both of them into a single wallet (if you have their private key) and send the entire balance or a part of that in a single transaction.

Go to a bitcoin explorer (e.g. Blockchain (https://www.blockchain.com/explorer), Blockchair (https://blockchair.com/bitcoin), blockstream (https://blockstream.info/)). You can find numerous transactions with multiple inputs and multiple outputs.


Title: Re: Trx Fee
Post by: HCP on June 03, 2020, 09:21:51 PM
Just I am curious:
There is also a minimum Transaction sizeOutput Amount I think in Bitcoin Core. Yuu can not send 100 sat.
Sats are not related to transaction size.

The reason your transaction failed is because there are inbuilt mechanisms to prevent the creation of "dust"... as bob123 mentioned, "dust" is defined as any output that would cost more to spend than it is worth.

Currently, this is defined in the Bitcoin Core code (https://github.com/bitcoin/bitcoin/blob/99813a9745fe10a58bedd7a4cb721faf14f907a4/src/policy/policy.cpp#L14-L29) as:
   // "Dust" is defined in terms of dustRelayFee,
    // which has units satoshis-per-kilobyte.
    // If you'd pay more in fees than the value of the output
    // to spend something, then we consider it dust.


    // A typical spendable non-segwit txout is 34 bytes big, and will
    // need a CTxIn of at least 148 bytes to spend:
    // so dust is a spendable txout less than
    // 182*dustRelayFee/1000 (in satoshis).
    // 546 satoshis at the default rate of 3000 sat/kB.


    // A typical spendable segwit txout is 31 bytes big, and will
    // need a CTxIn of at least 67 bytes to spend:
    // so dust is a spendable txout less than
    // 98*dustRelayFee/1000 (in satoshis).
    // 294 satoshis at the default rate of 3000 sat/kB.
NOTE: quoted edited for clarity.


So, if it is a "legacy" UTXO being created, it has to be at least 546 sats... if it is a "segwit" UTXO being created, it has to be at least 294 sats


I tried that when I wanted to send 100 sat to Waren Buffet wallet.
Try sending Warren Buffet 546 sats (or 294 if he has a segwit address) :P


Title: Re: Trx Fee
Post by: bittraffic on June 03, 2020, 09:53:07 PM
how could sb include more than 1 inputs?
as I understand we could only have 1 input and 1/more outputs.
isn't that the case?
You can send from any number of inputs to any number of outputs.

Let's say you have a wallet with addresses A and B. You receive 0.01 BTC in address A and 0.02 BTC in address B. If you want to send 0.03 BTC to someone, your wallet will send the 0.03 BTC from addresses A and B. Here the transaction you make includes 2 inputs.

Even if addresses A and B belong to different wallets, you can import both of them into a single wallet (if you have their private key) and send the entire balance or a part of that in a single transaction.

Go to a bitcoin explorer (e.g. Blockchain (https://www.blockchain.com/explorer), Blockchair (https://blockchair.com/bitcoin), blockstream (https://blockstream.info/)). You can find numerous transactions with multiple inputs and multiple outputs.


Wow that is something I learn today. If I have a bitcoincore wallet and import it to an electrum wallet that means both addresses are in my electrum app which all their BTC are added up? 

I haven't really explored much the wallets since I have only installed one, to be honest. Bitcoincore syncs too slow on my computer but I still have it with some coins on it. Now I might just try synchronizing it.


Title: Re: Trx Fee
Post by: pooya87 on June 04, 2020, 02:42:12 AM
I tried that when I wanted to send 100 sat to Waren Buffet wallet.

Warren Buffet doesn't have a bitcoin wallet .... that is publicly known. whatever you think you have is a random address and when you send small amounts you are just spamming the bitcoin network and putting an unnecessary burden on all bitcoin nodes that have to store that pointless UTXO in their database and load it each time!


Title: Re: Trx Fee
Post by: bob123 on June 04, 2020, 08:10:48 AM
how could sb include more than 1 inputs?
as I understand we could only have 1 input and 1/more outputs.
isn't that the case?

You can include as many inputs and outputs as you want.
Of course there is a limit. The current limit for the maximum size of a transaction is ~100 kB. That's way higher than your transaction should get.

Note that if you receive multiple transactions to the same address, these are all different UTXO's.
If you receive 10 x 0.1 BTC to address X and send your whole BTC from address X, your transaction will have 10 inputs.



Wow that is something I learn today. If I have a bitcoincore wallet and import it to an electrum wallet that means both addresses are in my electrum app which all their BTC are added up? 

You can not directly import your core wallet into electrum.
And AFAIK you can't import private keys into an HD electrum wallet (not absolutely sure about that).

But if you create a wallet with your private keys from electrum and from core, yes. The BTC will add and you can send the whole amount in a single transaction.



Title: Re: Trx Fee
Post by: chainofzee on June 04, 2020, 08:37:31 AM
how could sb include more than 1 inputs?
as I understand we could only have 1 input and 1/more outputs.
isn't that the case?
You can send from any number of inputs to any number of outputs.

Let's say you have a wallet with addresses A and B. You receive 0.01 BTC in address A and 0.02 BTC in address B. If you want to send 0.03 BTC to someone, your wallet will send the 0.03 BTC from addresses A and B. Here the transaction you make includes 2 inputs.

Even if addresses A and B belong to different wallets, you can import both of them into a single wallet (if you have their private key) and send the entire balance or a part of that in a single transaction.

Go to a bitcoin explorer (e.g. Blockchain (https://www.blockchain.com/explorer), Blockchair (https://blockchair.com/bitcoin), blockstream (https://blockstream.info/)). You can find numerous transactions with multiple inputs and multiple outputs.


Thanks :)
but how do we do that and y not combining b4 sending?

Say in this example:
https://www.blockchain.com/btc/tx/90dd555f7169a648f8954a455717489574c7cb8f0fce0f0b4e17804e5fbc4079
both of them belong to the same wallet (or address). how would u make it 2?
does the wallet have this feature? cause im seeing only one "pay to" option in my wallets.


or in this tx:
https://www.blockchain.com/btc/tx/ea012762ac74497e64c2e126d2e1f07144e16a793c7ce0aaba25b4125afc21e4
How do u create these inputs?


Title: Re: Trx Fee
Post by: bob123 on June 04, 2020, 08:50:34 AM
How do u create these inputs?

Your wallet is doing this in the background.

All you have to do is set the amount you want to send and the receipent.
Your wallet will figure out which inputs to use.


In electrum, if you want to set the inputs yourself, you can go to the "Coins" tab -> Select multiple UTXO's and click on "Spend".
You'll see the chosen inputs when signing/broadcasting the transaction.


Title: Re: Trx Fee
Post by: HCP on June 04, 2020, 09:09:47 AM
... y not combining b4 sending?
Because that's the way Bitcoin works... it's not like a bank account where they just keep adding numbers to your balance when you deposit and you can take out an exact amount later on.

Bitcoin is more like chunks of gold... and every piece you receive stays like that until you want to spend it, so you end up with different sized chunks worth different amounts. So you might have a 0.01 BTC chunk, a 0.02 BTC chunk, a 0.008 BTC chunk etc... when you want to send some to someone, you can't just break a piece off... you have to give whole chunks to the miners to break down for you...

So, if you have received the following amounts in your wallet:

0.01 BTC
0.02 BTC
0.008 BTC

And you want to send 0.017 BTC to your friend... your wallet would most likely select the 0.02 chunk and tell the miners to break off 0.017 and give that to the recipient, and return the rest to you as "change"... The transaction would look like:

InputA: 0.02BTC ---> OutputA: 0.017 BTC
                         ---> OutputB: 0.003 BTC

OutputB would be your change.

Or... the wallet might decide to do it like this:

InputA: 0.01   ---> OutputA: 0.017
InputB: 0.008  ---> OutputB: 0.001

or it could use any other combination of 0.01, 0.02 and/or 0.008 that enabled the wallet to be able to create the 0.017 piece  that you're trying to send and then give the rest back to you as change (minus the transaction fee)


Title: Re: Trx Fee
Post by: konfuzius5278 on June 09, 2020, 01:59:02 PM
I tried that when I wanted to send 100 sat to Waren Buffet wallet.

Warren Buffet doesn't have a bitcoin wallet .... that is publicly known. whatever you think you have is a random address and when you send small amounts you are just spamming the bitcoin network and putting an unnecessary burden on all bitcoin nodes that have to store that pointless UTXO in their database and load it each time!
1) I paid fee of 0.00000422 BTC for the 1000 sat TX so its my right beeing on the chain.

2) It was published as it was given to him after this dinner date so its false information that it does not exists:
https://medium.com/@TronFoundation/what-i-learned-from-warren-buffetts-dinner-by-justin-sun-2fc9f4c3f7a0


Title: Re: Trx Fee
Post by: Betwrong on June 09, 2020, 02:53:02 PM
I tried that when I wanted to send 100 sat to Waren Buffet wallet.

Warren Buffet doesn't have a bitcoin wallet .... that is publicly known. whatever you think you have is a random address and when you send small amounts you are just spamming the bitcoin network and putting an unnecessary burden on all bitcoin nodes that have to store that pointless UTXO in their database and load it each time!
1) I paid fee of 0.00000422 BTC for the 1000 sat TX so its my right beeing on the chain.

2) It was published as it was given to him after this dinner date so its false information that it does not exists:
https://medium.com/@TronFoundation/what-i-learned-from-warren-buffetts-dinner-by-justin-sun-2fc9f4c3f7a0


You should maybe read the article from the link below too, because it is a more recent one:

https://news.bitcoin.com/warren-buffett-denies-owning-crypto/

But if you sent those 1k sats, it will be on the chain(read: in history) forever, that's true.


Title: Re: Trx Fee
Post by: pooya87 on June 10, 2020, 03:31:25 AM
I tried that when I wanted to send 100 sat to Waren Buffet wallet.

Warren Buffet doesn't have a bitcoin wallet .... that is publicly known. whatever you think you have is a random address and when you send small amounts you are just spamming the bitcoin network and putting an unnecessary burden on all bitcoin nodes that have to store that pointless UTXO in their database and load it each time!
1) I paid fee of 0.00000422 BTC for the 1000 sat TX so its my right beeing on the chain.

2) It was published as it was given to him after this dinner date so its false information that it does not exists:
https://medium.com/@TronFoundation/what-i-learned-from-warren-buffetts-dinner-by-justin-sun-2fc9f4c3f7a0

1) such transactions should confirm if the fee/byte isn't lower than 1. i can't tell without knowing the transaction size though.
2) you shouldn't really believe whatever crap you read on the internet. the link you posted is a clear and desperate attempt at advertising a shitcoin called Tron.


Title: Re: Trx Fee
Post by: HCP on June 10, 2020, 09:30:53 AM
1) I paid fee of 0.00000422 BTC for the 1000 sat TX so its my right beeing on the chain.
I guessing that it was this one back in February then: https://btc.com/a0b288b9c28e324f80ab037f3a4ad2e05f27769c71c47afe3082b6d00cf65b9c

0.00001000 BTC sent to 3AsXDKX1etLgegepVeJbhj7WeZiypVMgdt and paid 0.00000422 BTC in fees

Whether or not that address is in any way, shape or form controlled by Mr. Buffet is not really a debate I care to partake in... but your transaction will forever be in the blockchain, that much is certain.


Title: Re: Trx Fee
Post by: malevolent on June 10, 2020, 11:08:18 AM
While this is true, i doubt that a lot of people did change their settings to relay transactions with a fee lower than 1 sat/B.
The majority of the network won't accept them, and it will probably never reach a miner (and even if it does, i doubt they would accept them given the fact that there are almost always transactions with at least 1 sat/B waiting to get confirmed).

Except for busier days, it doesn't take long for 1 sat/vB to be included in a block (occasionally even as soon as in the next block), so if miners were willing to accept them, transactions cheaper than that would also be getting included in blocks. But that won't be happening until Bitcoin Core is released with lower default minimum relay fees.


Title: Re: Trx Fee
Post by: o_e_l_e_o on June 10, 2020, 12:48:10 PM
transactions cheaper than that would also be getting included in blocks.
Absolutely. Have a look at this page: https://mempool.space/. Blocks for the last 4 or 5 hours have been full, but if you scroll down to around block 634,000, there are plenty of blocks which aren't even close to being full, with some blocks as low as 30-50 kB. Since there is no reason for a miner not to fill up a block to maximize their profit from fees, transactions with fees lower than 1 sat/byte would absolutely be included in these blocks if they were being relayed.

Essentially, any time the mempool completely empties, there would have been room to include more transactions in the most recent block.