I am having difficulty working out how to work out a transaction fee. I've read the theory, but don't understand how to get the values to put the theory to practice.
Can someone please help me work this out step by step? If I want to send 0.05XBT from: mvDLEEymmEijZXyrrNRL3aPMhH8q2m8vE1
to mxgxQ52kYRVPfLeYpXugkCAGhjLfUaZk3g
. How do I work out the transaction fee?
If your answer could use these public keys so I can try them out based on the instructions in your answer, I would really appreciate that.
Using bitcoin-qt's command line, I have the following details:
listunspent [ { "txid" : "9df9c897af413505c02f158a7421b39000b40248a3bb826831ff458aee84f8ca", "vout" : 1, "address" : "mvDLEEymmEijZXyrrNRL3aPMhH8q2m8vE1", "account" : "From http://faucet.xeno-genesis.com/", "scriptPubKey" : "76a914a134b5919d09350f6232260ed1313f73ac6b7bae88ac", "amount" : 1.19994817, "confirmations" : 364 } ]
Then I could use this:
createrawtransaction '[{"txid":"d3be60aaf98ef888a9137928fa405806cd2e0c762f5205b3d9ba3e6ad26a5262","vout":1}]' '{"mxgxQ52kYRVPfLeYpXugkCAGhjLfUaZk3g":0.05,"mvDLEEymmEijZXyrrNRL3aPMhH8q2m8vE1":1.14974817 }'
But this "assumes" a 0.0002XBT fee.
I can then sign the transaction like so:
signrawtransaction '010000000162526ad26a3ebad9b305522f760c2ecd065840fa287913a988f88ef9aa60bed30100000000ffffffff02404b4c00000000001976a914bc5e62709adc296640dfed6871f0ebff5a7d11c588ac6160da06000000001976a914a134b5919d09350f6232260ed1313f73ac6b7bae88ac00000000' '[{"txid" : "d3be60aaf98ef888a9137928fa405806cd2e0c762f5205b3d9ba3e6ad26a5262","vout" : 1,"scriptPubKey" : "76a914a134b5919d09350f6232260ed1313f73ac6b7bae88ac"}]' '["private key here"]'
Which gives me this:
010000000162526ad26a3ebad9b305522f760c2ecd065840fa287913a988f88ef9aa60bed3010000006b483045022100f447788e6b40a1f8bd22b084c8507a7710bd5c8cb33b08082c308a7a0edc86d402204024287053715bc096e56744e45683bb63b32ebe56a2f2070fd318216512641d012103ca4eab4b394090c9f4c10b6a9c2674dfc14c7dee55b6d3eb72c4263fc325c37effffffff02404b4c00000000001976a914bc5e62709adc296640dfed6871f0ebff5a7d11c588ac6160da06000000001976a914a134b5919d09350f6232260ed1313f73ac6b7bae88ac00000000
Which is 452 bytes.
Apparently I am supposted count the number of inputs and outputs too? I understand that the fee can get more complex based on the age of the transaction and if I send a very small amount. But just for example purposes, How would I work out the transaction fee using the 2 public keys above if I wanted to send 0.05XBT? so I can subtract the fee from the change when using the createrawtransaction
command in bitcoin-qt?