Bitcoin Forum

Other => Beginners & Help => Topic started by: DarthVega7 on March 24, 2013, 02:32:47 PM



Title: Transactions and Wallets question
Post by: DarthVega7 on March 24, 2013, 02:32:47 PM
Hello,

I am doing a school project on bitcoin and I need help with some of the technical aspects of it.

First of all, what happens exactly in a bitcoin transaction?  I know public key crypto is involved, but I'm not sure how bitcoins are transferred from person A to person B.

What happens when I send money from my wallet to someone else's wallet?  Say I send 10 bitcoins.  Are 10 bitcoins subtracted from my wallet and added to someone else's wallet?

Thanks,

DV


Title: Re: Transactions and Wallets question
Post by: jackjack on March 24, 2013, 02:52:31 PM
I don't know if you know about asymetric cryptography, I'll assume not

It's all about 2 keys: one public P (everybody knows it) and one private V (only you know it)
When you crypt something (like a text) with one key, you can only decrypt the result with the other one (by construction of the keys)

So there are two cases:
1. Somebody crypt a text (like "hello") with P (he can because everybody knows P), then you are the only one to be able to decrypt the message (because only V can decrypt it)
2. You crypt a text with V, then anybody can check (with P) that it is V (hence you) that crypted the message

A transaction uses this system, you put in a message all of these:
1. I can use the money that has been sent to 1xxxxxx (your public address, and an address is equivalent to a public key, P), I prove it by sending a text crypted by V (which is the private key corresponding to the address, being in your wallet)
2. I send money to address 1yyyyyy

In the Bitcoin system there are no such thing as a wallet, just money sent to public keys which is redeemed later


Title: Re: Transactions and Wallets question
Post by: DarthVega7 on March 24, 2013, 03:21:29 PM
I found this in the bitcoin whitepaper:

http://www.techinasia.com/techinasia/wp-content/uploads/2011/07/bitcoin-transaction.jpg

Can someone please explain to me what's happening here?


Title: Re: Transactions and Wallets question
Post by: DannyHamilton on March 24, 2013, 10:40:28 PM
I found this in the bitcoin whitepaper:

http://www.techinasia.com/techinasia/wp-content/uploads/2011/07/bitcoin-transaction.jpg

Can someone please explain to me what's happening here?

This is an example of how a transactions can be represented as a "chain of digital signatures".  It is not exactly how bitcoin operates because it does not take into account Section 9. "Combining and Splitting Value", nor does it take into account Section 10. "Privacy".

In the diagram you've linked to, the left hand box demonstrates the original owner (Owner 0) of some predefined value transferring ownership of that value to someone new (Owner 1).

The "hash" in that box would be the hash of the "coinbase" transaction where that value came into existence (indicated by the arrow coming in from the left of the image).  This previous "coinbase" transaction would have Owner 0's public key.  Owner 0 proves his right to transfer the value by providing a digital signature using the private kay that matches the public key stored in the "coinbase" transaction.  Owner 0 turns over control of the value to Owner 1 by providing Owner 1's public key.  As such the only person who can now re-assign the value is the person who has the private key that matches the public key in this transaction and can therefore provide the appropriate signature.

So in this diagram a "transaction" consists of 3 parts:

  • A hash indicating a previous transaction that transferred the right to reassign the value to the current owner.
  • A signature provided by the current owner indicating that they are transferring the right to reassign the value to someone else
  • A public key, setting up the signature requirement for the new owner to reassign the value

As you can see, each of the next two boxes simply repeat this process.

The dotted lines are showing that the signature is provided by the current owner's private key, and that the entire network can verify that signature since the public key is provided in the previous transaction.


Title: Re: Transactions and Wallets question
Post by: DarthVega7 on March 26, 2013, 01:30:47 AM
Thanks Danny!