Bitcoin Forum

Other => Beginners & Help => Topic started by: Andynerd on January 27, 2013, 12:51:08 AM



Title: Wallet transaction.
Post by: Andynerd on January 27, 2013, 12:51:08 AM
Thanks to the wonderful idea from DeathandTaxes I was interested in an how transactions are placed in the blockchain. From my understanding :

1. The wallet generates an address.
2. The person who wishes to send you money send the transaction to your address, then saves that to the global blockchain
3. The wallet holder's wallet compares the blockchain every once and a while and if the transaction is on it (and verified by 6 other systems) it accepts the transaction and modifies the wallet accordingly.
4. The blockchain is modified to show that the transaction was completed.

This is what I've come to understand from lurking around Bitcoin wiki. I just kind of wanted to have it clarified. I have the feeling I'm off on something, maybe the whole thing, this is just kind of my guess at it.


Title: Re: Wallet transaction.
Post by: CIYAM on January 27, 2013, 01:06:20 AM
1. The wallet generates an address.

Correct.

2. The person who wishes to send you money send the transaction to your address, then saves that to the global blockchain

No quite right - they create a tx that assigns the ownership of "unspent output scripts" (i.e. their BTC holdings) to your address (which will require your "private key" in order to themselves be assigned should you wish to "spend" your BTC holdings at a later stage).

The tx is then "broadcast" to the P2P network (not *saved* in the blockchain). Eventually this tx (along with generally many others) will be included in a "newly mined block" which is effectively appended to the blockchain (so you could think of this part as *saving it to the blockchain* if you like).

3. The wallet holder's wallet compares the blockchain every once and a while and if the transaction is on it (and verified by 6 other systems) it accepts the transaction and modifies the wallet accordingly.

The "confirmations" is simply the length of the chain of blocks that include your tx starting with the initial one it appeared in (so if your tx was in block #218212) then it would currently have 1 confirmation and assuming the block doesn't get "orphaned" (there's a whole lot more to know about that) then when the current block # is 218218 your tx will now have 6 confirmations (nothing to do with "other systems" just "more blocks").

4. The blockchain is modified to show that the transaction was completed.

No - the blockchain is never modified at all.

HTH


Title: Re: Wallet transaction.
Post by: Andynerd on January 27, 2013, 01:07:45 AM
Perfect thank you this is exactly what I wanted to know. That was great help :D!  You've actually just answered a whole bunch of things for me as well.

I just found the address creation algorithm wiki page. O_O super freaken secure but it must be a nightmare to program.

https://en.bitcoin.it/wiki/Technical_background_of_Bitcoin_addresses


Title: Re: Wallet transaction.
Post by: maunderingcabal on January 27, 2013, 01:25:36 AM
1. The wallet generates an address.

Correct.

2. The person who wishes to send you money send the transaction to your address, then saves that to the global blockchain

No quite right - they create a tx that assigns the ownership of "unspent output scripts" (i.e. their BTC holdings) to your address (which will require your "private key" in order to themselves be assigned should you wish to "spend" your BTC holdings at a later stage).

The tx is then "broadcast" to the P2P network (not *saved* in the blockchain). Eventually this tx (along with generally many others) will be included in a "newly mined block" which is effectively appended to the blockchain (so you could think of this part as *saving it to the blockchain* if you like).

3. The wallet holder's wallet compares the blockchain every once and a while and if the transaction is on it (and verified by 6 other systems) it accepts the transaction and modifies the wallet accordingly.

The "confirmations" is simply the length of the chain of blocks that include your tx starting with the initial one it appeared in (so if your tx was in block #218212) then it would currently have 1 confirmation and assuming the block doesn't get "orphaned" (there's a whole lot more to know about that) then when the current block # is 218218 your tx will now have 6 confirmations (nothing to do with "other systems" just "more blocks").

4. The blockchain is modified to show that the transaction was completed.

No - the blockchain is never modified at all.

HTH


Thanks, this cleared up some things for me as well.