Bitcoin Forum
May 24, 2024, 03:23:18 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Some Simple Questions  (Read 1523 times)
Judson (OP)
Newbie
*
Offline Offline

Activity: 22
Merit: 0



View Profile
December 09, 2010, 04:01:14 AM
 #1

For starters, I just want to say Bitcoin is awesome. I am a developer/economist and want to completely wrap my head around the theory behind Bitcoin so I can help out where possible.

My question is about transactions and how they are included in newly generated blocks.

     - I understand that when a new block is generated, the miner gets to keep the fees of the transactions that he includes in the generated block, which replicates transactions across the network and keeps people from spending bitcoins twice, etc. (correct me if I'm wrong).
     - The problem is, how do the miners "see" transactions? Or, how do they actually get the other users transactions to include in the newly generated block.


Also, what part does the "wallet.dat" play? Does it store your private key? If it does, why does it need to be backed up after each transaction?

[edit] Scratch the wallet.dat part, I just saw the question in the FAQ[/edit]
jgarzik
Legendary
*
Offline Offline

Activity: 1596
Merit: 1091


View Profile
December 09, 2010, 04:11:31 AM
 #2

For starters, I just want to say Bitcoin is awesome. I am a developer/economist and want to completely wrap my head around the theory behind Bitcoin so I can help out where possible.

My question is about transactions and how they are included in newly generated blocks.

     - I understand that when a new block is generated, the miner gets to keep the fees of the transactions that he includes in the generated block, which replicates transactions across the network and keeps people from spending bitcoins twice, etc. (correct me if I'm wrong).
     - The problem is, how do the miners "see" transactions? Or, how do they actually get the other users transactions to include in the newly generated block.

Each individual transaction is immediately relayed to the entire network, by the transaction creator.  As a node on the network, you are typically offered the same transaction multiple times, for redundancy.  Everyone sends transactions to everyone.

So, simply by being a node on the bitcoin P2P network, miners are sent transactions by other nodes on the network.  Miners then try to hash the list of transactions not yet in a block.


Quote
Also, what part does the "wallet.dat" play? Does it store your private key? If it does, why does it need to be backed up after each transaction?

Yes, it stores keys, transactions, various program settings and other features such as the new account system.

It needs to be backed up after each transaction due to "change" transactions.  If you receive 1000 BTC, then send me 1 BTC, bitcoin will create a transaction that looks like this:

     input: { 1000 BTC }
     output: { 1 BTC },
               { 999 BTC }     <---- change transaction, from yourself, to yourself

If you lose your latest backup, you might lose those 999 BTC, because you don't have the keypair associated with it.

Jeff Garzik, Bloq CEO, former bitcoin core dev team; opinions are my own.
Visit bloq.com / metronome.io
Donations / tip jar: 1BrufViLKnSWtuWGkryPsKsxonV2NQ7Tcj
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!