47

On the person's computer?

On bitcoin.org? :)

Where does that information reside that tells others and me how much bitcoins I have?

I assume it can't be on my PC because I could easily hack the file that contains that data and get myself more bitcoins, right?

Murch
  • 75,206
  • 34
  • 186
  • 622
Alex
  • 568
  • 1
  • 5
  • 8
  • 1
    All the crypto assets like Bitcoin, Ether etc are stored on the their respective blockchains. The information like your balance is stored on a particular block with other details like creation creation time etc, which can't be altered. The sites like https://live.blockcypher.com/btc/ , shows your balance using your public address. Anyone who knows your public keys can know your balance, transaction history as well. However with the access to the private keys, you claim that a particular public address belongs to you, which means you have the "rights" to control your funds(Transfer etc). – bitsabhi Jan 17 '18 at 06:34

8 Answers8

59

It seems like what's called for here is a basic explanation of two of Bitcoin's big concepts: the wallet and the blockchain:

  • A "wallet" is a collection of ECDSA keypairs. For those not familiar with cryptography, a keypair consists of a "public key" and a "private key" which can be used to encrypt or sign bits of data. The public key, as the name suggests, is known to everyone and can be used to encrypt messages in such a way that the holder of the private key alone may decrypt them. The private key may also be used to sign messages in such a way that anyone holding the public key may verify that the message truly came from you. Every Bitcoin address consists of such a keypair - the "address" you send people is the public half and the private half resides in your wallet.dat file.
  • The "blockchain" is a constantly growing database of transaction information which is sent out to all nodes in the Bitcoin network. When you perform a transaction, that transaction is distributed to the network and assuming the transaction is valid, will be included in the next "block." This is where the coins themselves are stored. When you initiate a transaction, all previous transactions to or from that address are scanned and a balance is calculated. If your transaction exceeds this available balance, it will be rejected by the network and will not be included in a block.

It's also important to note that the blockchain technically doesn't store "coins" it stores transaction information. The coins themselves are not discrete things which need storage - when coins are mined the miner's balance is credited via a "generate" transaction which adds to his or her available balance. When coins are sent from A to B, that transaction subtracts from A's balance and adds to B's balance. This is similar to the way that your employer may, via EFT, send "money" to your bank and you can use your debit card to spend that "money" in a store, all without anyone ever seeing a discrete physical dollar bill. Most money in the world today exists merely as transaction histories and balances - Bitcoin is no exception.

David Perry
  • 14,378
  • 5
  • 62
  • 99
  • 2
    Excellent explaination, thanks. So you can really just store an offline backup of your wallet on a flash drive and you don't really need to run the wallet client actively until you want to make a transaction? – John Nov 06 '13 at 19:40
  • 3
    Are you sayng that every node on the bitcoin network contains the entire history of all transactions ever perfomed by bitcoin owners? Second, what is a "node"? Any computer with a bitcoin wallet? – Nilzor Mar 11 '14 at 08:15
  • 2
    It depends on what software you're using, actually. Way back when I wrote this answer there was really just the one wallet software and yes, it stored every single transaction ever. Today there are several options and not all of them store all data. Electrum, for example, runs thin clients which connect to servers that store the whole blockchain and many phone wallets only store blocks containing transactions that pertain to them. In general, however, it is considered preferable for each node (computer running software) to store everything. – David Perry Mar 14 '14 at 07:58
  • David, thanks, but there are several vague things i cant understand. I will list: 1) in case all transactions were stored in individual node/pc, so that person (pc holder) can open(view) that data and alter? (yes or no) 2) if he can alter the data, then what happens? the system checks if that data is same as the data what other thousands of nodes store? how it is validated I cant understand, if individuals could change the data... 3) where is the core host(server) or appliance, which gives you permission to reject or add transaction ("generate") to your account? who decides that? – T.Todua Feb 06 '18 at 15:53
  • when transaction happens, where it is stored/updated at first? i.e. on someones node? and in the far side on the earth somewhere, on a node, that transaction update might happen after X seconds/minutes, and if during that time, another transaction happens by the same holder??
  • – T.Todua Feb 06 '18 at 16:06
  • @T.Todua, did you find answer for your 4 questions listed above? If yes can you please post here. – Vishal Singh Jun 09 '18 at 06:17
  • @VishalSingh I doubt that even bitcoin creator hardly knows how all this work :) – T.Todua Jun 10 '18 at 18:33
  • @David - Can you please elaborate on: "When you initiate a transaction, all previous transactions to or from that address are scanned and a balance is calculated."? How are they scanned? Is there a running balance that can be determined by looking at the most recent block containing that address or do all blocks need to be scanned? – Matthew Jul 27 '18 at 01:23
  • Supposes the owner of the bitcoin account dies then where does that money goes? I mean in legacy cases the money is safe with the bank and can be passed to nominee – Nitin Sawant Feb 05 '19 at 13:02