Bitcoin Forum
May 02, 2024, 11:46:11 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Need a free api to calculate transaction FEE for instant confirmation  (Read 249 times)
Vort3x.Layers (OP)
Jr. Member
*
Offline Offline

Activity: 47
Merit: 11


View Profile
April 22, 2021, 10:48:45 PM
Merited by bitmover (1)
 #1

I am c# developer.
I need a free api to calculate transaction FEE (BITCOIN) for instant confirmation.
Mean i want to pass amount to api and it show me transaction FEE for instant confirmation.
Because in these days i saw many troubles for high fees during transactions.
So i need to know about fees in my codes.

Thanks for the review and for the help
1714693571
Hero Member
*
Offline Offline

Posts: 1714693571

View Profile Personal Message (Offline)

Ignore
1714693571
Reply with quote  #2

1714693571
Report to moderator
1714693571
Hero Member
*
Offline Offline

Posts: 1714693571

View Profile Personal Message (Offline)

Ignore
1714693571
Reply with quote  #2

1714693571
Report to moderator
"Bitcoin: mining our own business since 2009" -- Pieter Wuille
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714693571
Hero Member
*
Offline Offline

Posts: 1714693571

View Profile Personal Message (Offline)

Ignore
1714693571
Reply with quote  #2

1714693571
Report to moderator
ranochigo
Legendary
*
Offline Offline

Activity: 2954
Merit: 4165


View Profile
April 22, 2021, 10:54:30 PM
Merited by pooya87 (1), mocacinno (1), ABCbits (1)
 #2

Paying a high fee rate will.not give you an instant confirmation but it would improve your chances of the transaction getting confirmed within the next few blocks.

Can the mempool.space API[1] help with this? It'll give you a pretty reasonable estimate for Satoshis/vbyte.

[1] https://mempool.space/api

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

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

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

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

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

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











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











▄▄▄▄█
Vort3x.Layers (OP)
Jr. Member
*
Offline Offline

Activity: 47
Merit: 11


View Profile
April 22, 2021, 11:09:12 PM
 #3

Thanks for the reply.
It seems satoshi / vbyte is different from satoshi / byte.
This Link returns satoshi / vbyte.
Where can i know 100$ = 0.0019 btc how much is that in byte or vbyte?
ranochigo
Legendary
*
Offline Offline

Activity: 2954
Merit: 4165


View Profile
April 23, 2021, 03:20:22 AM
Merited by bitmover (1)
 #4

Thanks for the reply.
It seems satoshi / vbyte is different from satoshi / byte.
This Link returns satoshi / vbyte.
Where can i know 100$ = 0.0019 btc how much is that in byte or vbyte?
Transaction size are independent of the amount being transacted. It'll depend on your number of inputs and outputs, type of transaction (Segwit or not), etc There should be some utility In C# which is able to interpret the witness discount for the virtual byte. You shouldn't consider actual size as that is not what most of the miners consider when choosing transactions.

There are various formulae available for the calculation, which gives a very close approximation and is not always perfectly accurate. Use this web utility as a guide: https://jlopp.github.io/bitcoin-transaction-size-calculator/.

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

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

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

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

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

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











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











▄▄▄▄█
NotATether
Legendary
*
Offline Offline

Activity: 1596
Merit: 6724


bitcoincleanup.com / bitmixlist.org


View Profile WWW
April 23, 2021, 06:23:55 AM
Merited by bitmover (1)
 #5

Where can i know 100$ = 0.0019 btc how much is that in byte or vbyte?

byte-denominated fees don't count the witness data part of the transaction properly so are half as large as vbytes fees are for segwit transactions. This is understandable because it was made before segwit was introduced.

Sats/vbyte is the canonical way to calculate fees for legacy and segwit addresses now so that's what you should use instead of sats/byte.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
bitmover
Legendary
*
Online Online

Activity: 2296
Merit: 5916


bitcoindata.science


View Profile WWW
April 27, 2021, 11:46:43 AM
 #6

Thanks for the reply.
It seems satoshi / vbyte is different from satoshi / byte.
This Link returns satoshi / vbyte.

As mentioned by NotATether you should use vbytes, as block size is now measured in vbytes and not in bytes anymore.

Take a look at bitcoin wiki:
Quote
Weight units
Weight units are a measurement used to compare the size of different Bitcoin transactions to each other in proportion to the consensus-enforced maximum block size limit. Weight units are also used to measure the size of other block chain data, such as block headers. As of Bitcoin Core 0.13.0 (released August 2016)[1], each weight unit represents 1/4,000,000th of the maximum size of a block.

Virtual size (vsize), also called virtual bytes (vbytes), are an alternative measurement, with one vbyte being equal to four weight units. That means the maximum block size measured in vsize is 1 million vbytes.
https://en.bitcoin.it/wiki/Weight_units

Quote
Where can i know 100$ = 0.0019 btc how much is that in byte or vbyte?

Transaction size (bytes/vbytes) depends on how many inputs/outputs you have and address format, not in the amount being transacted.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
nellcisneros
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
May 27, 2021, 06:55:13 AM
 #7

Blockchain.info offers a fee API: https://api.blockchain.info/mempool/fees You'll need to multiply either the value for regular or priority by your transaction size in order to calculate the transaction fee.




mocacinno
Legendary
*
Offline Offline

Activity: 3374
Merit: 4919


https://merel.mobi => buy facemasks with BTC/LTC


View Profile WWW
May 27, 2021, 07:05:43 AM
 #8

or, you can run a node and use "estimatesmartfee" via the json-rpc interface... That way you don't have to trust some other service..

But like it's been said before: there is no foolproof method, and no "instant" confirmation...

█▀▀▀











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











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
jack jillss
Newbie
*
Offline Offline

Activity: 63
Merit: 0


View Profile
May 27, 2021, 07:27:49 AM
 #9

how do we calcualte the other coins fees (ex- eth , bsc , sol blockchain for instant confirmation)
Dabs
Legendary
*
Offline Offline

Activity: 3416
Merit: 1912


The Concierge of Crypto


View Profile
June 04, 2021, 06:29:56 PM
 #10

https://jochen-hoenicke.de/queue/#BTC,2h,weight
https://mempool.observer/
https://bitcoinfees.net/

I'd use one of these, or all of them, in addition to your own full node as a sanity check.

The almost sure fire way is to pay the fee where the tx is within 1 MB from the tip. Your transaction will get included in the next one or two blocks.

Pmalek
Legendary
*
Offline Offline

Activity: 2758
Merit: 7125



View Profile
June 05, 2021, 10:41:46 AM
 #11

The almost sure fire way is to pay the fee where the tx is within 1 MB from the tip. Your transaction will get included in the next one or two blocks.
That should be enough unless you are really unlucky and you send a low-fee transaction at a time where we have to wait for 30-40 minutes for the next block, while in the meantime a huge influx of new higher-paying transaction enters the mempools. Not to mention a sudden price surge or drop of value and the congestions they usually bring to the table.   

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
ranochigo
Legendary
*
Offline Offline

Activity: 2954
Merit: 4165


View Profile
June 05, 2021, 10:55:00 AM
 #12

That should be enough unless you are really unlucky and you send a low-fee transaction at a time where we have to wait for 30-40 minutes for the next block, while in the meantime a huge influx of new higher-paying transaction enters the mempools. Not to mention a sudden price surge or drop of value and the congestions they usually bring to the table.   
It only works assuming that the both the blocks and the rate of transactions are approximately constant. Most fees estimation takes into the fee rates for the previous blocks and use the data points to build out their own fee estimation. This is by far the most accurate way to eliminate volatility of the block intervals as it takes into account a much larger history. If the block were to be mined 10 seconds before and you choose a 1vMB from tip, it would at the very least take 2 blocks to confirm or perhaps even longer.

If you think estimatesmartfees has too conservative of an estimate, then you can change the parameters if you're using Bitcoin Core for a more economical one. While it is by no means perfect, it is a far better estimation than what we can do by looking at the mempool distribution.

.
.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!