Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [block-header]

The block header is a portion of each block in the block chain that identifies the basic parameters of that particular block such as the block version, the time it was generated, the hash of the previous block, and the hash of the transactions in that block.

1
vote
1answer
59 views

Unusual Version Number in Blocks

I've noticed recently that some blocks contain version numbers that are not the traditional 0x10000000 or 0x20000000. For example, this block, has a version number of 0x3FFFE000 instead of 0x20000000 ...
1
vote
1answer
20 views

Significance of the “hash” field reported by the 'bitcoin-cli getblock' command

It is stated that the header of a block does not contain a 'hash' field ( see https://en.bitcoin.it/wiki/Block_hashing_algorithm or Antonopolous' Mastering Bitcoin 2nd Ed. ) This makes sense since ...
1
vote
2answers
97 views

Merkle root Vs transaction hashes

It is not clear to me, why not we can simply store transaction hashes in a block header instead of storing the Merkle root. I understand that storing transactions' hashes will slightly increase size ...
2
votes
0answers
83 views

Is my understanding of Blockhain Endianness correct?

I know questions on this topic have been asked to death in a number of different ways. I also know that what endian order refers to specifically is dependent on context. What I want are some ...
1
vote
1answer
116 views

Why there is no block index or block height included in the block header?

Why block index or block height is not included in the block header? Do we have to go through the whole chain if we want to know how many blocks are there in a chain? On the other hand, if some blocks ...
1
vote
1answer
32 views

What should be less than the target?

When I go to BlockExplorer and observe the hash of block 514441's header I see it to be: 0000000000000000004ec916884d8b2cd3dc0e80ab199cc23e528e7dc10fafc6 However when I obtain the header of block ...
0
votes
0answers
80 views

How to get a block header?

I am trying to get the header for block #514441 The hash of #514441 is: 0000000000000000004ec916884d8b2cd3dc0e80ab199cc23e528e7dc10fafc6 The hash of the previous block (514440) is: ...
0
votes
0answers
52 views

Does an SPV download the block headers from other nodes than the one that is servicing him?

If I understand correctly. The SPV downloads the block headers, from somewhere? It then uses the merkle root in the block headers, to validate any transactions that the full node servicing him ...
0
votes
1answer
41 views

When computing the hash, do you need anything after the number of difficulty bits?

I'm going to screw up a lot of the terminology here. I'm trying to understand the Bitcoin algortihm and wanted to use this JS miner -- https://github.com/howardchung/jsminer . Specifically, I'm ...
0
votes
0answers
90 views

read from blk.dat

Hy everyone! I have a little problem with the previousblockid read from blockheader. I do it like in the picture but when i get the hash and i search it in https://blockchain.info/ It couldn't find.
2
votes
2answers
199 views

Are there any blockchain explorers that provide raw Tx data and block headers?

I've looked at some of the more popular blockchain explorers, but none of them seem to provide the feature I'm looking for. I'd like to find a blockchain explorer that allows you to see raw Tx data ...
3
votes
2answers
657 views

What is the difference between Root Hash and Block Hash?

I was reading about how Bitcoin works from Satoshi's original paper. I had a query while going through the 7th paragraph. What is the difference between Root Hash and Block Hash? Isn't the block hash ...
0
votes
1answer
294 views

Bitcoin Blockchain Parser to get all block headers

I am looking for on-line or off-line run Bitcoin Blockchain Parser to get all block headers only All I need is ########## Block Header ########## Version: 1 Previous Hash ...
6
votes
1answer
2k views

Calculate hash of block header

I'm trying to calculate the hash of block #502871. This is the block: { "result": { "hash": "00000000000000000020cf2bdc6563fb25c424af588d5fb7223461e72715e4a9", "confirmations": 35, "...
1
vote
1answer
143 views

Why do block explorer APIs say the nonce in the block header is 0?

Several block explorers are reporting that the nonce value in many block headers is 0. For example, blockcypher, Why does this happen? Where can I get the actual block headers?
1
vote
1answer
175 views

Do you know any download site for full blockchain header data (6) in CSV ASCII format?

do you know any download site for full blockchain header data (6 variables) in CSV ASCII format ? I would like to enter block header data for every block from No.0 to latest into mining simulator to ...
2
votes
0answers
156 views

Help in understanding block header input data for scrypt

I am an computer engineering student trying to understand how the Litecoin scrypt algorithm works. I downloaded the Github cp-uminer. Can someone give me some examples what the input data look like ...
4
votes
1answer
492 views

How is mining difficulty defined (formula)?

The result of sha256(s) that miners attempt is a 256 bits long number (64-digits hexadecimal number). I understand that this 256bits number should be lower than the target threshold, the target ...
1
vote
1answer
316 views

Merkle Root for 1-transaction block!

I know that merkle hash for one transaction tx is: sha256(sha256(tx)) In this block: https://blockchain.info/block/000000000000000001291219dde8ed705903e8c101f416c68a439e5171ede5bc there is only one ...
1
vote
1answer
372 views

merkle root 2 codes

While trying to calculate the merkle root in python from the data i got from the mining pool.... i found there are 2 different codes. code 1: def build_merkle_root(coinbase_hash_bin, merkle_branch):...
3
votes
1answer
929 views

Mining Block header bit reversing

While trying to understand the mining process and checking in python..... i am puzzled with which info from/to pool are in Little Endian, which one needs reversing in building the block header + ...
1
vote
1answer
146 views

Hash that defines previous block in Blockchain vs mathematical solution

Is the hash that defines the previous block (block A) in a new block (block B), the same as the hash the miner calculated to submit block A? As far as I know, you need to find a nonce so that the ...
0
votes
0answers
127 views

How generate a hex string for a block

I have written this code to create and submit a new minned block to the bitcoin network: unsigned long magic_number = 0xD9B4BEF9; unsigned long block_size = 89 + (strlen(coinbase_transaction)-1) +...
0
votes
1answer
3k views

To create a blockchain using MySQL database

I want to create local blockchain for my application. New blocks should be created while giving reference to previous block. But I am not getting exactly how will I do it in MySQL? I got some idea ...
0
votes
1answer
739 views

How to generate a block header?

good afternoon I set myself a task to understand the work of the miner, but as you understand it is difficult for a beginner. Constantly there are questions. Without conditionally, I turn to Google ...
1
vote
1answer
645 views

how to convert blockchain to new version?

I have altcoin bassed on old Litecoin sources, end i try to convert it for latest available sources. How i can do this ? What need for this ? I try simple download it on old wallet, then run new. But ...
1
vote
1answer
848 views

Is the hash of the previous block included in the block header?

What the title says above, but for more clarification I am asking whether the hash of the previous block header is part of what is hashed to create the header of the new block? Like what are all the ...
4
votes
1answer
2k views

How does Segwit prevent ASICBOOST?

I know that ASIC BOOST exploits the fact that the blockheaders are not a multiple of 64 bytes, but what is the change in Segwit that prevents this? Are they always a multiple of 64 bytes now for ...
0
votes
1answer
233 views

How can miners alter timestamps to prevent or delay BIP09 feature activation?

In bitcoin mailing list , a proposal had the following concern. BIP 09 is vulnerable to miners fiddling with timestamps in a way that could prevent or delay activation - for example by only ...
1
vote
1answer
84 views

Does the 1 MB block size limit include the header?

I was able to follow the code to validation.cpp: // Size limits if (block.vtx.empty() || block.vtx.size() > MAX_BLOCK_BASE_SIZE || ::GetSerializeSize(block, SER_NETWORK, PROTOCOL_VERSION | ...
12
votes
1answer
17k views

What is a nonce?

When I see the block info on blockchain, I see that there is a field named "nonce", I could not find any relevant information on web regarding what a nonce is. Please explain what a nonce is what is ...
1
vote
1answer
1k views

Creating a P2P network like Block Chain

Posting this in Bitcoin community because I believe that you guys would be the best to answer the question since my question is related with the blockchain. I am wondering how to create a P2P ...
0
votes
1answer
160 views

How a Light Node can get a block?

I'd like to better understand how a light node can retrieve a complete node. If I understood correctly, I can consider a light node a node which is part of the peer-to-peer network that receives and ...
2
votes
1answer
193 views

SPV clients - how much does occupy the full blockchain headers?

Does a spv client need to download the full blockchain headers? how much does it occupy? is it better for security? I saw a blockchain-headers file in my android wallet that only occupies -30MB.
-1
votes
1answer
227 views

Is the miners address part of the block or the block header? [closed]

Should the following be sufficient merkle root, block number, previous block hash, timestamp and nonce?
2
votes
1answer
341 views

How is the mempool incorporated in the calculation of the block hash?

So I've been reading about how the nonce is calculated. There is one part that I don't get. So there is a mempool, and each node (or mining node) takes a part (or the whole part) of that mempool, ...
0
votes
3answers
511 views

Bitcoin-qt taking forever to acquire the blockchain

I thought that this was the old days when it took forever for bitcoin core to acquire the bootstrap but it looks like it's still the case. I basically ran the program for 2 hours and I'm still under ...
1
vote
2answers
395 views

Reason behind hashing the nonce in prevBlockHash?

I understand the role that the nonce plays in the block header for calculating a hash for a valid proof of work. But what I ask is: Do we consider the nonce in the prevBlockHash calculation of the ...
5
votes
1answer
478 views

bitcoin protocol: transaction encoding

I am writing a program (in golang) to mine bitcoins. Supposing I have this dummy transaction, how may I encode it so it can be used in the block im trying to mine? Also, supposing I have a block ...
5
votes
1answer
2k views

Bitcoin mining: block structure

please note I have made this question previously (link) and I was indicated to visit here. I am writing a program using GoLang to mine bitcoins. It's part of my college conclusion project and likely ...
3
votes
1answer
91 views

Why does bitcoin-cli return strange version numbers for blocks?

I've been looking at the version numbers of blocks, but I'm getting strange results from bitcoin-cli getblock. "version": 536870913 However, when I run the same command with the false option (to get ...
5
votes
3answers
2k views

At which point do blocks get validated in the mining process?

I'm trying to understand how mining works and I'm stuck on the part about validating blocks and adding them to the blockchain. When a miner finds a solution to a block, he shares it with the network,...
2
votes
2answers
572 views

getting bitcoin address of blk*.dat files

I know that getting the address from the blk*.dat files is discussed a lot of times. But I don't get it why? When I have the raw scriptSig I can encode it and get the bitcoin address or not? E.g. the ...
1
vote
1answer
229 views

Previous block hash on first Bitcoin block?

The bitcoin-explorer command bx fetch-header -t 1 fetches the first Bitcoin block and shows the block header. If I check the "first" block header, where does "previous block hash" come from?
2
votes
1answer
888 views

Do the leading zeros in the desired hash pattern for mining change?

If I understood it well, miners collect transactions in temporary files on which they apply a cryptographic function. The result will be reviewed against a desired pattern. Does this "desired pattern"...
2
votes
2answers
373 views

How often do miners recalculate the merkle root they're working on?

I think that I understood most of the things about Bitcoin but there is still a mystery. We can see on https://blockchain.info/ that there are up to 4/5 new transactions every seconds. My question ...
1
vote
0answers
86 views

Why do transactions get verified before it is clear that the block header is valid?

When I researched for the answer on What happens in detail, when Bitcoin Core verifies a block during synchronization?, I noticed something: According to the Wiki-Entry on Protocol rules some of the ...
7
votes
1answer
3k views

How does the bitcoin network recover in case of a hash collision in the block hash?

A Bitcoin client has to download the whole blockchain from the P2P network in order to become a full node. A full node is able to determine, if a transaction in the network is valid or not. To ...
3
votes
1answer
2k views

Why is the block header 80 bytes, not 128 bytes (= two SHA-256 blocks)?

According to the Bitcoin Developer Reference, the block header is 80 bytes total: BYTES NAME 4 version 32 previous block header hash 32 merkle root hash 4 time 4 nonce ...
1
vote
1answer
217 views

Block Broadcasting - Unsolicited Block Push

Can someone, please, direct me to the source code section(s) relevant for an Unsolicited Block Push as described in the Bitcoin Developer Guide? I've been going through main.cpp and searched for the ...