Bitcoin Forum
June 29, 2024, 02:28:48 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Total Fees  (Read 1319 times)
Blockchain Mechanic (OP)
Full Member
***
Offline Offline

Activity: 380
Merit: 103

Developer and Consultant


View Profile WWW
December 30, 2016, 08:16:56 AM
 #1

Hello

Is there a way to get the total amount of fees ever paid since the first transaction ever made on the chain?

Equality vs Equity...
Discord :- BlockMechanic#8560
0x0010
Member
**
Offline Offline

Activity: 112
Merit: 10

female ;)


View Profile WWW
December 30, 2016, 08:24:12 AM
 #2

A lot.

https://blockchain.info/charts/transaction-fees

keybase.io/0x0010
Blockchain Mechanic (OP)
Full Member
***
Offline Offline

Activity: 380
Merit: 103

Developer and Consultant


View Profile WWW
December 30, 2016, 08:38:47 AM
 #3


Nice, but i meant using the actual client...

Equality vs Equity...
Discord :- BlockMechanic#8560
CyberCombat
Sr. Member
****
Offline Offline

Activity: 490
Merit: 250


View Profile WWW
December 30, 2016, 08:43:37 AM
 #4

Hello

Is there a way to get the total amount of fees ever paid since the first transaction ever made on the chain?

Here you can see fees, Btc allows you to receive and send payment for a very low fee. There are no compulsory remuneration other than special cases like very low pay. It is recommended that you pay voluntarily as high as possible to get your transaction approved faster and grant the rights of the people who manage the Bitcoin system.


                 ██▄▄▄
                  ██████▄▄

   ▄█▄             ████████▄
  █████▄    ▄▄▄▀▀▀        ███
 ███████▄▄▀▀           ▄▄█████
███████▀             ▐█████████
█████                ▐█████████
█████▄▄▄▄             █████████
 █████████             ▀██████
  ████████▄▄             ▀▀██
   ▀██████████▄  ▄▌    ▄█▄
     ▀▀███████████▀  ███▀▀
         ▀▀▀██▀▀▀     ▀
.
FortuneJack
.██████
██
██
██
██
██
██
██
██
██
██
██
██████
.
MIAMI Garage
██████
██
██
██
██
██
██
██
██
██
██
██
██████
.██████
██
██
██
██
██
██
██
██
██
██
██
██████
.
MAJESTIC7
██████
██
██
██
██
██
██
██
██
██
██
██
██████
.██████
██
██
██
██
██
██
██
██
██
██
██
██████
.
6 BTC WELCOME OFFER
██████
██
██
██
██
██
██
██
██
██
██
██
██████
.
█▀▀▀▀▀▀▀▀▀









█▄▄▄▄▄▄▄▄▄
.
Join Now

▀▀▀▀▀▀▀▀▀█









▄▄▄▄▄▄▄▄▄█
Biitcoin
Sr. Member
****
Offline Offline

Activity: 353
Merit: 250


Zichain


View Profile WWW
December 30, 2016, 08:47:17 AM
 #5


You mean the wallet Itself ? It wouldn't make sense If a wallet has this feature , the wallet can calculate your fees while trying to send bitcoins but showing you the transactions fees from the first transaction until now is not needed therefore its not implemented.

shorena
Copper Member
Legendary
*
Offline Offline

Activity: 1498
Merit: 1520


No I dont escrow anymore.


View Profile WWW
December 30, 2016, 09:20:05 AM
Merited by ABCbits (1)
 #6


Strings like this are commands passed to bitcoin core, e.g. via bitcoin-cli. There may be typos.

Start with getblockhash ID for block numbers from 0 to getblockcount.
It will return you a hash for each block. Use getblock HASH to get the full block. The first transaction is the coinbase(?).
Use its transaction id to get the raw transaction with getrawtransaction TXID.
Decode the raw TX decoderawtransaction RAWTX.
Verify that vin has coinbase just to make sure its actually the correct one.
Look for all (its possible that there are more than one) value under vout und substract the current blockreward for that block.

Add it all up and you get your answer.

Im not really here, its just your imagination.
Blockchain Mechanic (OP)
Full Member
***
Offline Offline

Activity: 380
Merit: 103

Developer and Consultant


View Profile WWW
January 02, 2017, 07:03:15 AM
 #7


Strings like this are commands passed to bitcoin core, e.g. via bitcoin-cli. There may be typos.

Start with getblockhash ID for block numbers from 0 to getblockcount.
It will return you a hash for each block. Use getblock HASH to get the full block. The first transaction is the coinbase(?).
Use its transaction id to get the raw transaction with getrawtransaction TXID.
Decode the raw TX decoderawtransaction RAWTX.
Verify that vin has coinbase just to make sure its actually the correct one.
Look for all (its possible that there are more than one) value under vout und substract the current blockreward for that block.

Add it all up and you get your answer.

That seems a bit complicated, so i went the easier way. I modded the client to simply index the fees, and moneysupply. So now i'm re-syncing.... Sad

Equality vs Equity...
Discord :- BlockMechanic#8560
amaclin
Legendary
*
Offline Offline

Activity: 1260
Merit: 1019


View Profile
January 02, 2017, 09:33:01 AM
 #8

That seems a bit complicated, so i went the easier way. I modded the client to simply index
the fees, and moneysupply. So now i'm re-syncing.... Sad

Code:
    if ( tx.isCoinbase ( ) )
    {
      quint64 sum ( 0 );
      for ( int j ( tx.countOutputs ( ) ); --j >= 0; )
        sum += tx.getOutput ( j ).getAmount ( );
      if ( b.getHeight ( ) < 210000 )
        sum -= 5000000000ULL;
      else if ( b.getHeight ( ) < 420000 )
        sum -= 2500000000ULL;
      else
        sum -= 1250000000ULL;
      if ( !fees.isOpen ( ) )
        xassert ( fees.open ( QIODevice::Truncate | QIODevice::WriteOnly ) );
      fees.write ( QString ( "%1 %2\n" ).arg ( currentHeight ).arg ( Util::getAmount ( sum ) ).toLatin1 ( ) );
      return;
    }

last blocks:

Code:
446212 1.03858046
446213 0.74584604
446214 0.88441842
446215 1.03811188
446216 0.78413463
446217 0.73251029
446218 1.11043233
446219 0.70587050
446220 0.84482498
446221 1.02255383
446222 1.02058343
446223 0.77370661
446224 1.06227240
446225 0.85835690
446226 0.69812347
446227 0.78936092
446228 0.78254557
446229 0.91726035
446230 0.62124715
446231 0.95830498

the full results:
https://cloud.mail.ru/public/6bB5/7bi2LQqHe
johoe
Full Member
***
Offline Offline

Activity: 217
Merit: 241


View Profile
January 02, 2017, 10:23:20 AM
 #9

@amaclin: your program fails for this block:
https://blockchain.info/block/0000000000004c78956f8643262f3622acf22486b120421f893c0553702ba7b5

If the remaining data is correct, the total fee is about 60688.8 BTC

Note that this also includes fee that was paid in error (e.g. swapping fee and value field) and later returned by the miner.

Donations to 1CF62UFWXiKqFUmgQMUby9DpEW5LXjypU3
amaclin
Legendary
*
Offline Offline

Activity: 1260
Merit: 1019


View Profile
January 02, 2017, 10:27:47 AM
 #10

I do not need exact values.
I wonder what these digits can be used for.
This is just quick-and-dirty code example.
Blockchain Mechanic (OP)
Full Member
***
Offline Offline

Activity: 380
Merit: 103

Developer and Consultant


View Profile WWW
January 02, 2017, 12:08:05 PM
 #11

I do not need exact values.
I wonder what these digits can be used for.
This is just quick-and-dirty code example.

Use - Machine Learning, Narrow Ai.

Interesting solution, true, quick and dirty, but get you somewhere for the most part. i'm partial to my own solution, since i can extend it and make it rpc accessible.

Still, thanks, i can use this version and ask the kernel i am writing to locate the discrepancies and see what it's simulations decide is the best course of action.

Equality vs Equity...
Discord :- BlockMechanic#8560
shorena
Copper Member
Legendary
*
Offline Offline

Activity: 1498
Merit: 1520


No I dont escrow anymore.


View Profile WWW
January 02, 2017, 10:26:21 PM
 #12

@amaclin: your program fails for this block:
https://blockchain.info/block/0000000000004c78956f8643262f3622acf22486b120421f893c0553702ba7b5

If the remaining data is correct, the total fee is about 60688.8 BTC

Note that this also includes fee that was paid in error (e.g. swapping fee and value field) and later returned by the miner.

If you want a perfect result, youd have to catch these blocks somehow, because miners dont have to claim the full block reward. If you dont care about the satoshi missing (at least here) it would be enough to make sure you dont overflow.

Im not really here, its just your imagination.
Coding Enthusiast
Legendary
*
Offline Offline

Activity: 1039
Merit: 2783


Bitcoin and C♯ Enthusiast


View Profile WWW
January 04, 2017, 06:17:28 PM
 #13


Haha this was the work of midnightmagic who intentionally was trying to omit 1 satoshi from the blockchain forever in honor of satoshi and the fact that satoshi is missing. Then he messed up and lost the fees too.

In block 124724, I deliberately and specifically underpaid myself by 0.00000001 ฿, which is colloquially known as "1 Satoshi" after ฿'s creator and due to a lack of a good name for that amount of ฿ money.

To make absolutely sure that I was doing it on purpose, I set the reward value to 49.99999999, which meant that I inadvertently threw away the transaction fees which I could have allocated to myself.

I did it as a tribute to our missing Satoshi: we are missing Satoshi, and now the blockchain is missing 1 Satoshi too, for all time.

♯♯snipped♯♯

So, this is a provably missing amount of the fees+1 Satoshi from the blockchain, from block 124724, which appears to be 0.01 + 0.00000001 ฿.

I did this by creating an option in my heavily customized client (derived from the git fork of bitcoind) which allows me to arbitrarily suspend the normal block reward calculation and underpay myself. The code itself only checks to ensure that I haven't *overpaid* myself. It doesn't at all care that I've *underpaid* myself.

I view this as a freedom in the protocol, and not a drawback.

blockexplorer.com has a display bug for that block which has not been corrected yet.


Projects List+Suggestion box
Donate: 1Q9s or bc1q
|
|
|
FinderOuter(0.19.1)Ann-git
Denovo(0.7.0)Ann-git
Bitcoin.Net(0.26.0)Ann-git
|
|
|
BitcoinTransactionTool(0.11.0)Ann-git
WatchOnlyBitcoinWallet(3.2.1)Ann-git
SharpPusher(0.12.0)Ann-git
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!