mirror of
https://github.com/seigler/dash-docs
synced 2025-07-27 09:46:12 +00:00
Dev Docs: Describe Serialized Block Header And Block Format
* Replace current description of the block header with a better description. * Describe the various version numbers. * Describe how the merkle root is constructed. * Describe how nBits is parsed and how to correctly create it to avoid negative values. * Describe the serialized block format used to calculate max block size.
This commit is contained in:
parent
1863fad011
commit
a8f8f750c8
13 changed files with 872 additions and 82 deletions
|
@ -43,6 +43,7 @@ child private and public keys: child key
|
|||
child public key:
|
||||
child public keys: child public key
|
||||
coinbase: coinbase transaction
|
||||
coinbase block height:
|
||||
coinbase transaction:
|
||||
coinbase transactions: coinbase transaction
|
||||
coinbase field:
|
||||
|
@ -68,6 +69,7 @@ double-spend: double spend
|
|||
double spending: double spend
|
||||
double-spent: double spend
|
||||
ECDSA:
|
||||
epoch time: unix epoch time
|
||||
escrow contract:
|
||||
'`expires`': pp expires
|
||||
extended key:
|
||||
|
@ -82,7 +84,6 @@ hard fork:
|
|||
hard forks: hard fork
|
||||
hardened extended private key:
|
||||
HD protocol:
|
||||
header nonce:
|
||||
high-priority transaction: high-priority transactions
|
||||
high-priority transactions:
|
||||
inputs: input
|
||||
|
@ -120,6 +121,7 @@ mining: mine
|
|||
millibit: millibits
|
||||
millibits:
|
||||
multisig:
|
||||
nbits:
|
||||
network:
|
||||
null data:
|
||||
'`op_checkmultisig`': op_checkmultisig
|
||||
|
@ -229,6 +231,8 @@ txid:
|
|||
txids: txid
|
||||
unconfirmed:
|
||||
unconfirmed transactions:
|
||||
unix epoch time:
|
||||
unix time: unix epoch time
|
||||
unique address: unique addresses
|
||||
unique addresses:
|
||||
utxo:
|
||||
|
@ -249,6 +253,7 @@ BIP32:
|
|||
BIP34:
|
||||
BIP39:
|
||||
BIP50:
|
||||
BIP62:
|
||||
BIP70:
|
||||
BIP71:
|
||||
BIP72:
|
||||
|
@ -333,3 +338,4 @@ CVE-2012-2459:
|
|||
'`walletpassphrasechange`': rpc walletpassphrasechange
|
||||
|
||||
Bitcoin Core 0.9.3:
|
||||
Bitcoin Core 0.7.0:
|
||||
|
|
|
@ -2,94 +2,214 @@
|
|||
|
||||
The following subsections briefly document core block details.
|
||||
|
||||
### Block Contents
|
||||
### Block Headers
|
||||
|
||||
{% autocrossref %}
|
||||
|
||||
This section describes [version 2 blocks][v2 block]{:#term-v2-block}{:.term}, which are any blocks with a
|
||||
block height greater than 227,835. (Version 1 and version 2 blocks were
|
||||
intermingled for some time before that point.) Future block versions may
|
||||
break compatibility with the information in this section. You can determine
|
||||
the version of any block by checking its `version` field using
|
||||
bitcoind RPC calls.
|
||||
Block headers are serialized in the 80-byte format described below and then
|
||||
hashed as part of Bitcoin's proof-of-work algorithm, making the
|
||||
serialized header format part of the consensus rules.
|
||||
|
||||
As of version 2 blocks, each block consists of four root elements:
|
||||
| Bytes | Name | Data Type | Description
|
||||
|-------|---------------------|-----------|----------------
|
||||
| 4 | version | uint32_t | The [block version][]{:#term-block-version}{:.term} number indicates which set of block validation rules to follow. See the list of block versions below.
|
||||
| 32 | previous block hash | char[32] | A SHA256(SHA256()) hash in internal byte order of the previous block's header. This ensures no previous block can be changed without also changing this block's header.
|
||||
| 32 | merkle root hash | char[32] | A SHA256(SHA256()) hash in internal byte order. The merkle root is derived from hashes of all transaction included in this block, ensuring none of those transactions can be modified without modifying the header. See the [merkle trees section][section merkle trees] below.
|
||||
| 4 | time | uint32_t | The [block time][]{:#term-block-time}{:.term} is a Unix epoch time when the miner started hashing the header (according to the miner). Must be greater than or equal to the median time of the previous 11 blocks. Full nodes will not accept blocks with headers more than two hours in the future according to their clock.
|
||||
| 4 | nBits | uint32_t | An encoded version of the target threshold this block's header hash must be less than or equal to. See the nBits format described below.
|
||||
| 4 | nonce | uint32_t | An arbitrary number miners change to modify the header hash in order to produce a hash below the target threshold. If all 32-bit values are tested, the time can be updated or the coinbase transaction can be changed and the merkle root updated.
|
||||
|
||||
1. A [magic number][block header magic]{:#term-block-header-magic}{:.term} (0xd9b4bef9).
|
||||
The hashes are in internal byte order; the other values are all
|
||||
in little-endian order.
|
||||
|
||||
2. A 4-byte unsigned integer indicating how many bytes follow until the
|
||||
end of the block. Although this field would suggest maximum block
|
||||
sizes of 4 GiB, max block size is currently capped at 1 MB and the
|
||||
default max block size (used by most miners) is 750 KB (although
|
||||
this will likely increase over time).
|
||||
An example header in hex:
|
||||
|
||||
3. An 80-byte block header described in the section below.
|
||||
{% highlight text %}
|
||||
02000000 .......................... Block version: 2
|
||||
|
||||
4. One or more transactions.
|
||||
b6ff0b1b1680a2862a30ca44d346d9e8
|
||||
910d334beb48ca0c0000000000000000 ... Hash of previous block's header
|
||||
9d10aa52ee949386ca9385695f04ede2
|
||||
70dda20810decd12bc9b048aaab31471 ... Merkle root
|
||||
|
||||
The first transaction in a block must be a [coinbase transaction][]{:#term-coinbase-tx}{:.term} which should collect and
|
||||
24d95a54 ........................... Unix time: 1415239972
|
||||
30c31b18 ........................... Target: 0x1bc330 * 256**(0x18-3)
|
||||
fe9f0864 ........................... Nonce
|
||||
{% endhighlight %}
|
||||
|
||||
{% endautocrossref %}
|
||||
|
||||
#### Block Versions
|
||||
|
||||
{% autocrossref %}
|
||||
|
||||
* **Version 1** was introduced in the genesis block (January 2009).
|
||||
|
||||
* **[Version 2][v2 block]{:#term-v2-block}{:.term}** was introduced in
|
||||
Bitcoin Core 0.7.0 (September 2012) as a soft fork. As described in
|
||||
BIP34, valid version 2 blocks require a [block height parameter in the
|
||||
coinbase][coinbase block height]. Also described in BIP34 are rules
|
||||
for rejecting certain blocks; based on those rules, Bitcoin Core 0.7.0
|
||||
and later versions began to reject version 2 blocks without the block
|
||||
height in coinbase at block height 224,412 (March 2013) and began to
|
||||
reject new version 1 blocks three weeks later at block height 227,930.
|
||||
<!-- source for heights: my (@harding) own headers dump and counting
|
||||
script -->
|
||||
|
||||
* **Version 3** blocks will likely be introduced in the near-future as
|
||||
specified in draft BIP62. Possible changes include:
|
||||
|
||||
* Reject version 3 blocks that include any version 2 transactions
|
||||
that don't adhere to any of the version 2 transaction rules.
|
||||
These rules are not yet described in this documentation; see
|
||||
BIP62 for details.
|
||||
|
||||
* A soft fork rollout of version 3 blocks identical to the rollout
|
||||
used for version 2 blocks (described briefly in BIP62 and in more
|
||||
detail in BIP34).
|
||||
|
||||
{% endautocrossref %}
|
||||
|
||||
#### Merkle Trees
|
||||
|
||||
{% autocrossref %}
|
||||
|
||||
*For an overview of merkle trees, see the [block chain guide][merkle
|
||||
tree].*
|
||||
|
||||
The merkle root is constructed using all the TXIDs of transactions in
|
||||
this block, but first the TXIDs are placed in order as required by the
|
||||
consensus rules:
|
||||
|
||||
* The coinbase transaction's TXID is always placed first.
|
||||
|
||||
* Any input within this block can spend an output which also appears in
|
||||
this block (assuming the spend is otherwise valid). However, the TXID
|
||||
corresponding to the output must be placed at some point before the
|
||||
TXID corresponding to the input. This ensures that any program parsing
|
||||
block chain transactions linearly will encounter each output before it
|
||||
is used as an input.
|
||||
|
||||
If a block only has a coinbase transaction, the coinbase TXID is used as
|
||||
the merkle root hash.
|
||||
|
||||
If a block only has a coinbase transaction and one other transaction,
|
||||
the TXIDs of those two transactions are placed in order, concatenated as
|
||||
64 raw bytes, and then SHA256(SHA256()) hashed together to form the
|
||||
merkle root.
|
||||
|
||||
If a block has three or more transactions, intermediate merkle tree rows
|
||||
are formed. The TXIDs are placed in order and paired, starting with the
|
||||
coinbase transaction's TXID. Each pair is concatenated together as 64
|
||||
raw bytes and SHA256(SHA256()) hashed to form a second row of
|
||||
hashes. If there are an odd (non-even) number of TXIDs, the last TXID is
|
||||
concatenated with a copy of itself and hashed. If there are more than
|
||||
two hashes in the second row, the process is repeated to create a third
|
||||
row (and, if necessary, repeated further to create additional rows).
|
||||
Once a row is obtained with only two hashes, those hashes are concatenated and
|
||||
hashed to produce the merkle root.
|
||||
|
||||
<!-- built block 170's merkle root with Python to confirm left-to-right order
|
||||
for A|B concatenation demonstrated below:
|
||||
sha256(sha256("82501c1178fa0b222c1f3d474ec726b832013f0a532b44bb620cce8624a5feb1169e1e83e930853391bc6f35f605c6754cfead57cf8387639d3b4096c54f18f4".decode("hex")).digest()).digest().encode("hex_codec")
|
||||
-->
|
||||
|
||||

|
||||
|
||||
TXIDs and intermediate hashes are always in internal byte order when they're
|
||||
concatenated, and the resulting merkle root is also in internal byte
|
||||
order when it's placed in the block header.
|
||||
|
||||
{% endautocrossref %}
|
||||
|
||||
#### Target nBits
|
||||
|
||||
{% autocrossref %}
|
||||
|
||||
The target threshold is a 256-bit unsigned integer compared the 256-bit
|
||||
SHA256(SHA256()) header hash (treated also as an unsigned integer).
|
||||
However, the header field *nBits* provides only 32 bits of space, so the
|
||||
target number uses a less precise format called "compact" which works
|
||||
like a base-256 version of scientific notation:
|
||||
|
||||

|
||||
|
||||
As a base-256 number, nBits can be quickly parsed as bytes the same way
|
||||
you might parse a decimal number in base-10 scientific notation:
|
||||
|
||||

|
||||
|
||||
<!-- Source for paragraph below: Bitcoin Core src/tests/bignum_tests.cpp:
|
||||
num.SetCompact(0x04923456);
|
||||
BOOST_CHECK_EQUAL(num.GetHex(), "-12345600");
|
||||
BOOST_CHECK_EQUAL(num.GetCompact(), 0x04923456U);
|
||||
-->
|
||||
|
||||
Although the target threshold should be an unsigned integer, the
|
||||
original nBits implementation inherits properties from a signed data
|
||||
class, allowing the target threshold to be negative if the high bit of
|
||||
the significand is set. This is useless---the header hash is
|
||||
treated as an unsigned number, so it can never be equal to or lower than a
|
||||
negative target threshold. Bitcoin Core deals with this in two ways:
|
||||
|
||||
<!-- source for "Bitcoin Core converts..." src/main.h GetBlockWork() -->
|
||||
|
||||
* When parsing nBits, Bitcoin Core converts a negative target
|
||||
threshold into a target of zero, which the header hash can equal (in
|
||||
theory, at least).
|
||||
|
||||
* When creating a value for nBits, Bitcoin Core checks to see if it will
|
||||
produce an nBits which will be interpreted as negative; if so, it
|
||||
divides the significand by 256 and increases the exponent by 1 to
|
||||
produce the same number with a different encoding.
|
||||
|
||||
Some examples taken from the Bitcoin Core test cases:
|
||||
|
||||
| nBits | Target | Notes
|
||||
|------------|------------------|----------------
|
||||
| 0x01003456 | 0x00 |
|
||||
| 0x01123456 | 0x12 |
|
||||
| 0x02008000 | 0x80 |
|
||||
| 0x05009234 | 0x92340000 |
|
||||
| 0x04923456 | -0x12345600 | High bit set (0x80 in 0x92).
|
||||
| 0x04123456 | 0x12345600 | Inverse of above; no high bit.
|
||||
|
||||
Difficulty 1, the minimum allowed difficulty, is represented on mainnet
|
||||
and the current testnet by the nBits value 0x1d00ffff. Regtest mode uses
|
||||
a different difficulty 1 value---0x207fffff, the highest possible value
|
||||
below uint32_max which can be encoded; this allows near-instant building
|
||||
of blocks in regtest mode.
|
||||
|
||||
{% endautocrossref %}
|
||||
|
||||
|
||||
### Serialized Blocks
|
||||
|
||||
{% autocrossref %}
|
||||
|
||||
Under current consensus rules, a block is not valid unless its
|
||||
serialized size is less than or equal to 1 MB. All fields described
|
||||
below are counted towards the serialized size.
|
||||
|
||||
| Bytes | Name | Data Type | Description
|
||||
| 80 | block header | block_header | The block header in the format described in the [block header section][block header].
|
||||
| *Varies* | txn_count | compactSize uint | The total number of transactions in this block, including the coinbase transaction.
|
||||
| *Varies* | txns | raw transaction | Every transaction in this block, one after another, in raw transaction format. Transactions must appear in the data stream in the same order their TXIDs appeared in the first row of the merkle tree. See the [merkle tree section][section merkle trees] for details.
|
||||
|
||||
The first transaction in a block must be a [coinbase
|
||||
transaction][]{:#term-coinbase-tx}{:.term} which should collect and
|
||||
spend any transaction fees paid by transactions included in this block.
|
||||
|
||||
All blocks with a block height less than 6,930,000 are entitled to
|
||||
receive a [block reward][]{:#term-block-reward}{:.term} of newly created bitcoin value, which also
|
||||
should be spent in the coinbase transaction. (The block reward started
|
||||
at 50 bitcoins and is being halved every 210,000 blocks---approximately once every four years. As of
|
||||
June 2014, it's 25 bitcoins.) A coinbase transaction is invalid if it
|
||||
tries to spend more value than is available from the transaction
|
||||
fees and block reward.
|
||||
receive a block subsidy of newly created bitcoin value, which also
|
||||
should be spent in the coinbase transaction. (The block subsidy started
|
||||
at 50 bitcoins and is being halved every 210,000 blocks---approximately
|
||||
once every four years. As of November 2014, it's 25 bitcoins.)
|
||||
|
||||
The coinbase transaction has the same basic format as any other
|
||||
transaction, but it references a single non-existent UTXO and a special
|
||||
[coinbase field][]{:#term-coinbase-field}{:.term} replaces the field that would normally hold a signature script and
|
||||
secp256k1 signature. In version 2 blocks, the coinbase parameter must begin with
|
||||
the current block's block height and may contain additional arbitrary
|
||||
data or a script up to a maximum total of 100 bytes.
|
||||
Together, the transaction fees and block subsidy are called the [block
|
||||
reward][]{:#term-block-reward}{:.term}. A coinbase transaction is
|
||||
invalid if it tries to spend more value than is available from the
|
||||
block reward.
|
||||
|
||||
{% endautocrossref %}
|
||||
|
||||
### Block Header
|
||||
|
||||
{% autocrossref %}
|
||||
|
||||
The 80-byte block header contains the following six fields:
|
||||
|
||||
| Field | Bytes | Format |
|
||||
|-------------------|--------|--------------------------------|
|
||||
| 1. Version | 4 | Unsigned Int |
|
||||
| 2. hashPrevBlock | 32 | Unsigned Int (SHA256 Hash) |
|
||||
| 3. hashMerkleRoot | 32 | Unsigned Int (SHA256 Hash) |
|
||||
| 4. Time | 4 | Unsigned Int (Epoch Time) |
|
||||
| 5. Bits | 4 | Internal Bitcoin Target Format |
|
||||
| 6. Nonce | 4 | (Arbitrary Data) |
|
||||
|
||||
1. The *[block version][]{:#term-block-version}{:.term}* number indicates which set of block validation rules
|
||||
to follow so Bitcoin Core developers can add features or
|
||||
fix bugs. As of block height 227,836, all blocks use version number
|
||||
2.
|
||||
|
||||
2. The *hash of the previous block header* puts this block on the
|
||||
block chain and ensures no previous block can be changed without also
|
||||
changing this block's header.
|
||||
|
||||
3. The *merkle root* is a hash derived from hashes of all the
|
||||
transactions included in this block. It ensures no transactions can
|
||||
be modified in this block without changing the block header hash.
|
||||
|
||||
4. The *[block time][]{:#term-block-time}{:.term}* is the approximate time when this block was created in
|
||||
Unix Epoch time format (number of seconds elapsed since
|
||||
1970-01-01T00:00 UTC). The time value must be greater than the
|
||||
median time of the previous 11 blocks. No peer will accept a block with a
|
||||
time currently more than two hours in the future according to the
|
||||
peer's clock.
|
||||
|
||||
5. *Bits* translates into the target threshold value---the maximum allowed
|
||||
value for this block's hash. The bits value must match the network
|
||||
difficulty at the time the block was mined.
|
||||
|
||||
6. The *[header nonce][]{:#term-header-nonce}{:.term}* is an arbitrary input that miners can change to test different
|
||||
hash values for the header until they find a hash value less than or
|
||||
equal to the target threshold. If all values within the nonce's four
|
||||
bytes are tested, the time can be updated or the
|
||||
coinbase transaction can be changed and the merkle
|
||||
root updated.
|
||||
|
||||
{% endautocrossref %}
|
||||
|
|
|
@ -319,8 +319,8 @@ has the following format.
|
|||
| 32 | hash (null) | char[32] | A 32-byte null, as a coinbase has no previous outpoint.
|
||||
| 4 | index (UINT32_MAX) | uint32_t | 0xffffffff, as a coinbase has no previous outpoint.
|
||||
| *Varies* | script bytes | compactSize uint | The number of bytes in the coinbase script, up to a maximum of 100 bytes.
|
||||
| *Varies* (4) | height | script | The block height of this block as required by BIP34. Uses script language: starts with a data-pushing op code that indicates how many bytes to push to the stack followed by the block height as a little-endian unsigned integer. This script must be as short as possible, otherwise it may be rejected.<br/><br/> The data-pushing op code will be 0x03 and the total size four bytes until block 16,777,216 about 300 years from now.
|
||||
| *Varies* | coinbase script | *None* | Arbitrary data not exceeding 100 bytes minus the (4) height bytes. Miners commonly place an extra nonce in this field to update the block header merkle root during hashing.
|
||||
| *Varies* (4) | height | script | The [block height][]{:#term-coinbase-block-height}{:.term} of this block as required by BIP34. Uses script language: starts with a data-pushing op code that indicates how many bytes to push to the stack followed by the block height as a little-endian unsigned integer. This script must be as short as possible, otherwise it may be rejected.<br/><br/> The data-pushing op code will be 0x03 and the total size four bytes until block 16,777,216 about 300 years from now.
|
||||
| *Varies* | coinbase script | *None* | The [coinbase field][]{:#term-coinbase-field}{:.term}: Arbitrary data not exceeding 100 bytes minus the (4) height bytes. Miners commonly place an extra nonce in this field to update the block header merkle root during hashing.
|
||||
| 4 | sequence | uint32_t | Sequence number; see [sequence number][].
|
||||
|
||||
Most (but not all) blocks prior to block height 227,836 used block
|
||||
|
|
|
@ -9,8 +9,7 @@
|
|||
[block]: /en/developer-guide#term-block "A block of transactions protected by proof of work"
|
||||
[blocks]: /en/developer-guide#term-block "Blocks of transactions protected by proof of work"
|
||||
[block chain]: /en/developer-guide#block-chain "A chain of blocks with each block linking to the block that preceded; the most-difficult-to-recreate chain is The Block Chain"
|
||||
[block header]: /en/developer-reference#block-header "An 80-byte header belonging to a single block which is hashed repeatedly to create proof of work"
|
||||
[block header magic]: /en/developer-reference#term-block-header-magic "A magic number used to separate block data from transaction data on the P2P network"
|
||||
[block header]: /en/developer-reference#block-headers "An 80-byte header belonging to a single block which is hashed repeatedly to create proof of work"
|
||||
[block height]: /en/developer-guide#term-block-height "The number of chained blocks preceding this block"
|
||||
[block reward]: /en/developer-reference#term-block-reward "New satoshis given to a miner for creating one of the first 6,929,999 blocks"
|
||||
[block time]: /en/developer-reference#term-block-time "The time field in the block header"
|
||||
|
@ -24,6 +23,7 @@
|
|||
[change output]: /en/developer-guide#term-change-output "An output used by a spender to send back to himself some of the satoshis from the inputs"
|
||||
[child key]: /en/developer-guide#term-child-key "In HD wallets, a key derived from a parent key"
|
||||
[child public key]: /en/developer-guide#term-child-public-key "In HD wallets, a public key derived from a parent public key or a corresponding child private key"
|
||||
[coinbase block height]: /en/developer-reference#term-coinbase-block-height "The current block's height encoded into the first bytes of the coinbase field"
|
||||
[coinbase field]: /en/developer-reference#term-coinbase-field "A special input-like field for coinbase transactions"
|
||||
[coinbase transaction]: /en/developer-reference#term-coinbase-tx "A special transaction which miners must create when they generate a block"
|
||||
[compactsize unsigned integer]: /en/developer-reference#compactsize-unsigned-integers "A type of variable-length integer"
|
||||
|
@ -48,7 +48,6 @@
|
|||
[hard fork]: /en/developer-guide#term-hard-fork "A permanent divergence in the the block chain, commonly occurs when non-upgraded nodes can't validate blocks created by upgraded nodes following newer consensus rules."
|
||||
[hardened extended private key]: /en/developer-guide#term-hardened-extended-private-key "A private key whose corresponding public key cannot derive child keys"
|
||||
[HD protocol]: /en/developer-guide#term-hd-protocol "The Hierarchical Deterministic (HD) key creation and transfer protocol"
|
||||
[header nonce]: /en/developer-reference#term-header-nonce "Four bytes of arbitrary data in a block header used to let miners create headers with different hashes for proof of work"
|
||||
[high-priority transactions]: /en/developer-guide#term-high-priority-transactions "Transactions which don't pay a transaction fee; only transactions spending long-idle outputs are eligible"
|
||||
[input]: /en/developer-guide#term-input "The input to a transaction linking to the output of a previous transaction which permits spending of satoshis"
|
||||
[inputs]: /en/developer-guide#term-input "The input to a transaction linking to the output of a previous transaction which permits spending of satoshis"
|
||||
|
@ -74,6 +73,7 @@
|
|||
[miners]: /en/developer-guide#term-miner "Creators of Bitcoin blocks who solve proof-of-work puzzles in exchange for block rewards and transaction fees"
|
||||
[minimum fee]: /en/developer-guide#term-minimum-fee "The minimum fee a transaction must pay in must circumstances to be mined or broadcast by peers across the network"
|
||||
[multisig]: /en/developer-guide#term-multisig "An pubkey script using OP_CHECKMULTISIG to check for multiple signatures"
|
||||
[nbits]: /en/developer-reference#target-nbits "The encoded form of the target threshold as it appears in the block header"
|
||||
[network]: /en/developer-guide#term-network "The Bitcoin P2P network which broadcasts transactions and blocks"
|
||||
[Null data]: /en/developer-guide#term-null-data "A standard transaction type which allows adding 40 bytes of arbitrary data to the block chain up to once per transaction"
|
||||
[op_checkmultisig]: /en/developer-reference#term-op-checkmultisig "Op code which returns true if one or more provided signatures (m) sign the correct parts of a transaction and match one or more provided public keys (n)"
|
||||
|
@ -243,6 +243,7 @@
|
|||
[rpc walletpassphrasechange]: /en/developer-reference#walletpassphrasechange
|
||||
|
||||
<!-- Other internal site links; alphabetical order -->
|
||||
[Bitcoin Core 0.7.0]: /en/release/v0.7.0
|
||||
[Bitcoin Core 0.9.3]: /en/release/v0.9.3
|
||||
[bitcoin URI subsection]: /en/developer-guide#bitcoin-uri
|
||||
[bitcoinpdf]: https://bitcoin.org/bitcoin.pdf
|
||||
|
@ -265,6 +266,7 @@
|
|||
[RPCs]: /en/developer-reference#remote-procedure-calls-rpcs
|
||||
[section detecting forks]: /en/developer-guide#detecting-forks
|
||||
[section hash byte order]: /en/developer-reference#hash-byte-order
|
||||
[section merkle trees]: /en/developer-reference#merkle-trees
|
||||
[section simple raw transaction]: /en/developer-examples#simple-raw-transaction
|
||||
[section verifying payment]: /en/developer-guide#verifying-payment
|
||||
[signature script modification warning]: /en/developer-reference#signature_script_modification_warning
|
||||
|
@ -281,6 +283,7 @@
|
|||
[BIP34]: https://github.com/bitcoin/bips/blob/master/bip-0034.mediawiki
|
||||
[BIP39]: https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki
|
||||
[BIP50]: https://github.com/bitcoin/bips/blob/master/bip-0050.mediawiki
|
||||
[BIP62]: https://github.com/bitcoin/bips/blob/master/bip-0062.mediawiki
|
||||
[BIP70]: https://github.com/bitcoin/bips/blob/master/bip-0070.mediawiki
|
||||
[BIP71]: https://github.com/bitcoin/bips/blob/master/bip-0071.mediawiki
|
||||
[BIP72]: https://github.com/bitcoin/bips/blob/master/bip-0072.mediawiki
|
||||
|
@ -326,6 +329,7 @@
|
|||
[python-blkmaker]: https://gitorious.org/bitcoin/python-blkmaker
|
||||
[SHA256]: https://en.wikipedia.org/wiki/SHA-2
|
||||
[Stratum mining protocol]: http://mining.bitcoin.cz/stratum-mining
|
||||
[unix epoch time]: https://en.wikipedia.org/wiki/Unix_time
|
||||
[URI encoded]: https://tools.ietf.org/html/rfc3986
|
||||
[wiki script]: https://en.bitcoin.it/wiki/Script
|
||||
[x509]: https://en.wikipedia.org/wiki/X.509
|
||||
|
|
42
img/dev/en-merkle-tree-construction.dot
Normal file
42
img/dev/en-merkle-tree-construction.dot
Normal file
|
@ -0,0 +1,42 @@
|
|||
digraph {
|
||||
|
||||
size=6.25;
|
||||
rankdir=TB
|
||||
//splines = ortho;
|
||||
ranksep = 0.2;
|
||||
nodesep = 0.3;
|
||||
|
||||
edge [ penwidth = 1.75, fontname="Sans" ]
|
||||
node [ penwidth = 1.75, shape = "box", fontname="Sans", ]
|
||||
graph [ penwidth = 1.75, fontname="Sans" ]
|
||||
|
||||
{
|
||||
node [ shape = "none" ];
|
||||
txids [ label = "Row 1: Transaction hashes (TXIDs)\n(A is coinbase; C can spend output from B)" ];
|
||||
row2 [ label = "Row 2: Hashes of paired TXIDs" ];
|
||||
rootrow [ label = "Merkle root" ];
|
||||
|
||||
txids -> row2 -> rootrow [ style = "invis" ];
|
||||
}
|
||||
|
||||
txid_a [ label = "A" ];
|
||||
txid_b [ label = "B" ];
|
||||
txid_invis [ label = "C", style = "invis" ];
|
||||
txid_c [ label = "C" ];
|
||||
|
||||
row2_ab [ label = "H(A|B)" ];
|
||||
row2_cc [ label = "H(C|C)" ];
|
||||
|
||||
root [ label = "H(H(A|B)|H(C|C))" ];
|
||||
|
||||
txid_a -> row2_ab [ weight = 1 ];
|
||||
txid_b -> row2_ab [ weight = 1 ];
|
||||
txid_c -> row2_cc;
|
||||
txid_invis -> row2_cc [ style = "invis" ];
|
||||
|
||||
row2_ab -> root;
|
||||
row2_cc -> root;
|
||||
|
||||
|
||||
label = "\n Example Merkle Tree Construction [Hash function H() = SHA256(SHA256())]"
|
||||
}
|
BIN
img/dev/en-merkle-tree-construction.png
Normal file
BIN
img/dev/en-merkle-tree-construction.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6 KiB |
86
img/dev/en-merkle-tree-construction.svg
Normal file
86
img/dev/en-merkle-tree-construction.svg
Normal file
|
@ -0,0 +1,86 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 2.26.3 (20100126.1600)
|
||||
-->
|
||||
<!-- Title: _anonymous_0 Pages: 1 -->
|
||||
<svg width="450pt" height="138pt"
|
||||
viewBox="0.00 0.00 450.00 138.18" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph1" class="graph" transform="scale(0.723473 0.723473) rotate(0) translate(4 187)">
|
||||
<title>_anonymous_0</title>
|
||||
<polygon fill="white" stroke="white" points="-4,5 -4,-187 619,-187 619,5 -4,5"/>
|
||||
<text text-anchor="middle" x="307" y="-8.4" font-family="Sans" font-size="14.00"> Example Merkle Tree Construction  [Hash function H() = SHA256(SHA256())]</text>
|
||||
<!-- txids -->
|
||||
<g id="node2" class="node"><title>txids</title>
|
||||
<text text-anchor="middle" x="154" y="-166.4" font-family="Sans" font-size="14.00">Row 1: Transaction hashes (TXIDs)</text>
|
||||
<text text-anchor="middle" x="154" y="-149.4" font-family="Sans" font-size="14.00">(A is coinbase; C can spend output from B)</text>
|
||||
</g>
|
||||
<!-- row2 -->
|
||||
<g id="node3" class="node"><title>row2</title>
|
||||
<text text-anchor="middle" x="154" y="-104.9" font-family="Sans" font-size="14.00">Row 2: Hashes of paired TXIDs</text>
|
||||
</g>
|
||||
<!-- txids->row2 -->
|
||||
<!-- rootrow -->
|
||||
<g id="node4" class="node"><title>rootrow</title>
|
||||
<text text-anchor="middle" x="154" y="-54.9" font-family="Sans" font-size="14.00">Merkle root</text>
|
||||
</g>
|
||||
<!-- row2->rootrow -->
|
||||
<!-- txid_a -->
|
||||
<g id="node6" class="node"><title>txid_a</title>
|
||||
<polygon fill="none" stroke="black" stroke-width="1.75" points="384,-180 330,-180 330,-144 384,-144 384,-180"/>
|
||||
<text text-anchor="middle" x="357" y="-157.9" font-family="Sans" font-size="14.00">A</text>
|
||||
</g>
|
||||
<!-- row2_ab -->
|
||||
<g id="node10" class="node"><title>row2_ab</title>
|
||||
<polygon fill="none" stroke="black" stroke-width="1.75" points="462,-127 400,-127 400,-91 462,-91 462,-127"/>
|
||||
<text text-anchor="middle" x="431" y="-104.9" font-family="Sans" font-size="14.00">H(A|B)</text>
|
||||
</g>
|
||||
<!-- txid_a->row2_ab -->
|
||||
<g id="edge6" class="edge"><title>txid_a->row2_ab</title>
|
||||
<path fill="none" stroke="black" stroke-width="1.75" d="M382.467,-143.76C387.288,-140.308 392.399,-136.647 397.425,-133.047"/>
|
||||
<polygon fill="black" stroke="black" points="399.645,-135.762 405.737,-127.094 395.569,-130.071 399.645,-135.762"/>
|
||||
</g>
|
||||
<!-- txid_b -->
|
||||
<g id="node7" class="node"><title>txid_b</title>
|
||||
<polygon fill="none" stroke="black" stroke-width="1.75" points="460,-180 406,-180 406,-144 460,-144 460,-180"/>
|
||||
<text text-anchor="middle" x="433" y="-157.9" font-family="Sans" font-size="14.00">B</text>
|
||||
</g>
|
||||
<!-- txid_b->row2_ab -->
|
||||
<g id="edge8" class="edge"><title>txid_b->row2_ab</title>
|
||||
<path fill="none" stroke="black" stroke-width="1.75" d="M432.312,-143.76C432.232,-141.655 432.15,-139.472 432.067,-137.273"/>
|
||||
<polygon fill="black" stroke="black" points="435.557,-136.955 431.683,-127.094 428.562,-137.219 435.557,-136.955"/>
|
||||
</g>
|
||||
<!-- txid_invis -->
|
||||
<!-- row2_cc -->
|
||||
<g id="node11" class="node"><title>row2_cc</title>
|
||||
<polygon fill="none" stroke="black" stroke-width="1.75" points="546,-127 484,-127 484,-91 546,-91 546,-127"/>
|
||||
<text text-anchor="middle" x="515" y="-104.9" font-family="Sans" font-size="14.00">H(C|C)</text>
|
||||
</g>
|
||||
<!-- txid_invis->row2_cc -->
|
||||
<!-- txid_c -->
|
||||
<g id="node9" class="node"><title>txid_c</title>
|
||||
<polygon fill="none" stroke="black" stroke-width="1.75" points="614,-180 560,-180 560,-144 614,-144 614,-180"/>
|
||||
<text text-anchor="middle" x="587" y="-157.9" font-family="Sans" font-size="14.00">C</text>
|
||||
</g>
|
||||
<!-- txid_c->row2_cc -->
|
||||
<g id="edge10" class="edge"><title>txid_c->row2_cc</title>
|
||||
<path fill="none" stroke="black" stroke-width="1.75" d="M562.222,-143.76C557.531,-140.308 552.558,-136.647 547.668,-133.047"/>
|
||||
<polygon fill="black" stroke="black" points="549.708,-130.203 539.58,-127.094 545.559,-135.841 549.708,-130.203"/>
|
||||
</g>
|
||||
<!-- root -->
|
||||
<g id="node12" class="node"><title>root</title>
|
||||
<polygon fill="none" stroke="black" stroke-width="1.75" points="539,-77 407,-77 407,-41 539,-41 539,-77"/>
|
||||
<text text-anchor="middle" x="473" y="-54.9" font-family="Sans" font-size="14.00">H(H(A|B)|H(C|C))</text>
|
||||
</g>
|
||||
<!-- row2_ab->root -->
|
||||
<g id="edge14" class="edge"><title>row2_ab->root</title>
|
||||
<path fill="none" stroke="black" stroke-width="1.75" d="M446.163,-90.9489C447.808,-88.9908 449.504,-86.9709 451.208,-84.9428"/>
|
||||
<polygon fill="black" stroke="black" points="453.966,-87.1008 457.718,-77.1926 448.606,-82.5985 453.966,-87.1008"/>
|
||||
</g>
|
||||
<!-- row2_cc->root -->
|
||||
<g id="edge16" class="edge"><title>row2_cc->root</title>
|
||||
<path fill="none" stroke="black" stroke-width="1.75" d="M499.837,-90.9489C498.192,-88.9908 496.496,-86.9709 494.792,-84.9428"/>
|
||||
<polygon fill="black" stroke="black" points="497.394,-82.5985 488.282,-77.1926 492.034,-87.1008 497.394,-82.5985"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 4.8 KiB |
29
img/dev/en-nbits-overview.dot
Normal file
29
img/dev/en-nbits-overview.dot
Normal file
|
@ -0,0 +1,29 @@
|
|||
digraph {
|
||||
|
||||
size=6.25;
|
||||
rankdir=TB
|
||||
//splines = ortho;
|
||||
ranksep = 0.0;
|
||||
nodesep = 0.0;
|
||||
|
||||
edge [ penwidth = 1.75, fontname="Sans" ]
|
||||
node [ penwidth = 1.75, shape = "none", fontname="Sans", width = 0, height = 0]
|
||||
graph [ penwidth = 0, fontname="Sans" ]
|
||||
|
||||
nbits [ label = "0x181bc330 → \n \nnBits In\nBig-Endian\nOrder" ];
|
||||
|
||||
significand [ label = "0x1bc330\n \nSignificand\n(Mantissa)\n " ];
|
||||
times [ label = "*\n \n \n \n " ];
|
||||
|
||||
base [ label = "256\n \nBase\n \n " ];
|
||||
exp [ label = "^\n \n \n \n " ];
|
||||
exponent [ label = "(0x18\n \nExponent\n \n " ];
|
||||
minus [ label = "-\n \n \n \n " ];
|
||||
negative [ label = "3)\n \nBytes\nIn\nSignificand" ];
|
||||
|
||||
base -> result [ style = "invis" ];
|
||||
|
||||
result [ label = "Result: 0x1bc330000000000000000000000000000000000000000000 " ];
|
||||
|
||||
label = "Converting nBits Into A Target Threshold"
|
||||
}
|
BIN
img/dev/en-nbits-overview.png
Normal file
BIN
img/dev/en-nbits-overview.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.3 KiB |
83
img/dev/en-nbits-overview.svg
Normal file
83
img/dev/en-nbits-overview.svg
Normal file
|
@ -0,0 +1,83 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 2.26.3 (20100126.1600)
|
||||
-->
|
||||
<!-- Title: _anonymous_0 Pages: 1 -->
|
||||
<svg width="450pt" height="136pt"
|
||||
viewBox="0.00 0.00 450.00 135.93" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph1" class="graph" transform="scale(0.844278 0.844278) rotate(0) translate(4 157)">
|
||||
<title>_anonymous_0</title>
|
||||
<polygon fill="white" stroke="white" points="-4,5 -4,-157 530,-157 530,5 -4,5"/>
|
||||
<text text-anchor="middle" x="262.5" y="-8.4" font-family="Sans" font-size="14.00">Converting nBits Into A Target Threshold</text>
|
||||
<!-- nbits -->
|
||||
<g id="node1" class="node"><title>nbits</title>
|
||||
<text text-anchor="middle" x="62" y="-135.9" font-family="Sans" font-size="14.00">0x181bc330 → </text>
|
||||
<text text-anchor="middle" x="62" y="-118.9" font-family="Sans" font-size="14.00"> </text>
|
||||
<text text-anchor="middle" x="62" y="-101.9" font-family="Sans" font-size="14.00">nBits In</text>
|
||||
<text text-anchor="middle" x="62" y="-84.9" font-family="Sans" font-size="14.00">Big-Endian</text>
|
||||
<text text-anchor="middle" x="62" y="-67.9" font-family="Sans" font-size="14.00">Order</text>
|
||||
</g>
|
||||
<!-- significand -->
|
||||
<g id="node2" class="node"><title>significand</title>
|
||||
<text text-anchor="middle" x="170" y="-135.9" font-family="Sans" font-size="14.00">0x1bc330</text>
|
||||
<text text-anchor="middle" x="170" y="-118.9" font-family="Sans" font-size="14.00"> </text>
|
||||
<text text-anchor="middle" x="170" y="-101.9" font-family="Sans" font-size="14.00">Significand</text>
|
||||
<text text-anchor="middle" x="170" y="-84.9" font-family="Sans" font-size="14.00">(Mantissa)</text>
|
||||
<text text-anchor="middle" x="170" y="-67.9" font-family="Sans" font-size="14.00"> </text>
|
||||
</g>
|
||||
<!-- times -->
|
||||
<g id="node3" class="node"><title>times</title>
|
||||
<text text-anchor="middle" x="228" y="-135.9" font-family="Sans" font-size="14.00">*</text>
|
||||
<text text-anchor="middle" x="228" y="-118.9" font-family="Sans" font-size="14.00"> </text>
|
||||
<text text-anchor="middle" x="228" y="-101.9" font-family="Sans" font-size="14.00"> </text>
|
||||
<text text-anchor="middle" x="228" y="-84.9" font-family="Sans" font-size="14.00"> </text>
|
||||
<text text-anchor="middle" x="228" y="-67.9" font-family="Sans" font-size="14.00"> </text>
|
||||
</g>
|
||||
<!-- base -->
|
||||
<g id="node4" class="node"><title>base</title>
|
||||
<text text-anchor="middle" x="266" y="-135.9" font-family="Sans" font-size="14.00">256</text>
|
||||
<text text-anchor="middle" x="266" y="-118.9" font-family="Sans" font-size="14.00"> </text>
|
||||
<text text-anchor="middle" x="266" y="-101.9" font-family="Sans" font-size="14.00">Base</text>
|
||||
<text text-anchor="middle" x="266" y="-84.9" font-family="Sans" font-size="14.00"> </text>
|
||||
<text text-anchor="middle" x="266" y="-67.9" font-family="Sans" font-size="14.00"> </text>
|
||||
</g>
|
||||
<!-- result -->
|
||||
<g id="node10" class="node"><title>result</title>
|
||||
<text text-anchor="middle" x="266" y="-33.9" font-family="Sans" font-size="14.00">Result: 0x1bc330000000000000000000000000000000000000000000 </text>
|
||||
</g>
|
||||
<!-- base->result -->
|
||||
<!-- exp -->
|
||||
<g id="node5" class="node"><title>exp</title>
|
||||
<text text-anchor="middle" x="306" y="-135.9" font-family="Sans" font-size="14.00">^</text>
|
||||
<text text-anchor="middle" x="306" y="-118.9" font-family="Sans" font-size="14.00"> </text>
|
||||
<text text-anchor="middle" x="306" y="-101.9" font-family="Sans" font-size="14.00"> </text>
|
||||
<text text-anchor="middle" x="306" y="-84.9" font-family="Sans" font-size="14.00"> </text>
|
||||
<text text-anchor="middle" x="306" y="-67.9" font-family="Sans" font-size="14.00"> </text>
|
||||
</g>
|
||||
<!-- exponent -->
|
||||
<g id="node6" class="node"><title>exponent</title>
|
||||
<text text-anchor="middle" x="362" y="-135.9" font-family="Sans" font-size="14.00">(0x18</text>
|
||||
<text text-anchor="middle" x="362" y="-118.9" font-family="Sans" font-size="14.00"> </text>
|
||||
<text text-anchor="middle" x="362" y="-101.9" font-family="Sans" font-size="14.00">Exponent</text>
|
||||
<text text-anchor="middle" x="362" y="-84.9" font-family="Sans" font-size="14.00"> </text>
|
||||
<text text-anchor="middle" x="362" y="-67.9" font-family="Sans" font-size="14.00"> </text>
|
||||
</g>
|
||||
<!-- minus -->
|
||||
<g id="node7" class="node"><title>minus</title>
|
||||
<text text-anchor="middle" x="415" y="-135.9" font-family="Sans" font-size="14.00">-</text>
|
||||
<text text-anchor="middle" x="415" y="-118.9" font-family="Sans" font-size="14.00"> </text>
|
||||
<text text-anchor="middle" x="415" y="-101.9" font-family="Sans" font-size="14.00"> </text>
|
||||
<text text-anchor="middle" x="415" y="-84.9" font-family="Sans" font-size="14.00"> </text>
|
||||
<text text-anchor="middle" x="415" y="-67.9" font-family="Sans" font-size="14.00"> </text>
|
||||
</g>
|
||||
<!-- negative -->
|
||||
<g id="node8" class="node"><title>negative</title>
|
||||
<text text-anchor="middle" x="472" y="-135.9" font-family="Sans" font-size="14.00">3)</text>
|
||||
<text text-anchor="middle" x="472" y="-118.9" font-family="Sans" font-size="14.00"> </text>
|
||||
<text text-anchor="middle" x="472" y="-101.9" font-family="Sans" font-size="14.00">Bytes</text>
|
||||
<text text-anchor="middle" x="472" y="-84.9" font-family="Sans" font-size="14.00">In</text>
|
||||
<text text-anchor="middle" x="472" y="-67.9" font-family="Sans" font-size="14.00">Significand</text>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 5.2 KiB |
122
img/dev/en-nbits-quick-parse.dot
Normal file
122
img/dev/en-nbits-quick-parse.dot
Normal file
|
@ -0,0 +1,122 @@
|
|||
digraph {
|
||||
|
||||
size=6.25;
|
||||
rankdir=TB
|
||||
//splines = ortho;
|
||||
ranksep = 0.0;
|
||||
nodesep = 0.0;
|
||||
|
||||
edge [ penwidth = 1.75, fontname="Sans", style = "invis" ]
|
||||
node [ penwidth = 1.75, shape = "box", fontname="Sans", fontsize = 60, width = 1.3, height = 1.3 ]
|
||||
graph [ penwidth = 0, fontname="Sans", fontsize = 60 ]
|
||||
|
||||
byte_length [ label = "Byte Length: 0x18 (Decimal 24)", shape = "none" ]
|
||||
|
||||
|
||||
subgraph cluster_n {
|
||||
node [ label = "0" ];
|
||||
n24;
|
||||
n23;
|
||||
n22;
|
||||
n21;
|
||||
n20;
|
||||
n19;
|
||||
n18;
|
||||
n17;
|
||||
n16;
|
||||
n15;
|
||||
n14;
|
||||
n13;
|
||||
n12;
|
||||
n11;
|
||||
n10;
|
||||
n9;
|
||||
n8;
|
||||
n7;
|
||||
n6;
|
||||
n5;
|
||||
n4;
|
||||
n1 [ label = "" ];
|
||||
n2 [ label = "" ];
|
||||
n3 [ label = "" ];
|
||||
}
|
||||
|
||||
|
||||
|
||||
subgraph cluster_l {
|
||||
node [ shape = "none" ];
|
||||
l1 [ label = "1" ];
|
||||
l2 [ label = "2" ];
|
||||
l3 [ label = "3" ];
|
||||
l4 [ label = "4" ];
|
||||
l5 [ label = "5" ];
|
||||
l6 [ label = "6" ];
|
||||
l7 [ label = "7" ];
|
||||
l8 [ label = "8" ];
|
||||
l9 [ label = "9" ];
|
||||
l10 [ label = "10" ];
|
||||
l11 [ label = "11" ];
|
||||
l12 [ label = "12" ];
|
||||
l13 [ label = "13" ];
|
||||
l14 [ label = "14" ];
|
||||
l15 [ label = "15" ];
|
||||
l16 [ label = "16" ];
|
||||
l17 [ label = "17" ];
|
||||
l18 [ label = "18" ];
|
||||
l19 [ label = "19" ];
|
||||
l20 [ label = "20" ];
|
||||
l21 [ label = "21" ];
|
||||
l22 [ label = "22" ];
|
||||
l23 [ label = "23" ];
|
||||
l24 [ label = "24" ];
|
||||
}
|
||||
|
||||
l1 -> n1;
|
||||
l2 -> n2;
|
||||
l3 -> n3;
|
||||
l4 -> n4;
|
||||
l5 -> n5;
|
||||
l6 -> n6;
|
||||
l7 -> n7;
|
||||
l8 -> n8;
|
||||
l9 -> n9;
|
||||
l10 -> n10;
|
||||
l11 -> n11;
|
||||
l12 -> n12;
|
||||
l13 -> n13;
|
||||
l14 -> n14;
|
||||
l15 -> n15;
|
||||
l16 -> n16;
|
||||
l17 -> n17;
|
||||
l18 -> n18;
|
||||
l19 -> n19;
|
||||
l20 -> n20;
|
||||
l21 -> n21;
|
||||
l22 -> n22;
|
||||
l23 -> n23;
|
||||
l24 -> n24;
|
||||
|
||||
subgraph cluster_s {
|
||||
node [ shape = "none" ];
|
||||
edge [ style = "", dir="back", arrowsize = 3, minlen = 4 ];
|
||||
|
||||
|
||||
significand [ label = "Most Significant Bytes (Significand)" ];
|
||||
s3 [ label = "30" ];
|
||||
s2 [ label = "c3" ];
|
||||
s1 [ label = "1b" ];
|
||||
|
||||
n1 -> s1;
|
||||
n2 -> s2;
|
||||
n3 -> s3;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
byte_length -> l19;
|
||||
|
||||
label = " \nQuickly Converting nBits 0x181bc330 Into The Target\nThreshold 0x1bc330000000000000000000000000000000"
|
||||
}
|
BIN
img/dev/en-nbits-quick-parse.png
Normal file
BIN
img/dev/en-nbits-quick-parse.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.9 KiB |
298
img/dev/en-nbits-quick-parse.svg
Normal file
298
img/dev/en-nbits-quick-parse.svg
Normal file
|
@ -0,0 +1,298 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 2.26.3 (20100126.1600)
|
||||
-->
|
||||
<!-- Title: _anonymous_0 Pages: 1 -->
|
||||
<svg width="450pt" height="138pt"
|
||||
viewBox="0.00 0.00 450.00 138.16" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph1" class="graph" transform="scale(0.194049 0.194049) rotate(0) translate(4 708)">
|
||||
<title>_anonymous_0</title>
|
||||
<polygon fill="white" stroke="white" points="-4,5 -4,-708 2316,-708 2316,5 -4,5"/>
|
||||
<text text-anchor="middle" x="1155.5" y="-160" font-family="Sans" font-size="60.00"> </text>
|
||||
<text text-anchor="middle" x="1155.5" y="-90" font-family="Sans" font-size="60.00">Quickly Converting nBits 0x181bc330 Into The Target</text>
|
||||
<text text-anchor="middle" x="1155.5" y="-20" font-family="Sans" font-size="60.00">Threshold 0x1bc330000000000000000000000000000000</text>
|
||||
<g id="graph2" class="cluster"><title>cluster_n</title>
|
||||
<polygon fill="none" stroke="black" stroke-width="0" points="8,-374 8,-484 2303,-484 2303,-374 8,-374"/>
|
||||
</g>
|
||||
<g id="graph3" class="cluster"><title>cluster_l</title>
|
||||
<polygon fill="none" stroke="black" stroke-width="0" points="8,-492 8,-602 2303,-602 2303,-492 8,-492"/>
|
||||
</g>
|
||||
<g id="graph4" class="cluster"><title>cluster_s</title>
|
||||
<polygon fill="none" stroke="black" stroke-width="0" points="8,-226 8,-336 1387,-336 1387,-226 8,-226"/>
|
||||
</g>
|
||||
<!-- byte_length -->
|
||||
<g id="node1" class="node"><title>byte_length</title>
|
||||
<text text-anchor="middle" x="1773" y="-638" font-family="Sans" font-size="60.00">Byte Length: 0x18 (Decimal 24)</text>
|
||||
</g>
|
||||
<!-- l19 -->
|
||||
<g id="node46" class="node"><title>l19</title>
|
||||
<text text-anchor="middle" x="1773" y="-528" font-family="Sans" font-size="60.00">19</text>
|
||||
</g>
|
||||
<!-- byte_length->l19 -->
|
||||
<!-- n24 -->
|
||||
<g id="node3" class="node"><title>n24</title>
|
||||
<polygon fill="none" stroke="black" stroke-width="1.75" points="2295,-476 2201,-476 2201,-382 2295,-382 2295,-476"/>
|
||||
<text text-anchor="middle" x="2248" y="-410" font-family="Sans" font-size="60.00">0</text>
|
||||
</g>
|
||||
<!-- n23 -->
|
||||
<g id="node4" class="node"><title>n23</title>
|
||||
<polygon fill="none" stroke="black" stroke-width="1.75" points="2200,-476 2106,-476 2106,-382 2200,-382 2200,-476"/>
|
||||
<text text-anchor="middle" x="2153" y="-410" font-family="Sans" font-size="60.00">0</text>
|
||||
</g>
|
||||
<!-- n22 -->
|
||||
<g id="node5" class="node"><title>n22</title>
|
||||
<polygon fill="none" stroke="black" stroke-width="1.75" points="2105,-476 2011,-476 2011,-382 2105,-382 2105,-476"/>
|
||||
<text text-anchor="middle" x="2058" y="-410" font-family="Sans" font-size="60.00">0</text>
|
||||
</g>
|
||||
<!-- n21 -->
|
||||
<g id="node6" class="node"><title>n21</title>
|
||||
<polygon fill="none" stroke="black" stroke-width="1.75" points="2010,-476 1916,-476 1916,-382 2010,-382 2010,-476"/>
|
||||
<text text-anchor="middle" x="1963" y="-410" font-family="Sans" font-size="60.00">0</text>
|
||||
</g>
|
||||
<!-- n20 -->
|
||||
<g id="node7" class="node"><title>n20</title>
|
||||
<polygon fill="none" stroke="black" stroke-width="1.75" points="1915,-476 1821,-476 1821,-382 1915,-382 1915,-476"/>
|
||||
<text text-anchor="middle" x="1868" y="-410" font-family="Sans" font-size="60.00">0</text>
|
||||
</g>
|
||||
<!-- n19 -->
|
||||
<g id="node8" class="node"><title>n19</title>
|
||||
<polygon fill="none" stroke="black" stroke-width="1.75" points="1820,-476 1726,-476 1726,-382 1820,-382 1820,-476"/>
|
||||
<text text-anchor="middle" x="1773" y="-410" font-family="Sans" font-size="60.00">0</text>
|
||||
</g>
|
||||
<!-- n18 -->
|
||||
<g id="node9" class="node"><title>n18</title>
|
||||
<polygon fill="none" stroke="black" stroke-width="1.75" points="1725,-476 1631,-476 1631,-382 1725,-382 1725,-476"/>
|
||||
<text text-anchor="middle" x="1678" y="-410" font-family="Sans" font-size="60.00">0</text>
|
||||
</g>
|
||||
<!-- n17 -->
|
||||
<g id="node10" class="node"><title>n17</title>
|
||||
<polygon fill="none" stroke="black" stroke-width="1.75" points="1630,-476 1536,-476 1536,-382 1630,-382 1630,-476"/>
|
||||
<text text-anchor="middle" x="1583" y="-410" font-family="Sans" font-size="60.00">0</text>
|
||||
</g>
|
||||
<!-- n16 -->
|
||||
<g id="node11" class="node"><title>n16</title>
|
||||
<polygon fill="none" stroke="black" stroke-width="1.75" points="1535,-476 1441,-476 1441,-382 1535,-382 1535,-476"/>
|
||||
<text text-anchor="middle" x="1488" y="-410" font-family="Sans" font-size="60.00">0</text>
|
||||
</g>
|
||||
<!-- n15 -->
|
||||
<g id="node12" class="node"><title>n15</title>
|
||||
<polygon fill="none" stroke="black" stroke-width="1.75" points="1440,-476 1346,-476 1346,-382 1440,-382 1440,-476"/>
|
||||
<text text-anchor="middle" x="1393" y="-410" font-family="Sans" font-size="60.00">0</text>
|
||||
</g>
|
||||
<!-- n14 -->
|
||||
<g id="node13" class="node"><title>n14</title>
|
||||
<polygon fill="none" stroke="black" stroke-width="1.75" points="1345,-476 1251,-476 1251,-382 1345,-382 1345,-476"/>
|
||||
<text text-anchor="middle" x="1298" y="-410" font-family="Sans" font-size="60.00">0</text>
|
||||
</g>
|
||||
<!-- n13 -->
|
||||
<g id="node14" class="node"><title>n13</title>
|
||||
<polygon fill="none" stroke="black" stroke-width="1.75" points="1250,-476 1156,-476 1156,-382 1250,-382 1250,-476"/>
|
||||
<text text-anchor="middle" x="1203" y="-410" font-family="Sans" font-size="60.00">0</text>
|
||||
</g>
|
||||
<!-- n12 -->
|
||||
<g id="node15" class="node"><title>n12</title>
|
||||
<polygon fill="none" stroke="black" stroke-width="1.75" points="1155,-476 1061,-476 1061,-382 1155,-382 1155,-476"/>
|
||||
<text text-anchor="middle" x="1108" y="-410" font-family="Sans" font-size="60.00">0</text>
|
||||
</g>
|
||||
<!-- n11 -->
|
||||
<g id="node16" class="node"><title>n11</title>
|
||||
<polygon fill="none" stroke="black" stroke-width="1.75" points="1060,-476 966,-476 966,-382 1060,-382 1060,-476"/>
|
||||
<text text-anchor="middle" x="1013" y="-410" font-family="Sans" font-size="60.00">0</text>
|
||||
</g>
|
||||
<!-- n10 -->
|
||||
<g id="node17" class="node"><title>n10</title>
|
||||
<polygon fill="none" stroke="black" stroke-width="1.75" points="965,-476 871,-476 871,-382 965,-382 965,-476"/>
|
||||
<text text-anchor="middle" x="918" y="-410" font-family="Sans" font-size="60.00">0</text>
|
||||
</g>
|
||||
<!-- n9 -->
|
||||
<g id="node18" class="node"><title>n9</title>
|
||||
<polygon fill="none" stroke="black" stroke-width="1.75" points="870,-476 776,-476 776,-382 870,-382 870,-476"/>
|
||||
<text text-anchor="middle" x="823" y="-410" font-family="Sans" font-size="60.00">0</text>
|
||||
</g>
|
||||
<!-- n8 -->
|
||||
<g id="node19" class="node"><title>n8</title>
|
||||
<polygon fill="none" stroke="black" stroke-width="1.75" points="775,-476 681,-476 681,-382 775,-382 775,-476"/>
|
||||
<text text-anchor="middle" x="728" y="-410" font-family="Sans" font-size="60.00">0</text>
|
||||
</g>
|
||||
<!-- n7 -->
|
||||
<g id="node20" class="node"><title>n7</title>
|
||||
<polygon fill="none" stroke="black" stroke-width="1.75" points="680,-476 586,-476 586,-382 680,-382 680,-476"/>
|
||||
<text text-anchor="middle" x="633" y="-410" font-family="Sans" font-size="60.00">0</text>
|
||||
</g>
|
||||
<!-- n6 -->
|
||||
<g id="node21" class="node"><title>n6</title>
|
||||
<polygon fill="none" stroke="black" stroke-width="1.75" points="585,-476 491,-476 491,-382 585,-382 585,-476"/>
|
||||
<text text-anchor="middle" x="538" y="-410" font-family="Sans" font-size="60.00">0</text>
|
||||
</g>
|
||||
<!-- n5 -->
|
||||
<g id="node22" class="node"><title>n5</title>
|
||||
<polygon fill="none" stroke="black" stroke-width="1.75" points="490,-476 396,-476 396,-382 490,-382 490,-476"/>
|
||||
<text text-anchor="middle" x="443" y="-410" font-family="Sans" font-size="60.00">0</text>
|
||||
</g>
|
||||
<!-- n4 -->
|
||||
<g id="node23" class="node"><title>n4</title>
|
||||
<polygon fill="none" stroke="black" stroke-width="1.75" points="395,-476 301,-476 301,-382 395,-382 395,-476"/>
|
||||
<text text-anchor="middle" x="348" y="-410" font-family="Sans" font-size="60.00">0</text>
|
||||
</g>
|
||||
<!-- n1 -->
|
||||
<g id="node24" class="node"><title>n1</title>
|
||||
<polygon fill="none" stroke="black" stroke-width="1.75" points="110,-476 16,-476 16,-382 110,-382 110,-476"/>
|
||||
</g>
|
||||
<!-- s1 -->
|
||||
<g id="node80" class="node"><title>s1</title>
|
||||
<text text-anchor="middle" x="63" y="-262" font-family="Sans" font-size="60.00">1b</text>
|
||||
</g>
|
||||
<!-- n1->s1 -->
|
||||
<g id="edge53" class="edge"><title>n1->s1</title>
|
||||
<path fill="none" stroke="black" stroke-width="1.75" d="M63,-351.47C63,-343.48 63,-335.546 63,-328.04"/>
|
||||
<polygon fill="black" stroke="black" points="52.5001,-351.765 63,-381.765 73.5001,-351.765 52.5001,-351.765"/>
|
||||
</g>
|
||||
<!-- n2 -->
|
||||
<g id="node25" class="node"><title>n2</title>
|
||||
<polygon fill="none" stroke="black" stroke-width="1.75" points="205,-476 111,-476 111,-382 205,-382 205,-476"/>
|
||||
</g>
|
||||
<!-- s2 -->
|
||||
<g id="node79" class="node"><title>s2</title>
|
||||
<text text-anchor="middle" x="158" y="-262" font-family="Sans" font-size="60.00">c3</text>
|
||||
</g>
|
||||
<!-- n2->s2 -->
|
||||
<g id="edge55" class="edge"><title>n2->s2</title>
|
||||
<path fill="none" stroke="black" stroke-width="1.75" d="M158,-351.47C158,-343.48 158,-335.546 158,-328.04"/>
|
||||
<polygon fill="black" stroke="black" points="147.5,-351.765 158,-381.765 168.5,-351.765 147.5,-351.765"/>
|
||||
</g>
|
||||
<!-- n3 -->
|
||||
<g id="node26" class="node"><title>n3</title>
|
||||
<polygon fill="none" stroke="black" stroke-width="1.75" points="300,-476 206,-476 206,-382 300,-382 300,-476"/>
|
||||
</g>
|
||||
<!-- s3 -->
|
||||
<g id="node78" class="node"><title>s3</title>
|
||||
<text text-anchor="middle" x="253" y="-262" font-family="Sans" font-size="60.00">30</text>
|
||||
</g>
|
||||
<!-- n3->s3 -->
|
||||
<g id="edge57" class="edge"><title>n3->s3</title>
|
||||
<path fill="none" stroke="black" stroke-width="1.75" d="M253,-351.47C253,-343.48 253,-335.546 253,-328.04"/>
|
||||
<polygon fill="black" stroke="black" points="242.5,-351.765 253,-381.765 263.5,-351.765 242.5,-351.765"/>
|
||||
</g>
|
||||
<!-- l1 -->
|
||||
<g id="node28" class="node"><title>l1</title>
|
||||
<text text-anchor="middle" x="63" y="-528" font-family="Sans" font-size="60.00">1</text>
|
||||
</g>
|
||||
<!-- l1->n1 -->
|
||||
<!-- l2 -->
|
||||
<g id="node29" class="node"><title>l2</title>
|
||||
<text text-anchor="middle" x="158" y="-528" font-family="Sans" font-size="60.00">2</text>
|
||||
</g>
|
||||
<!-- l2->n2 -->
|
||||
<!-- l3 -->
|
||||
<g id="node30" class="node"><title>l3</title>
|
||||
<text text-anchor="middle" x="253" y="-528" font-family="Sans" font-size="60.00">3</text>
|
||||
</g>
|
||||
<!-- l3->n3 -->
|
||||
<!-- l4 -->
|
||||
<g id="node31" class="node"><title>l4</title>
|
||||
<text text-anchor="middle" x="348" y="-528" font-family="Sans" font-size="60.00">4</text>
|
||||
</g>
|
||||
<!-- l4->n4 -->
|
||||
<!-- l5 -->
|
||||
<g id="node32" class="node"><title>l5</title>
|
||||
<text text-anchor="middle" x="443" y="-528" font-family="Sans" font-size="60.00">5</text>
|
||||
</g>
|
||||
<!-- l5->n5 -->
|
||||
<!-- l6 -->
|
||||
<g id="node33" class="node"><title>l6</title>
|
||||
<text text-anchor="middle" x="538" y="-528" font-family="Sans" font-size="60.00">6</text>
|
||||
</g>
|
||||
<!-- l6->n6 -->
|
||||
<!-- l7 -->
|
||||
<g id="node34" class="node"><title>l7</title>
|
||||
<text text-anchor="middle" x="633" y="-528" font-family="Sans" font-size="60.00">7</text>
|
||||
</g>
|
||||
<!-- l7->n7 -->
|
||||
<!-- l8 -->
|
||||
<g id="node35" class="node"><title>l8</title>
|
||||
<text text-anchor="middle" x="728" y="-528" font-family="Sans" font-size="60.00">8</text>
|
||||
</g>
|
||||
<!-- l8->n8 -->
|
||||
<!-- l9 -->
|
||||
<g id="node36" class="node"><title>l9</title>
|
||||
<text text-anchor="middle" x="823" y="-528" font-family="Sans" font-size="60.00">9</text>
|
||||
</g>
|
||||
<!-- l9->n9 -->
|
||||
<!-- l10 -->
|
||||
<g id="node37" class="node"><title>l10</title>
|
||||
<text text-anchor="middle" x="918" y="-528" font-family="Sans" font-size="60.00">10</text>
|
||||
</g>
|
||||
<!-- l10->n10 -->
|
||||
<!-- l11 -->
|
||||
<g id="node38" class="node"><title>l11</title>
|
||||
<text text-anchor="middle" x="1013" y="-528" font-family="Sans" font-size="60.00">11</text>
|
||||
</g>
|
||||
<!-- l11->n11 -->
|
||||
<!-- l12 -->
|
||||
<g id="node39" class="node"><title>l12</title>
|
||||
<text text-anchor="middle" x="1108" y="-528" font-family="Sans" font-size="60.00">12</text>
|
||||
</g>
|
||||
<!-- l12->n12 -->
|
||||
<!-- l13 -->
|
||||
<g id="node40" class="node"><title>l13</title>
|
||||
<text text-anchor="middle" x="1203" y="-528" font-family="Sans" font-size="60.00">13</text>
|
||||
</g>
|
||||
<!-- l13->n13 -->
|
||||
<!-- l14 -->
|
||||
<g id="node41" class="node"><title>l14</title>
|
||||
<text text-anchor="middle" x="1298" y="-528" font-family="Sans" font-size="60.00">14</text>
|
||||
</g>
|
||||
<!-- l14->n14 -->
|
||||
<!-- l15 -->
|
||||
<g id="node42" class="node"><title>l15</title>
|
||||
<text text-anchor="middle" x="1393" y="-528" font-family="Sans" font-size="60.00">15</text>
|
||||
</g>
|
||||
<!-- l15->n15 -->
|
||||
<!-- l16 -->
|
||||
<g id="node43" class="node"><title>l16</title>
|
||||
<text text-anchor="middle" x="1488" y="-528" font-family="Sans" font-size="60.00">16</text>
|
||||
</g>
|
||||
<!-- l16->n16 -->
|
||||
<!-- l17 -->
|
||||
<g id="node44" class="node"><title>l17</title>
|
||||
<text text-anchor="middle" x="1583" y="-528" font-family="Sans" font-size="60.00">17</text>
|
||||
</g>
|
||||
<!-- l17->n17 -->
|
||||
<!-- l18 -->
|
||||
<g id="node45" class="node"><title>l18</title>
|
||||
<text text-anchor="middle" x="1678" y="-528" font-family="Sans" font-size="60.00">18</text>
|
||||
</g>
|
||||
<!-- l18->n18 -->
|
||||
<!-- l19->n19 -->
|
||||
<!-- l20 -->
|
||||
<g id="node47" class="node"><title>l20</title>
|
||||
<text text-anchor="middle" x="1868" y="-528" font-family="Sans" font-size="60.00">20</text>
|
||||
</g>
|
||||
<!-- l20->n20 -->
|
||||
<!-- l21 -->
|
||||
<g id="node48" class="node"><title>l21</title>
|
||||
<text text-anchor="middle" x="1963" y="-528" font-family="Sans" font-size="60.00">21</text>
|
||||
</g>
|
||||
<!-- l21->n21 -->
|
||||
<!-- l22 -->
|
||||
<g id="node49" class="node"><title>l22</title>
|
||||
<text text-anchor="middle" x="2058" y="-528" font-family="Sans" font-size="60.00">22</text>
|
||||
</g>
|
||||
<!-- l22->n22 -->
|
||||
<!-- l23 -->
|
||||
<g id="node50" class="node"><title>l23</title>
|
||||
<text text-anchor="middle" x="2153" y="-528" font-family="Sans" font-size="60.00">23</text>
|
||||
</g>
|
||||
<!-- l23->n23 -->
|
||||
<!-- l24 -->
|
||||
<g id="node51" class="node"><title>l24</title>
|
||||
<text text-anchor="middle" x="2248" y="-528" font-family="Sans" font-size="60.00">24</text>
|
||||
</g>
|
||||
<!-- l24->n24 -->
|
||||
<!-- significand -->
|
||||
<g id="node77" class="node"><title>significand</title>
|
||||
<text text-anchor="middle" x="840" y="-262" font-family="Sans" font-size="60.00">Most Significant Bytes (Significand)</text>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 14 KiB |
Loading…
Add table
Add a link
Reference in a new issue