Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: madmadmax on April 02, 2013, 12:12:00 PM



Title: Raw Transaction Tax
Post by: madmadmax on April 02, 2013, 12:12:00 PM
How do you calculate it? I have searched google and on this forum and haven't found a single answer.

Are there any low level functions I'm missing?


Title: Re: Raw Transaction Tax
Post by: CIYAM on April 02, 2013, 12:17:29 PM
Tax?

Are you trying to work out a tx *fee* amount?


Title: Re: Raw Transaction Tax
Post by: madmadmax on April 02, 2013, 12:25:10 PM
Tax?

Are you trying to work out a tx *fee* amount?


Yes haha the bitcoin network "tax" for processing your payment. The tx fee, I know it is charged by kb apparently but how do you get the proper kb for a transaction before you even create it?


Title: Re: Raw Transaction Tax
Post by: CIYAM on April 02, 2013, 12:39:41 PM
Okay - refer to this: https://en.bitcoin.it/wiki/Transaction_fees

Just create it the raw tx (with no fee) but don't send it and check its size (and the age of UTXOs if necessary) - remember that paying the fee is simply reducing one of the outputs (generally the change one) by the appropriate amount.


Title: Re: Raw Transaction Tax
Post by: DannyHamilton on April 02, 2013, 02:55:58 PM
how do you get the proper kb for a transaction before you even create it?

As CIYAM has pointed out, you don't.  First you create the transaction, then you calculate the fee.