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
36
votes
2answers
9k views

Nonce size - Will it always be big enough?

If I understand correctly, the block only has 4 bytes (32 bits) for the nonce. Is it possible for the difficulty to become high enough that there are no nonce solutions? If so, then what options does ...
25
votes
4answers
71k 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 ...
23
votes
4answers
4k 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 // ~...
19
votes
3answers
1k views

How would the Bitcoin protocol be impacted if nodes only stored the blocks they cared about?

Right now, full clients of the Bitcoin network store every block ever generated (while "thin" clients instead rely on a node which does so). This greatly increases first-time initialisation for the ...
18
votes
4answers
7k views

How can one embed custom data in block headers?

Some mining pool admins put custom data in block headers, like prayers. How do they do that? Where can I see that data for myself?
13
votes
1answer
21k 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 ...
11
votes
2answers
1k views

Mining pool performance optimization

What are the main components one should focus on when trying to maximize a mining pool's performance? Assuming the code is pretty optimal (there aren't any inefficiencies), what should a pool owner ...
10
votes
4answers
3k views

Is there a way to use the block chain as entropy in random number generator? [closed]

I want to create a transparent gambling/lotto site and use the block chain as entropy for lotto numbers, dice rolls, that kind of thing. Would the transaction hash of the latest transaction be the ...
9
votes
1answer
7k 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
1answer
27k views

Whats the process of Creating a Block on the BlockChain

have been mining on pools and blindly going a long for the ride of > generating a block Can somebody walk through the process in simple terms of the steps involved in creating a block on the ...
8
votes
5answers
3k views

Why didn't Satoshi make the nonce space larger?

I know Satoshi isn't around to ask anymore, so this might be futile to ask, but I'm hoping someone might have some insight about this. Bitcoin mining typically utilizes an extraNonce (bnExtraNonce ...
8
votes
2answers
379 views

Why is the Block Header txn_count field always zero?

According to the Protocol Specification, the txn_count field of a Block Header is always set to 0, why is that? What are the intended future uses of this field?
7
votes
2answers
2k views

How is it that concurrent miners do not subvert each other's work?

Every time a new block is added on top of block chain, the miners have to restart their work because the next block has to have a proper reference to previous block. Let's suppose that there is some ...
7
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, "...
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 ...
6
votes
2answers
204 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 ...
6
votes
1answer
5k views

Could Hadoop be used as a mining pool architecture? [closed]

The context is here I don't know how exactly the new blockchain candidate was calculated in Bitcoin Network, so I guess it was based on a Merkle candidate of (a) bitcoin client/s. Also I presume that ...
5
votes
3answers
8k views

Full example data for scrypt Stratum-client

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 ...
5
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 ...
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,...
5
votes
2answers
2k views

How to create a SPV client?

What are the steps a SPV client takes in order to sync? Connect to a peer Set bloom filter for wallet addresses Download all block-headers since latest checkpoint Request every block again with ...
5
votes
1answer
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?
4
votes
3answers
366 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 ...
4
votes
2answers
87 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 ...
4
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 ...
4
votes
2answers
1k 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 + ...
4
votes
1answer
592 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 ...
3
votes
1answer
459 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 ...
3
votes
2answers
1k 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 ...
3
votes
1answer
101 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 ...
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 ...
3
votes
1answer
581 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 ...
3
votes
1answer
160 views

What was the intended benefit of truncating the Target?

I'm thinking about how the Target value is truncated to and later compared to the SHA-256hash of the Block Header. Given that The maximum target (lowest possible difficulty) is ...
3
votes
1answer
417 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 ...
2
votes
3answers
625 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 ...
2
votes
2answers
402 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 ...
2
votes
2answers
560 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,...
2
votes
1answer
389 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, ...
2
votes
1answer
298 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 ...
2
votes
1answer
333 views

Why is the target stored in compact form in the block header?

Why is the target converted to "Bits" and not stored in full in the block header? For example, why: { "hash" : "000000000003ba27aa200b1cecaad478d2b00432346c3f1f3986da1afd33e506", "height" : 100000, "...
2
votes
1answer
820 views

Given a block, is there a list of all hashes for all possible 2^32 nonce values?

I am working in a computational research lab, and we're taking a look at Bitcoin. I'm trying to develop a simulation of Bitcoin mining for a nonexistent computer architecture. I want to simulate the ...
2
votes
2answers
663 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 ...
2
votes
1answer
959 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
1answer
264 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.
2
votes
0answers
123 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
0answers
183 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 ...
1
vote
1answer
764 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

Why do we need a mining speed above 4.3Ghash/s?

I believe there will be a simple flaw in my understanding somewhere. From what I can tell for any given block you increment a nonce up to 2^32 (4294967296) per second (and the timestamp every second) ...
1
vote
1answer
29 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
1answer
374 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 ...