Author

Topic: How to calculate transaction fees ? (Read 443 times)

newbie
Activity: 26
Merit: 0
February 05, 2018, 11:24:47 PM
#17
I didn't know anything about transaction fees and so much information is available here. I'll do my own research now and try to calculate the fees.
full member
Activity: 390
Merit: 157
February 05, 2018, 02:17:37 AM
#16
You can read everything about Bitcoin fees here: https://en.bitcoin.it/wiki/Transaction_fees

Wow didn't know about this and thank you though it really help me and to be honest I am doing some basic search about this , and now I know , thank's a lot though and for my opinion how to calculate the fees I think by the demand of it however the bitcoin or the cryptocurrency's price.
legendary
Activity: 3430
Merit: 3080
January 29, 2018, 07:38:14 AM
#15
I confess I haven't been looking at the explanation paragraphs below the main charts for months and you're right. The graphs themselves are still helpful, I've always used the estimation with confirmation times that more or less correspond. But the "cheapest and fastest" estimation is definitely far from accurate, at least it is right now.

I've been recommending this estimator for months now so am as guilty for possibly getting other users to pay more fees than needed. Complacency...

Yeah, like I said, I have recommended bitcoinfees.21.co in the past without fully understanding how inaccurate it's estimates can be. And like you said, the raw information on the site is perfectly usable, but those looking for a simple answer are likely to assume the estimation (or even the "fastest & cheapest") figures are good, which they're not.
legendary
Activity: 2968
Merit: 3684
Join the world-leading crypto sportsbook NOW!
January 27, 2018, 05:00:49 AM
#14
and then you crosscheck with another estimator with an easier to see structure like bitcoinfees.earn.com to see how much you need to pay per byte, for the estimated confirmation time you're comfortable with.

Strongly recommend against using bitcoinfees.earn.com (which is the same as bitcoinfees.21.co), especially for those that aren't familiar with Bitcoin fee estimating, bitcoinfees.21.co/bitcoinfees.earn.com suggests incorrect estimates for confirmation times.

The text delivering the "answer" is highly misleading: "The fastest and cheapest transaction fee is currently: 220 satoshis/byte" (which at this point in time is around 10 times more than an equally fast fee rate).

The site's conf-time estimate seems to erroneously deem the "cheapest and fastest" fee to be that which is paid very near to the highest within the top 1MB of it's mempool, when in fact every transaction within the top 1MB will be equally fast (yet not equally cheap).

It's likely no coincidence that 200 sat/byte transactions are heavily represented in the typical Bitcoin mempool. Very little mempool space is occupied inbetween this so called "cheapest and fastest" threshold and the lowest fee within the top 1 MB of the mempool (which is 10 times lower than 200 sat/byte right now).

Their method for calculating fees therefore always presents users with a false impression of confirmation times, and likely distorts the fee market against the user's interests. I am most embarrassed to have recommended this website in the past.


Thanks for pointing that out... I confess I haven't been looking at the explanation paragraphs below the main charts for months and you're right. The graphs themselves are still helpful, I've always used the estimation with confirmation times that more or less correspond. But the "cheapest and fastest" estimation is definitely far from accurate, at least it is right now.

I've been recommending this estimator for months now so am as guilty for possibly getting other users to pay more fees than needed. Complacency...

I do note that the graphs themselves are still a useful tool but now should find something more representative.

Then: a*180 + b*34 + 10 +/- 1
Unless you are using uncompressed public keys (and very few wallets do this anymore), the input multiplier will be 148 instead of 180.

I learn something new every day here, thanks for pointing that out!
legendary
Activity: 3024
Merit: 2148
January 26, 2018, 04:31:06 PM
#13
and then you crosscheck with another estimator with an easier to see structure like bitcoinfees.earn.com to see how much you need to pay per byte, for the estimated confirmation time you're comfortable with.

Strongly recommend against using bitcoinfees.earn.com (which is the same as bitcoinfees.21.co), especially for those that aren't familiar with Bitcoin fee estimating, bitcoinfees.21.co/bitcoinfees.earn.com suggests incorrect estimates for confirmation times.


Probably the best way to check the current fees is to go to https://dedi.jochen-hoenicke.de/queue/#2h and look at the mempool size to see what fees are getting included in recent blocks by looking at spike drops. Also, this should be another incentive to run a full node, as SPV clients have to trust their servers to get fee estimations (correct me if I'm wrong).
legendary
Activity: 3430
Merit: 3080
January 26, 2018, 01:07:59 PM
#12
and then you crosscheck with another estimator with an easier to see structure like bitcoinfees.earn.com to see how much you need to pay per byte, for the estimated confirmation time you're comfortable with.

Strongly recommend against using bitcoinfees.earn.com (which is the same as bitcoinfees.21.co), especially for those that aren't familiar with Bitcoin fee estimating, bitcoinfees.21.co/bitcoinfees.earn.com suggests incorrect estimates for confirmation times.

The text delivering the "answer" is highly misleading: "The fastest and cheapest transaction fee is currently: 220 satoshis/byte" (which at this point in time is around 10 times more than an equally fast fee rate).

The site's conf-time estimate seems to erroneously deem the "cheapest and fastest" fee to be that which is paid very near to the highest within the top 1MB of it's mempool, when in fact every transaction within the top 1MB will be equally fast (yet not equally cheap).

It's likely no coincidence that 200 sat/byte transactions are heavily represented in the typical Bitcoin mempool. Very little mempool space is occupied inbetween this so called "cheapest and fastest" threshold and the lowest fee within the top 1 MB of the mempool (which is 10 times lower than 200 sat/byte right now).

Their method for calculating fees therefore always presents users with a false impression of confirmation times, and likely distorts the fee market against the user's interests. I am most embarrassed to have recommended this website in the past.
staff
Activity: 3458
Merit: 6793
Just writing some code
January 26, 2018, 11:03:10 AM
#11
Then: a*180 + b*34 + 10 +/- 1
Unless you are using uncompressed public keys (and very few wallets do this anymore), the input multiplier will be 148 instead of 180.
legendary
Activity: 2968
Merit: 3684
Join the world-leading crypto sportsbook NOW!
January 26, 2018, 10:07:47 AM
#10
To add in on the other answers here, since OP still wants to know how to calculate tx fees... the most important piece of information you need is the size of your transactions. Doesn't seem to be in those lines of code, but they do have pieces of info that you can use to estimate size (not very accurately but close enough):

- number of inputs you're using, a
- number of outputs you'll create, b

Then: a*180 + b*34 + 10 +/- 1

which is why a 1 input, 1 output tx, the most common one, results in a typical tx size of 225 bytes. If you're using SegWit, your txs are going to be smaller (edit: added "in weight"), so this is a safe formula to use.

Easiest for me is to use the rough formula automatically done in site suggested above (estimate fee) so that's your best point to start finding out tx size, and then you crosscheck with another estimator with an easier to see structure like bitcoinfees.earn.com to see how much you need to pay per byte, for the estimated confirmation time you're comfortable with.
member
Activity: 140
Merit: 35
January 26, 2018, 09:03:05 AM
#9
There are also multiple online fee calculators out there if you don't feel like calculating yourself. To name a few:

https://estimatefee.com/
http://bitfees.info/
https://www.cheaperfee.com/
https://coinb.in/#fees

I am in no way affiliated with any of these sites by the way, but hope you find either of them useful.
AGD
legendary
Activity: 2070
Merit: 1164
Keeper of the Private Key
January 26, 2018, 01:03:27 AM
#8
You can read everything about Bitcoin fees here: https://en.bitcoin.it/wiki/Transaction_fees

Hi AGD,
I would really appreciate if you could give me piece of advice on this. What is the best way to send cryptocurrency from one exchange to another. I can see that if I send BTC, is has higher fees.

That's something already fixed that you're asking about. Exchanges charge a "fixed" fee for a transaction that they execute on their end and you are bound to pay those fees if you are withdrawing your coins from an exchange to exchange or even a wallet. You can only decide fee while you are sending "your" coins that you have in your wallet, and not an exchange. The "fixed" fee charged by them is what they take per transaction, not the fee they actually send while sending you your "withdrawn" amount. One more thing, each exchange has different "fixed" fee levels, like Polo charges 0.0005 BTC per withdrawal, Bittrex takes 0.001 BTC and so on.
Thanks. That helps. Recently I transferred some BTC from coinbase to binance and they charged me around 18 USD for that transaction. If I'm going to transfer some money from binance to other exchange, what is the best format of cryptocurrency I should send in order to minimize the fees.

Most of the Altcoins have a lower fee, but you will lose some % when you want to exchange back in BTC.
newbie
Activity: 152
Merit: 0
January 25, 2018, 04:14:40 PM
#7
You can read everything about Bitcoin fees here: https://en.bitcoin.it/wiki/Transaction_fees

Hi AGD,
I would really appreciate if you could give me piece of advice on this. What is the best way to send cryptocurrency from one exchange to another. I can see that if I send BTC, is has higher fees.

That's something already fixed that you're asking about. Exchanges charge a "fixed" fee for a transaction that they execute on their end and you are bound to pay those fees if you are withdrawing your coins from an exchange to exchange or even a wallet. You can only decide fee while you are sending "your" coins that you have in your wallet, and not an exchange. The "fixed" fee charged by them is what they take per transaction, not the fee they actually send while sending you your "withdrawn" amount. One more thing, each exchange has different "fixed" fee levels, like Polo charges 0.0005 BTC per withdrawal, Bittrex takes 0.001 BTC and so on.
Thanks. That helps. Recently I transferred some BTC from coinbase to binance and they charged me around 18 USD for that transaction. If I'm going to transfer some money from binance to other exchange, what is the best format of cryptocurrency I should send in order to minimize the fees.
legendary
Activity: 1059
Merit: 1020
January 25, 2018, 02:32:55 PM
#6
If no fee is given, a transaction with an optimal fee according to the size and network traffic will be sent. Otherwise, if a custom-fee is given which can be done like the example on the below, you overwrite the fee amount.

Code:
var transaction = new Transaction()
    .from(utxos)          // Feed information about what unspent outputs one can use
    .to(address, amount)  // Add an output with the given amount of satoshis
    .change(address)      // Sets up a change address where the rest of the funds will go
    .sign(privkeySet)     // Signs all the inputs it can
var transaction = new Transaction().fee(5430); // Minimum non-dust amount
var transaction = new Transaction().fee(1e8);  // Generous fee of 1 BTC

To record this transaction on the blockchain, you have to serialize the variable transaction, and thereby, push to the network through https://blockchain.info/pushtx.

Source: https://bitcore.io/api/lib/transaction
legendary
Activity: 3052
Merit: 1273
January 25, 2018, 01:16:58 PM
#5
You can read everything about Bitcoin fees here: https://en.bitcoin.it/wiki/Transaction_fees

Hi AGD,
I would really appreciate if you could give me piece of advice on this. What is the best way to send cryptocurrency from one exchange to another. I can see that if I send BTC, is has higher fees.

That's something already fixed that you're asking about. Exchanges charge a "fixed" fee for a transaction that they execute on their end and you are bound to pay those fees if you are withdrawing your coins from an exchange to exchange or even a wallet. You can only decide fee while you are sending "your" coins that you have in your wallet, and not an exchange. The "fixed" fee charged by them is what they take per transaction, not the fee they actually send while sending you your "withdrawn" amount. One more thing, each exchange has different "fixed" fee levels, like Polo charges 0.0005 BTC per withdrawal, Bittrex takes 0.001 BTC and so on.
newbie
Activity: 152
Merit: 0
January 25, 2018, 12:00:31 PM
#4
You can read everything about Bitcoin fees here: https://en.bitcoin.it/wiki/Transaction_fees

Hi AGD,
I would really appreciate if you could give me piece of advice on this. What is the best way to send cryptocurrency from one exchange to another. I can see that if I send BTC, is has higher fees.
newbie
Activity: 182
Merit: 0
January 25, 2018, 10:44:20 AM
#3
You can read everything about Bitcoin fees here: https://en.bitcoin.it/wiki/Transaction_fees

all is available here, we just understand what we do not understand, so no one in the deal.
AGD
legendary
Activity: 2070
Merit: 1164
Keeper of the Private Key
January 25, 2018, 07:24:54 AM
#2
You can read everything about Bitcoin fees here: https://en.bitcoin.it/wiki/Transaction_fees
newbie
Activity: 7
Merit: 0
January 25, 2018, 06:14:22 AM
#1
I am using bitcore server https://github.com/bitpay/bitcore and below is the code for making a transaction

Code:

var tx = bitcore.Transaction();
tx.from(utxos);
tx.to(address2,50000);
tx.change(address);
tx.sign(privateKey);
tx.serialize();

How much transaction fees are taken for executing the above transaction.? and I want to check before the transaction goes for the execution.
Jump to: