Blockchain Mechanic (OP)
Full Member
![*](https://bitcointalk.org/Themes/custom1/images/star.gif) ![*](https://bitcointalk.org/Themes/custom1/images/star.gif)
Offline
Activity: 380
Merit: 103
Developer and Consultant
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 30, 2016, 08:16:56 AM |
|
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
![*](https://bitcointalk.org/Themes/custom1/images/star.gif)
Offline
Activity: 112
Merit: 10
female ;)
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 30, 2016, 08:24:12 AM |
|
|
keybase.io/0x0010
|
|
|
Blockchain Mechanic (OP)
Full Member
![*](https://bitcointalk.org/Themes/custom1/images/star.gif) ![*](https://bitcointalk.org/Themes/custom1/images/star.gif)
Offline
Activity: 380
Merit: 103
Developer and Consultant
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 30, 2016, 08:38:47 AM |
|
Nice, but i meant using the actual client...
|
Equality vs Equity... Discord :- BlockMechanic#8560
|
|
|
CyberCombat
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 30, 2016, 08:43:37 AM |
|
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. ![](https://ip.bitcointalk.org/?u=http%3A%2F%2Fs1.ibtimes.com%2Fsites%2Fwww.ibtimes.com%2Ffiles%2Fstyles%2Fembed%2Fpublic%2F2016%2F03%2F08%2Fbitcoin-transaction-times-vs-fees.png&t=665&c=f8I-45wBAsrhcw)
|
|
|
|
Biitcoin
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 30, 2016, 08:47:17 AM |
|
Nice, but i meant using the actual client... 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
Activity: 1498
Merit: 1530
No I dont escrow anymore.
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 30, 2016, 09:20:05 AM |
|
Nice, but i meant using the actual client... 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
![*](https://bitcointalk.org/Themes/custom1/images/star.gif) ![*](https://bitcointalk.org/Themes/custom1/images/star.gif)
Offline
Activity: 380
Merit: 103
Developer and Consultant
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 02, 2017, 07:03:15 AM |
|
Nice, but i meant using the actual client... 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](https://bitcointalk.org/Smileys/default/sad.gif)
|
Equality vs Equity... Discord :- BlockMechanic#8560
|
|
|
amaclin
Legendary
Offline
Activity: 1260
Merit: 1019
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 02, 2017, 09:33:01 AM |
|
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](https://bitcointalk.org/Smileys/default/sad.gif) 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: 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
|
|
|
|
|
amaclin
Legendary
Offline
Activity: 1260
Merit: 1019
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 02, 2017, 10:27:47 AM |
|
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
![*](https://bitcointalk.org/Themes/custom1/images/star.gif) ![*](https://bitcointalk.org/Themes/custom1/images/star.gif)
Offline
Activity: 380
Merit: 103
Developer and Consultant
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 02, 2017, 12:08:05 PM |
|
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
Activity: 1498
Merit: 1530
No I dont escrow anymore.
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 02, 2017, 10:26:21 PM |
|
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
Activity: 1040
Merit: 2785
Bitcoin and C♯ Enthusiast
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 04, 2017, 06:17:28 PM |
|
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.
|
|
|
|
|