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
1
vote
1answer
19 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?
0
votes
0answers
13 views

Building Compatible Blocks Post Block 227836 - Relevant BIPs

To build a miner capable of mining at today's blockchain level of complexity, are there any other relevant BIPs aside from the SegWit spec and Bech32 address scheme? I have implemented compatibility ...
0
votes
1answer
42 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 ...
0
votes
1answer
52 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 ...
0
votes
0answers
59 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: ...
1
vote
1answer
54 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 ...
0
votes
1answer
46 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 ...
6
votes
3answers
9k views

Full example data for scrypt Stratum-client [closed]

I'm trying to write a Mining client for Scrypt-based mining using Stratum Communication. As of now, I have some trouble verifying all my bit orders and sequences. Hashes I'm generating get always ...
11
votes
1answer
11k views

Is it chain of headers rather than a chain of blocks?

We know widely used explanation of the blockchain: "Every block contains a hash of the previous block". The sentence above implies that since every block contains a hash of the previous block, ...
9
votes
2answers
174 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 ...
27
votes
9answers
5k views

Why don't the timestamps in the block chain always increase?

The timestamps starting at block 145044 are: 145044: 2011-09-12 15:46:39 145045: 2011-09-12 16:05:07 145046: 2011-09-12 16:00:05 // ~5 minutes before prior block 145047: 2011-09-12 15:53:36 // ~...
1
vote
1answer
67 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 ...
3
votes
1answer
451 views

Is there any relation between the block version field and the one of the transaction?

I am struggling to validate my custom miner against the testnet network and I can't seem to add a block of mine to the chain. I've noticed that all the other miners are appending version 2 blocks, so ...
5
votes
1answer
903 views

Version field in transactions, blocks, etc

A field labelled "version" appears in many contexts regarding the Bitcoin protocol. Sometimes one uses the current version of the Bitcoin client (version message), sometimes 1 is used (block, tx), why ...
3
votes
1answer
32 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 ...
1
vote
2answers
62 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 i need to convert it to little endian, hash it twice and then put ...
1
vote
2answers
68 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 ...
0
votes
0answers
25 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 ...
0
votes
0answers
35 views

Padding the blockheader in sha256

The block header size is 80 Byte (640 bits) so we must pad it to a multiple of 512 (In our case to 1024) like this: (blockheader in binary)+1+00000.....000+1010000000 where "1010000000" is ...
1
vote
0answers
63 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 ...
1
vote
1answer
61 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 ...
0
votes
1answer
43 views

Calculate BitcoinGold Block Header Hash [closed]

I am trying to calculate block hash # 632295 { 'version': 536870912, 'prev_block_hash': '000000017590609fd72cadc5fd05732cfa1760bd882213afbb7b788c42e115c8', 'merkle_root': '...
1
vote
3answers
1k 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 ...
3
votes
0answers
189 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?
5
votes
2answers
2k views

Why the timestamp component of the block header?

What is the reason for the timestamp field in the block header? Surely the nonce should be the only property that changes? Should the nonce reset to 0 everytime the timestamp changes?
0
votes
2answers
664 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 = ...
1
vote
2answers
488 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 ...
0
votes
1answer
994 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 ...
4
votes
2answers
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 ...
4
votes
3answers
383 views

How hard is it to alter a block after it was found?

Once a miner has found a block, how easy it is for him to add or remove a tx included in that very block? Would he have to solve the modified block from the scratch or is there a point he can resume ...
0
votes
0answers
456 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: ...
0
votes
1answer
65 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 ...
3
votes
3answers
2k 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 ...
4
votes
2answers
2k 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 + ...
6
votes
2answers
240 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 ...
26
votes
3answers
79k views

The bitcoin mining algorithm from a programmer's viewpoint

This page: Blocks said mining is actually to solve a mathematical problem, but reading Block hashing algorithm doesn't give much help. I also tried reading bitcoind source code, but reading code takes ...
1
vote
1answer
461 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 ...
5
votes
1answer
958 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 ...
2
votes
2answers
690 views

How does “headers first” affect BLKxxxx.dat structure?

Assuming a full node running Bitcoincore v0.10 (with txindex=1), how exactly does the new "headers first" functionality affect the structure of the blockchain data? (Specifically, the blkxxxx.dat data,...
1
vote
1answer
33 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 ...
2
votes
1answer
7k views

To create a blockchain using MySQL database [closed]

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 ...
1
vote
2answers
258 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
223 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 ...
2
votes
1answer
438 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
55 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
1answer
67 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 ...
15
votes
1answer
24k 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 ...
3
votes
2answers
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 ...
4
votes
1answer
832 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
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,...