Stack Exchange Network

Stack Exchange network consists of 175 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]

This tag should be used for questions related to Bitcoin blocks

1
vote
1answer
18 views

Block size limit in Bitcoin v0.01

In main.h (line 17) we have a constant MAX_SIZE static const unsigned int MAX_SIZE = 0x02000000; which in decimal format equals to 33554432 (32MB) This constant is used to verify if the block ...
0
votes
1answer
24 views

How and why we need to validate a transaction?

I've starting doing some researches about the Bitcoin protocol and the blockchain. I'm trying to understand all the sections in the Bitcoin white-paper. So far, i couldn't understand what is the ...
1
vote
1answer
31 views

How chaining the blocks protect against altering data?

I am confused with the block chaining, as i know a block header contains a reference to the previous block header hash with the merkle root and other fields. This header hash is related (computed) to ...
0
votes
1answer
27 views

How can get balance for btc/bch address and block?

How can get balance for btc/bch address and block ? Similar to web3.eth.getBalance for Ethereum
0
votes
1answer
28 views

Bitcoin fork resolution - Fork losers download previous blocks 'til common block?

When resolving a naturally occurring fork in Bitcoin, do the miners who were working on the orphaned fork download previous blocks from the miner who won the block reward that resolved the fork until ...
0
votes
2answers
46 views

Bitcoin checks and balances

When a new block is created, does each block need to be validated? How does it differ from validating transactions? Why miners would waste time validating transactions and blocks when they could ...
0
votes
0answers
24 views

Is it possible to get a block by timestamp?

I use Bitcoin Core API and I can retrieve a block by header hash as parameter using the getblock method. I need to get a block by given timestamp (median time). I found some solution. ...
0
votes
1answer
20 views

Block 566687 nonce with extranonce, how to interpret?

This could apply to any block, but I was checking this one out found by Slushpool. I've looked this up in Mastering Bitcoin and here on StackExchange, but the best I can get so far is: the coinbase ...
0
votes
3answers
67 views

Where is the data stored in Bitcoin?

Is all the data related with the transaction of bitcoin stored in blockchain or the data stored somewhere in the cloud and they are referenced from blockchain. I have this confusion because if we are ...
0
votes
2answers
43 views

What happens if “transaction size” is larger than “maximum block size”?

Assuming a transaction size is T Bytes, while maximum block size is B Bytes, such that T>B. What happens for this transaction? It will be divided into two smaller parts and will be stored in two ...
0
votes
1answer
36 views

Spending UTXO from same block

Block 546 is the first time a (actually two) transaction spends the UTXO of a transaction from the same block. Is the order important? (The transaction that generates the UTXO has to appear before in ...
0
votes
0answers
33 views

Locating Bitcoin mining activity

There is any systematic way to locate Bitcoin mining activity (either block creation or node activity). I stumble upon with Bitnodes code which implements a recursive search using some nodes as "seed",...
2
votes
1answer
44 views

How can block time and block size be fixed when transaction volume is constantly increasing?

As I understand it the network rejects blocks over 1MB, and block hash difficulty is set after each block is created as to keep the block time close to 10min. But if people are constantly joining ...
0
votes
1answer
43 views

what happens if a miner include a transaction already exists in another block?

Suppose that I have a Transaction A. (txA) I send my txA to bitcoin network and full node validate it and put in Mempool and starts to broadcasting it. A Miner A connect to a fullnode to create a ...
0
votes
1answer
23 views

Private Blockchains: Validation

I'm a software developer, and I have some questions about private blockchains, I'd like to have technical answers since I'm trying to understand blockchain at a code level. I'm going to write a ...
0
votes
1answer
36 views

How does a node decide whether a block is valid?

I'm a software developer, and I've been trying to figure out how a node decides whether a block is valid, I do understand the hashes in bitcoin, the merkle root, and all those aspects but my question ...
-1
votes
1answer
16 views

How to prevent nodes from creating only small blocks to earn fee?

I read What are the minimum sizes for transactions and blocks in Bitcoin? that there is no min limit - just a max limit of 128MB - for a block. For example if a miner always takes a single ...
0
votes
2answers
54 views

What Opcodes are used to store a file within Bitcoin? [closed]

At a block-to-block level, what is actually encoded at a byte[] level to encode a file stream?
0
votes
2answers
48 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 = ...
0
votes
1answer
39 views

Getting individual block by height from Bitcoin P2P network

Is it possible to request an individual block from the bitcoin network, using the block height as parameter? Or would one have to start a node and wait until all blocks up to the desired height have ...
1
vote
2answers
38 views

What exactly makes altering of data in non-bitcoin blocks hard?

If leading zeros is only bitcoin requirement, then what makes altering of data in blocks hard? Like now its easy to modify a block and generate new hash for every subsequent blocks since generating ...
2
votes
2answers
82 views

How does the structure of a segwit block differ from a non-segwit block?

Is there any difference in the structure of a segwit block in comparison to a traditional non-segwit block? A diagram would be helpful if possible.
2
votes
2answers
43 views

Each full node has different mempool?

I don't understand if each full node has different mempool inside. With RPC command getblocktemplate I can Get the information about candidate block. I can Find all transaction verified but ...
2
votes
1answer
32 views

Explanation of a block's fields one by one?

We can get bitcoin block data as JSON by command bitcoin-cli getblock <hash> 2, following is one for height 100000: { "hash": "...
6
votes
1answer
1k views

Why is increasing block size in the Bitcoin network considered to decrease security?

I have been doing some research on the Bitcoin Cash hard fork and the main contention of increasing the block size appears to be the possibility of less security on the network. How does an increased ...
4
votes
2answers
66 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 ...
2
votes
1answer
87 views

Why is a “first seen” rule is used to pick a side in a honest split, instead of deterministic criteria? [duplicate]

I was just thinking, why nodes pick the first block they see when there is an honest split, instead of picking, for example, the one with the "best hash" (number further away from the difficulty cut)? ...
1
vote
3answers
109 views

Block Validation: who does it? How much it costs? And is it present in all protocols?

Different threads were posted in order to clear up this question, but there are some points that I would need to confirm: When you become a full-node (NOT miner, you just downloaded the full ...
1
vote
2answers
53 views

mining: losers get nothing?

if the winning miner takes the 12BTC+fees, unless you own the biggest mining operation out there, or are not a member of the biggest pool, why bother mining, if there is no prize for second place? ...
1
vote
1answer
47 views

identical coinbase transactions

this sounds like an old topic but i have not found a satisfying answer yet; in history there lived two blocks with identical coinbase transactions: https://www.blockchain.com/btc/block-index/106662 ...
1
vote
1answer
28 views

What would happen if I publish a modified version of an earlier block? Would it be rejected immediately by peer nodes?

I am reading the book "Mastering Bitcoin" and have finished reading Chapter 2 and 10, but I still don't find the answer. Suppose the current main chain has 5 blocks: B0 <- B1 <- B2 <- B3 &...
1
vote
0answers
90 views

Estimated number of hashes

This is not a duplicate of previous, similar questions I've read on StackExchange, since none of those questions, nor the answers, go into the difficulty theory, as espoused on the Bitcoin Wiki. ...
1
vote
1answer
88 views

Fixing “Block not found on disk” rpc error

I have a full node with txindex enabled that I've been trying to use for an electrum server. However, whether I use ElectrumX or Electrs, I hit the same error on initial indexing of "Block not found ...
1
vote
0answers
19 views

What needs to be done inorder to change difficulty?

I'm trying for a while to reduce difficulty of main network to do some experiments on transactions and maybe simulate some possible attacks.I came up to change nBits field in chainparams.cpp but it ...
0
votes
1answer
21 views

Why the block's order in blockxxxxx.dat is different from blockchain.info

I parsed the block00000.dat using python code: class BlockFile: def __init__(self, block_filename): self.block_filename = block_filename self.blockchain = open(block_filename, 'rb', ...
2
votes
1answer
58 views

How come Merkle tree is more efficient when tree branches are not stored in blockchain?

Suppose we have 8 transactions in a block X as follows and we know every node's hash value of the whole Merkle tree (that is, including intermediary nodes such as 45). Then if someone claims ...
0
votes
2answers
39 views

Why most of pubkeys in the first batch of blocks in blk00000.dat are different

For example: the pubkey in the first 3 coinbase's output are 04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f ...
0
votes
2answers
71 views

Is there any python library could be used to decodescript in output

For example decode the ScriptPubKey like 4104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac to some data like ...
0
votes
1answer
15 views

Mining when there is no transaction [duplicate]

what happens when there is noone doing transactions and miners mine the blocks? Can they mine empty blocks? And how it works when there won't be any hash in empty block or there is a hash? Thank you
0
votes
1answer
22 views

Number of transactions in block

why sometimes block has 16 transactions and sometimes over 2000? I checked it on https://blockexplorer.com/blocks. Thank you
0
votes
1answer
23 views

In Litecoin every single block is mined every 2.5 minutes, double spending?

In Bitcoin it takes roughly 10 minutes for every block to be mined. In Litecoin it takes 2,5 minutes. 2.5 minutes in Litecoin mean that transactions can be confirmed faster. In Bitcoin these 10 ...
5
votes
2answers
898 views

Shortest and Longest block interval time ever recorded in Bitcoin

Bitcoin block interval time is on average 10 minutes, that is the difficulty is adjusted in such a way that every 10 minutes a miner will manage to find the right hash. This is just an average time ...
2
votes
1answer
58 views

Different balances in API block explorers for BTC

BTC.com block explorer shows bigger balance than for example Insight or Blockchair. For example: https://btc.com/1FLDCfr9iG7n6bAdGsqBXmhaLgC4aSze72 https://insight.bitpay.com/address/...
0
votes
1answer
37 views

Who set the rules for validating a block in blockchain?

Who set the rules for validating a block in blockchain? The rules can be set the creator of the blockchain network. There might be some rules on the application that uses the blockchain network. Is ...
1
vote
1answer
50 views

While attempting to fetch a particular block my node just gets disconnected by peers?

A system at an office has its testnet node stuck at a particular block. The logs report "requesting block" over and over again for the same block and after each one reports "socket recv error" and ...
1
vote
1answer
15 views

Diffrent transactions in different block sync problem

Consider that miner A and B both try to solve its block, A's block has transactions (T1,T2), B's block has transactions (T1,T3). A solved its block then synced the block to B. Does B will discard its ...
1
vote
1answer
58 views

Detecting stale blocks with ZeroMQ

I'am writing an application which receives information about new tx and blocks via ZeroMQ. There is a chance that I will receive notifs about blocks which will later on become stale blocks. Is there a ...
0
votes
2answers
60 views

When are blocks validated?

Are blocks validated just before they are stored to memory, upon receipt from an RPC submit call, or at some other time? Can you point to the place in code where this validation process begins? Is ...
2
votes
2answers
56 views

Blockchain validation process is linear?

I've read at a few places that the nodes validate transactions in a linear fashion, i.e. after node A validates, then node B, etc. (which is also the reason, as claimed by many, why blockchain suffers ...
0
votes
0answers
38 views

Bitcoin transaction scripts : does ScriptSig or ScriptPubkey run first? [duplicate]

I'm confused as to the order regarding which script is run. For examples sake: say I want to spend 1 Bitcoin which was given to me by Alice in a single transaction of value 1 Bitcoin. I understand ...