Split into 128MB chunks. Everything is little-indian.
When the chunks are splitup, the current block specification is always ended. No need to worry when switching to a new .dat file.
I don't know what is defined as the block "header", have to find out the hard way I guess.
The first block is only used if it's less thna 0xFD. Otherwise it is discarded, just specifing the length of the number.
c0 c0 c0 c0 This is not part of the block. Just acts as a delimiter.
Block length in bytes. Not part of the block.
Part of the block.
This didn't match, for some reason
Given in Unix epoch time
The target, whish the hash of the block header, must be not exceded to mine the block. may be particular to bitcoin?
Random number generated during the mining process. To successfully mine a block, the header is hashed. If the resulting hash value is not less than or equal to the target, the nonce is incremented and the hash is computed again. This typically happens billions of times before a small enough hash is found.
Not sure how to determine the length of this. Get back to later.
CAnnot change, as with Block format version
Not sure how to determine this either :)
Determined as showed here: https://en.bitcoin.it/wiki/Protocol_specification#Variable_length_integer
And here, by searching for "readVariableLengthInteger": https://code.google.com/p/blockchain/source/browse/trunk/BlockChain.cpp
There can be multiple inputs per transaction
This would be the hash of the transaction being referenced as an input, but for block reward transactions, there will be 00.
As you know, transactions can have many outputs, and subsequent transactions can take none, one or many of those outputs as inputs. A zero here references the first output of the referenced transaction. The value you see here is a representation of -1, a kind of dummy value because there is no input transaction.
It's interesting to note here that a prior transaction could in theory really have 0xffffffff + 1 (decimal 4,294,967,296) outputs, but if the value 0xffffffff is being used as a sentinel value, there would be no way to reference the 4,294,967,296th output and it would be lost. Fortunately the maximum block size of 4GiB makes it impossible to create that many outputs.
This is the length of the script that follows.
This is the script that proves that this transaction is allowed to use the inputs it references. This is the first part of the script.
Referance for the script language: https://en.bitcoin.it/wiki/Script
Support for the transaction replacement feature. Since this feature isn't used in any clients yet, all transactions are locked, by broadcasting 0xFFFFFFFF.
Read more about this at the source.
This is the output part.
This is the number of outputs.
Number of baseunits sent. One doge is 100,000,000 baseunits.
The length of the response script that follows.
This si the second half of the script: the response to the challange. This proves that you have the right to spend the input transaction.
This is of interest if I want to do more indepth scanning of the blockchain
This is set to 0 as the feature is not currently implemented.
Basically better versions of this article: