Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
16 views

Mining against candidate block hash or previous block hash? [duplicate]

When mining...; a) Is the block header hash of the candidate block used b) OR the block header hash of the previous block + noonce used? If it is a), which I presume, is it then correct that the ...
user avatar
  • 1
1 vote
2 answers
59 views

How to calculate the version (eg. in Python)?

I'm working through this medium post that describes all header fields of a block. The explanation of the version field is a little unclear for me. For starters I'm trying to consider version = 1, as ...
user avatar
  • 113
0 votes
1 answer
35 views

What actual steps are required to calculate a block's header hash?

From my knowledge a header hash will be calculated like this: serialize all header fields, including "the nonce" hash the serialized header once hash the hashed serialized header again ...
user avatar
  • 113
1 vote
1 answer
192 views

How to download just the blockheaders for the blockchain

I'd like to download all the blockheaders for the blockchain directly from the network (not an external API) ... what is the best way to do this? I don't actually care about the transaction data and ...
user avatar
1 vote
1 answer
595 views

If a lot of miners start at nonce 0, how are there no ties?

I understand what happens with ties (in the long term, the longest chain wins), however, if a majority of miners start with a nonce of zero, does it just matter who has the fastest hardware, or is ...
user avatar
0 votes
1 answer
252 views

What is the correct way to calculate timestamp for a Block(125552)?

I am just learning mining process. Today I learned that we have to find nonce for given block header. And for block header we need timestamp in UTC I took the timestamp data from below link of 125552 ...
user avatar
  • 3
0 votes
0 answers
12 views

Is the block header the data that gets hashed or is it the info of the transactions that get hashed? [duplicate]

I just need to know what is the data that gets hashed. Also if the nonce is put from the beginning or if it's only out if it doesn't meet the requirements of the target. Thanks.
user avatar
  • 11
0 votes
1 answer
58 views

What parts of a block, other than the nonce, can a miner vary

What are the list of all the variables whose values that the miner can cycle or modify to get a valid hash for this block (with very high probability) ? The only one I am aware of is: Nonce - 4 Bytes....
user avatar
  • 107
0 votes
1 answer
44 views

How to pad Bitcoin Header in the SHA Algorithm Passes?

For any bitcoin block we combine various Header fields to create a string which is an input to a 2 pass SHA algorithm. The resultant hash must match with the Hash in the Block header for the Block to ...
user avatar
  • 107
0 votes
2 answers
158 views

A query regarding Bitcoin Header Format

I am new to Bitcoins and still learning thus please bear with me. As I read Bitcoin Block header (on which the Block Hash is computed) is supposed to be: hash - 32 Bytes ver - 4 Bytes prev_block - ...
user avatar
  • 107
3 votes
2 answers
155 views

What data is hashed to produce the block hash?

Exactly which items from a block are included in the data that is hashed to produce the block hash?
user avatar
1 vote
2 answers
820 views

How strict are the Unix Epoch time validation rules?

According to bitcoin.org, full nodes have a strict requirement on the deviation of time within certain boundaries. The block time is a Unix epoch time when the miner started hashing the header (...
user avatar
  • 1,359
1 vote
2 answers
100 views

Why does the Genesis block appear to have a lower hash than necessary?

The hash of the genesis block of bitcoin has two extra 0 as compared to other block hashes. According to the logic, it should have been the same as they all have the same difficulty. Why is it so? Was ...
user avatar
1 vote
1 answer
50 views

Do peers advertise their chain work?

If yes, is this how a node decides that the peer has the best chain for headers-first download?
user avatar
  • 31
1 vote
1 answer
32 views

What exactly happens to leaves when forming nodes?

If you hash TXIDs with sha256 twice, you get the leaves of the merkle tree. As far as I understand the two outputs of the TXIDs are concatenated / paired. What does that mean? Are they added together?
user avatar
0 votes
1 answer
255 views

how to hash block header in c++

I want to hash a block header in C++ but dont know how. Im just using a test block at the moment, so that I know what the expected outcome is. https://www.blockchain.com/btc/block/669892 I have a ...
user avatar
0 votes
0 answers
204 views

How do I hash header block with C++

So im trying to hash a header in C++ and I am having some trouble. I have tried different libraries (cryptopp, openssl) cant seem to hash the header correctly. This is the block which I am testing: ...
user avatar
0 votes
1 answer
125 views

How to get the list of blockheader

I know that i can use getheader 'hash' from bitcoin core, but i can't use it for all blocks, it's time consuming. Is there a site where i can find all bitcoin blockheader? Like a blockchain site but ...
user avatar
  • 176
1 vote
1 answer
93 views

Does the Merkle Root get constantly updated inside the block or does it only get added once the block is completed?

So, pretty much just the title. I'm just wondering how the Merkle Root works exactly. I know it's the result of pairing transactions and then hashing them until the last transaction in the block, but ...
user avatar
  • 69
0 votes
1 answer
53 views

What is the difference between the two transaction headers on the Bitcoin Liquid sidechain network?

You can see transactions for this asset https://blockstream.info/liquid/address/H4UWQS836njW4QJ6WfkGAPjaYtK2twLnZE For the second transaction, it has a header of ...
user avatar
2 votes
1 answer
137 views

Is a timestamp in bitcoin different than just the "stamp of time"?

In the "References" section of Bitcoin's whitepaper, Satoshi Nakamoto points to three papers that serve as inspiration for digital timestamping. When you read those documents it is clear ...
user avatar
  • 21
3 votes
1 answer
58 views

What is the proper way to handle reorgs when fetching headers

I work on bitcoin-s, and we've found a problem where if a node is stopped with it's chain tip being a one that is later reorged out it will not be able to continue syncing headers. This happens ...
user avatar
2 votes
2 answers
180 views

Merkle root with one transaction

I am trying to build a merkle root which contains only the coinbase transaction from bitcoind. After creating the coinbase transaction, do I need to convert it to little endian, hash it twice and then ...
user avatar
  • 176
0 votes
0 answers
44 views

Can I get all block header data like the SPV node?

It hasn't been long since I studied Blockchain. I only need header data, not all block data, for study purposes. As far as I know, the SPV node stores only the block's header information. Can i get ...
user avatar
1 vote
2 answers
218 views

What is the optimal way to increment extranonce?

I'm trying to learn how to block headers are created and an efficient way of doing so. Given a list .of transactions, can I change the extranonce without having to rehash the entire list? EDIT: To ...
user avatar
  • 13
2 votes
1 answer
126 views

How to build coinbase transaction from bitcoin core?

I am coding a program that connects to bitcoin-qt as local server. For building the blockheader i need the merkleroot, to build the merkle root, i need the coinbase transaction (which is not provided ...
user avatar
  • 176
4 votes
1 answer
1k views

"New rules activated" warning after upgrading to 0.20.0

I've upgraded a node from the previous release. It's up and running but for some reasons I get this warning. How can it be related to the upgrade? $ bitcoin-cli -testnet getblockchaininfo | jq { "...
user avatar
  • 43
1 vote
1 answer
76 views

A Bitcoin soft fork idea to help compress the blockchain

I've thought about a soft fork that can help storage costs. Why don't we force miners to embed the height of the TX Merkle tree in the first two bytes of the 4-byte block header version? It would ...
user avatar
  • 9,789
0 votes
1 answer
59 views

Calculate BitcoinGold Block Header Hash [closed]

I am trying to calculate block hash # 632295 { 'version': 536870912, 'prev_block_hash': '000000017590609fd72cadc5fd05732cfa1760bd882213afbb7b788c42e115c8', 'merkle_root': '...
user avatar
3 votes
0 answers
190 views

Block 620826 is 1 second before block 620825? [duplicate]

How does that happen? Obviously the miner of 826 built his block on top of 825, but why is the time 1 second earlier?
user avatar
  • 354
1 vote
3 answers
2k views

Get transaction data from full node

Background Information I am building an application that requires the ability to query any bitcoin full node (from a python script using raw tcp sockets) in order to read the OP_Return value listed ...
user avatar
1 vote
2 answers
1k views

How to get block header hex?

I am trying to research hash functions and I want to be able to use bitcoin's mining outputs as hashes. I am curious about where the actual hex value of the data that generates that hash with a lot of ...
user avatar
4 votes
2 answers
1k views

Which block header fields are miners able to change in an effort to avoid having to recalculate the Merkle Root?

In addition to the nonce and the Merkle Root, there are 4 other fields in the header - version, previous header hash, time and nbits. Assuming a miner does not want to change the merkle root because ...
user avatar
0 votes
0 answers
738 views

How to dissect or decode a BTC transaction?

I used a packet capture to capture the transaction of bitcoin, and I got the following: ...
user avatar
0 votes
1 answer
80 views

bitcoin's PoW, real time of creating one block

i learn that bitcoin is created every 10 minutes and if block is created faster than 10 minutes, Difficulty will increase. and study deeper, mining process is finding nonce that start 0 to increase 1 ...
user avatar
2 votes
2 answers
1k views

What is the most optimal way to parse a raw bitcoin block with python?

Let's say one is connected to a zmq socket and listening for rawblock. How you'd parse the block header is as follows: block_header = raw[:80] version = block_header[:4] prev_merkle_root = ...
user avatar
  • 1,359
6 votes
2 answers
263 views

Can a full node provide a bogus block bloomfilter to a Neutrino node?

When a thin client using BIP157/BIP158 (Neutrino) requests the block filter for the latest block, would it be possible for the full node serving this request to attack the Neutrino node by providing a ...
user avatar
  • 62.5k
9 votes
2 answers
247 views

Why are block header bits necessary? (Valid difficulty is already implied by chain history)

Difficulty or target is implied by chain history, so why does it need to be explicit in the header? I suppose it exposes miner-intended-difficulty, but I don't see why that would be relevant without ...
user avatar
  • 2,423
6 votes
1 answer
1k 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 ...
user avatar
  • 933
1 vote
1 answer
39 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 ...
user avatar
  • 115
1 vote
2 answers
300 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 ...
user avatar
2 votes
0 answers
275 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 ...
user avatar
2 votes
1 answer
504 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 ...
user avatar
  • 75
1 vote
1 answer
80 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 ...
user avatar
  • 11
0 votes
1 answer
78 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 ...
user avatar
  • 405
3 votes
3 answers
3k 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 ...
user avatar
  • 133
4 votes
2 answers
2k 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 ...
user avatar
0 votes
1 answer
1k 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 ...
user avatar
  • 55
9 votes
1 answer
3k 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, "...
user avatar
  • 177
1 vote
1 answer
266 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?
user avatar
  • 55