Bitcoin Forum
April 30, 2024, 11:05:58 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bitcoin Core - storing blockchain data  (Read 180 times)
leafsfan1967 (OP)
Newbie
*
Offline Offline

Activity: 25
Merit: 2


View Profile
March 29, 2019, 02:12:21 PM
Last edit: March 29, 2019, 03:50:25 PM by leafsfan1967
Merited by LoyceV (1), LeGaulois (1)
 #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!!
Every time a block is mined, a certain amount of BTC (called the subsidy) is created out of thin air and given to the miner. The subsidy halves every four years and will reach 0 in about 130 years.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714518358
Hero Member
*
Offline Offline

Posts: 1714518358

View Profile Personal Message (Offline)

Ignore
1714518358
Reply with quote  #2

1714518358
Report to moderator
1714518358
Hero Member
*
Offline Offline

Posts: 1714518358

View Profile Personal Message (Offline)

Ignore
1714518358
Reply with quote  #2

1714518358
Report to moderator
1714518358
Hero Member
*
Offline Offline

Posts: 1714518358

View Profile Personal Message (Offline)

Ignore
1714518358
Reply with quote  #2

1714518358
Report to moderator
mikeywith
Legendary
*
Offline Offline

Activity: 2212
Merit: 6366


be constructive or S.T.F.U


View Profile
March 30, 2019, 01:47:08 AM
Merited by nc50lc (2), LoyceV (1)
 #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.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
nc50lc
Legendary
*
Offline Offline

Activity: 2394
Merit: 5568


Self-proclaimed Genius


View Profile
March 30, 2019, 04:52:24 AM
Merited by LoyceV (2)
 #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

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
darosior
Sr. Member
****
Offline Offline

Activity: 279
Merit: 435


View Profile
March 30, 2019, 11:07:44 AM
Merited by LoyceV (1)
 #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.
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!