Is public key and bitcoin address same thing?
No.
What is input and output? Why are they important?
Input is a previously unspent output. Output is a newly created unspent output.
Inputs provide value to a transaction. Outputs encumber that value with requirements that must be met to use the output as an input in some other transaction.
What is spent and unspent output?
Spent output is an output that has been used as an input in another transaction.
Unspent output is an output that has not yet been used as an input in another transaction.
I saw "WIF", "WIP", "BIP" on the forum, i have no idea what they are?
BIP = Bitcoin Improvement Proposal
WIF = Wallet Import Format (a specific way of representing a private key)
I'm not sure what WIP is?
What is "change address" and how do we get one? Why do we need one?
Any value that has been provided to a transaction (the sum of the inputs) that is not specifically accounted for in the sum of the outputs of the transaction are available to be claimed by the miner that includes the transaction in the block that they mine. If the total of your inputs exceeds the total of your outputs and you don't want to pay the excess as a fee to the bitcoin mining network, then you need to create an output that encumbers that value with a requirement. The typical requirement that bitcoin uses is a requirement to supply a signature from the private key that is associated with a particular bitcoin address. Common usage of the phrase "send bitcoins to an address" refers to this signature encumbering. As such the "change" address is an address for which you have the private key, and which you use in encumbering the value in the output.
What is a "transaction hash" and what is the use of it?
It is the 256 bit result of a SHA256 function performed on the data contained in the transaction. It is used as a unique identifier for the transaction.
What is going on is that:
- Various previously unspent outputs were each previously encumbered with requirements to provide signatures generated with private keys.
- One of those previously unspent outputs required a signature from the private key that is associated with the bitcoin address of 1AryzF6c6nsNKG6JuVsWkcDw6jieHCFgrX
- One of those previously unspent outputs required a signature from the private key that is associated with the bitcoin address of 161DLfuWYjVp9Uk2fSys3LBXxNcfsLdHs4
- One of those previously unspent outputs required a signature from the private key that is associated with the bitcoin address of 1JznECXSCkzEzM6g4TJsqvHA5RESTHoCjr
- The previously unspent output that required a signature from the private key associated with 1AryzF6c6nsNKG6JuVsWkcDw6jieHCFgrX provided a value of 0.03148932 as an input to the transaction
- The previously unspent output that required a signature from the private key associated with 161DLfuWYjVp9Uk2fSys3LBXxNcfsLdHs4 provided a value of 0.01952023 as an input to the transaction
- The previously unspent output that required a signature from the private key associated with 1JznECXSCkzEzM6g4TJsqvHA5RESTHoCjr provided a value of 0.03148573 as an input to the transaction
- The appropriate signatures for each of the inputs were provided to the transaction providing proof that the transaction has the authorization to reassign the total value of 0.08249528
- An output was created in the transaction to encumber a value of 0.06367873 with a requirement to provide a signature from the private key associated with the bitcoin address of 12CDvRT86CRVbq6E9U95QFenHKWizXDaHj in order to reassign that value
- An output was created in the transaction to encumber a value of 0.01831655 with a requirement to provide a signature from the private key associated with the bitcoin address of 1J7akepH41mtecZPVZjngVeq8tCyAa2mG in order to reassign that value
- The transaction left a value of 0.0005 unaccounted for (0.08249528 - (0.06367873 + 0.01831655 ) ) = 0.0005
- The miner (or mining poll) that added this transaction to the block that they were working on, and was successfully the first to solve the block, collected the excess unaccounted for 0.0005 BTC value as mining fees
I'm sure there was a lot more that is "going on". I'm not sure what exactly you are looking for?
In this image:
http://puu.sh/4qakA.png 1GzodRP... sent 0.05 BTC to
1JznEC... and 0.01801427 BTC sent back to first guy's change address (
12CDvRT...), am i right?
No.
0.05 in value was supplied in input from outputs that were previously sent to 1GzodRP...
Of that 0.05 in value, 0.01801427 was sent to 12CDvRT... and 0.03148573 was sent to 12CDvRT...
It is impossible to be sure which (if either) of those 2 outputs are a "change" address.
In this picture:
http://puu.sh/4qapy.png same address sent bitcoins to someone 4 times in 1 transaction, and change came back to him. How is that possible? or something else happend and i don't understand.
No.
In that picture, the person who has the private key associated with the address of 12CDvRT... spent 4 separate previously received outputs providing a total value of 0.12268294 to the input side of the transaction.
That value of 0.12268294 was split up into 2 outputs with a value of 0.1 being "sent to" the 1GzodR... address and a value of 0.02218294 being sent as "change" back to the 12CDvRT... address as a new unspent output.
The remaining unaccounted for value of 0.0005 was claimed by the miner as fees.
What is input script and output script, do we need them for anything?
Output script is the set of instructions that encumber the value with the requirements that must be met to "spend" the output.
Input script is how the transaction meets those requirements.
How can we calculate the fee of transaction?
Sum the value associated with all the inputs.
Sum the value associated with all the outputs.
The difference between the two sums is the fee.
And last question for experts:
How can i create a manual transaction?
Use the createrawtransaction, signrawtransaction, and sendrawtransaction API calls in the Bitcoin-Qt "debug console".
Note, this is VERY Very very dangerous if you don't fully understand exactly what you are doing.
Very knowledgeable people who knew exactly what they were doing have been known to accidentally make a very small mistake while trying to create a "manual" transaction. In some cases the result was accidentally paying a significant sum of bitcoins to the wrong address. In other cases the result was paying a significant sum of bitcoins as transaction fees.
For now, that's it. Thanks for your help
You're welcome.