Author

Topic: Bitcoin Core - storing blockchain data (Read 202 times)

sr. member
Activity: 279
Merit: 435
March 30, 2019, 07:07:44 AM
#4
Hi all - I had a question.
Hi

I just started a full node using bitcoin core and it is currently syncing/validating the past blockchain and catching up. I understand that the default setting in bitcoin core is that non-wallet transaction data is not stored on your harddrive in the blockchain data. My questions are then:

1. How does my node verify/validate the past blocks without knowing the transactions from that block? I'm assuming other nodes don't store the transaction data so how is it that my node obtains the transactions to do a full validation of the particular block?
All transactions that ever been made on the Bitcoin network are in the block chain that you are downloading, including "non-wallet transactions".

1. Having downloaded all the transactions, your node is able to verify the merkle root and the hash the next block contains. Your assumption is wrong, if no more nodes (or a few ones) store past transactions then a new node joining the network would have (more or less) to trust some entity.

2. If the transactions are not stored on my computer, how do I have a full copy of the blockchain? I thought this was one of the points of running a node - you have a full backup of the entire blockchain. How could I reproduce the entire blockchain (if needed) without having the transaction data within each block?
See the answer to 1.

3. If transactions are not stored, what exactly is stored in the block data and how is that useful?
A block is composed of a header (with metadatas such as a timestamp, a version, the previous block hash (to make a chain), the target, the merkle root (a ~smart hash of all the transactions this block contains, the nonce) and transactions (preceded by a transaction count).

4. If transaction data is not stored in the block data of your computer (ie: txindex=0), how can you reproduce all the transactions if needed without having to download anything or connect to intenet to get it from other nodes if say you were the last node with a copy of the blockchain (eg: in case of an emergency if say, theoretically, all blockchains were somehow deleted and mine was the only one left)?

would really appreciate your help!!
If you didn't prune (and you would even in this case have downloaded the blocks then have deleted part of them), then you have all the transactions that were ever made on the network.
legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
March 30, 2019, 12:52:24 AM
#3
By saying "non-wallet transaction", I would guess that you're talking about txidex=0 default.
With txindex disabled, you won't be able to get the transaction data using RPC from other transactions other than the ones in your wallet.

If it isn't a pruned node, the full blockchain will be stored as blk.dat in your drive regardless of the txindex settings.

1. How does my node verify/validate the past blocks without knowing the transactions from that block? I'm assuming other nodes don't store the transaction data so how is it that my node obtains the transactions to do a full validation of the particular block?
Nodes are programmed to check each block from syntax errors to network rules violation, if there's something wrong, it will be rejected.
When it comes with previous blocks, the block header in each block that contains the merkle root is enough to verify them.

Quote from: leafsfan1967
2. If the transactions are not stored on my computer, how do I have a full copy of the blockchain? I thought this was one of the points of running a node - you have a full backup of the entire blockchain. How could I reproduce the entire blockchain (if needed) without having the transaction data within each block?
Transactions are stored in the blocks (blk00000.dat~ in your computer).
Actually (as an answer to 3 and 4) you can use a block parser to convert the raw (binary) data into HEX or human-readable format.
Example: Readable: Block height 443870 / HEX: Block height 443870

Quote from: leafsfan1967
3. If transactions are not stored, what exactly is stored in the block data and how is that useful?
Bunch of 0's and 1's  Grin
legendary
Activity: 2366
Merit: 6555
be constructive or S.T.F.U
March 29, 2019, 09:47:08 PM
#2
I understand that the default setting in bitcoin core is that non-wallet transaction data is not stored on your harddrive in the blockchain data. My

as far as i know, if you are not running your node in pruned mode then you are actually downloading everything including non-wallet transaction to your hard disk, which is the default setting in bitcoin core  IIRC.
newbie
Activity: 25
Merit: 2
March 29, 2019, 10:12:21 AM
#1
Hi all - I had a question.

I just started a full node using bitcoin core and it is currently syncing/validating the past blockchain and catching up. I understand that the default setting in bitcoin core is that non-wallet transaction data is not stored on your harddrive in the blockchain data. My questions are then:

1. How does my node verify/validate the past blocks without knowing the transactions from that block? I'm assuming other nodes don't store the transaction data so how is it that my node obtains the transactions to do a full validation of the particular block?

2. If the transactions are not stored on my computer, how do I have a full copy of the blockchain? I thought this was one of the points of running a node - you have a full backup of the entire blockchain. How could I reproduce the entire blockchain (if needed) without having the transaction data within each block?

3. If transactions are not stored, what exactly is stored in the block data and how is that useful?

4. If transaction data is not stored in the block data of your computer (ie: txindex=0), how can you reproduce all the transactions if needed without having to download anything or connect to intenet to get it from other nodes if say you were the last node with a copy of the blockchain (eg: in case of an emergency if say, theoretically, all blockchains were somehow deleted and mine was the only one left)?

would really appreciate your help!!
Jump to: