
Mastering Bitcoin

As mentioned previously, a very useful characteristic of HD wallets is the ability to derive public child keys from public parent keys without having the private keys. This gives us two ways to derive a child public key: either from the child private key or directly from the parent public key. An extended public key can be used, therefore, to deriv
... See moreDavid A. Harding • Mastering Bitcoin
Conditional operators evaluate a condition, producing a boolean result of TRUE or FALSE. For example, OP_EQUAL pops two items from the stack and pushes TRUE (TRUE is represented by the number 1) if they are equal or FALSE (represented by 0) if they are not equal. Bitcoin transaction scripts usually contain a conditional…
Some highlights have been hi
David A. Harding • Mastering Bitcoin
The most important data in a wallet database is its private keys. If you lose access to the private keys, you lose the ability to spend your bitcoins. Deterministic key derivation and recovery codes provide a reasonably robust solution for backing up and recovering your keys and the bitcoins they control. However, it’s important to consider that ma
... See moreDavid A. Harding • Mastering Bitcoin
Scriptless multisignatures are smaller and more private than scripted multisignatures. For scripted multisignatures, the number of bytes placed in a transaction increases for every key and signature involved. For scriptless multisignatures, the size is constant—a million participants each providing their own partial key and partial signature puts
... See moreDavid A. Harding • Mastering Bitcoin
Warning P2SH output scripts contain the hash of a redeem script, which gives no clues as to the content of the redeem script. The P2SH output will be considered valid and accepted even if the redeem script is invalid. You might accidentally receive bitcoin in such a way that it cannot later be spent.
David A. Harding • Mastering Bitcoin
Only a valid transaction that correctly satisfies the conditions of the output script results in the output…
Some highlights have been hidden or truncated due to export limits.
David A. Harding • Mastering Bitcoin
All the inputs are validated independently as part of the overall validation…
Some highlights have been hidden or truncated due to export limits.
David A. Harding • Mastering Bitcoin
as of early 2023, all Bitcoin miners combined execute about 280 hash functions every hour. They run a different hash function than HASH160, so their existing hardware can’t create collision attacks for it, but the existence of the Bitcoin network proves that collision attacks against 160-bit functions like HASH160 are practical. Bitcoin miners have
... See moreDavid A. Harding • Mastering Bitcoin
Running a node, however, requires downloading and processing over 500 GB of data initially and about 400 MB of Bitcoin transactions per day. These figures are for 2023 and will likely increase over time. If you shut down your node or get disconnected from the internet for several days, your node will need to download the data that it missed. For ex
... See more