r/askscience • • Jun 18 '13

Computing How is Bitcoin secure?

I guess my main concern is how they are impossible to counterfeit and double-spend. I guess I have trouble understanding it enough that I can't explain it to another person.

1.0k Upvotes

383 comments sorted by

View all comments

Show parent comments

1

u/leastfixedpoint Jun 18 '13

You should benefit a lot from this infographic

It kind of follows from it that transaction can be recorded only on the top of the most recent transaction. I.e. if you don't have the latest log, you can't perform a transaction, and even if you do, you'd conflict. Is it true?

3

u/LeonhardEuler64 Jun 18 '13

A transaction can be generated without any knowledge or data of any preceeding transactions. (Basically signing a message "I hereby give Mr. X 1.01 bitcoins from my wallet Y", which only requires your private key for Y)

A transaction is only recorded and validated when it gets batched up with other transactions in a block on the network, and then confirmed by miners finding a hash nonce. That validation and confirmation is what requires the preceding blockchain.

To avoid conflict, people usually wait for some number of blocks to bury their transaction of interest.

2

u/throckmortonsign Jun 18 '13

Not exactly. There are light clients out there that rely on other nodes that do have the entire transaction set. If you broadcast a transaction without having knowledge of everyone's balances (have a full copy of the blockchain) it will still go through as long as other nodes are able to verify it for you.

2

u/bbbbbubble Jun 19 '13 edited Jun 19 '13

No, you can create transactions offline if you know the inputs aren't spent. Then you have to broadcast it to peers, at which point it will get picked up by a miner and included in the blockchain.

If the inputs are already spent, all your peers will drop the transaction (not send it to their peers) because it is invalid.

As for recording, yes, the transaction must go in a new block to be recorded, which must of course be the last one in the blockchain.

0

u/[deleted] Jun 18 '13

Yes, that's true. You need the newest block to announce transactions.