
Mastering Bitcoin

The output amount is followed by a compactSize integer indicating the length of the output script, the script that contains the conditions that will need to be fulfilled in order to spend the bitcoins. According to Bitcoin’s consensus rules, the minimum size of an output script is zero. The consensus maximum allowed size of an output script varies
... See moreDavid A. Harding • Mastering Bitcoin
Although ants form a caste-based society and have a queen for producing offspring, there is no central authority or leader in an ant colony. The highly intelligent and sophisticated behavior exhibited by a multimillion-member colony is an emergent property from the interaction of the individuals in a social network. Nature demonstrates that decentr
... See moreDavid A. Harding • Mastering Bitcoin
Wallet applications implementing additional protocols beyond basic Bitcoin support may also need or want to store other data. For example, as of 2023, an increasing number of applications have added support for sending and receiving transactions over the Lightning Network (LN). Although the LN protocol provides a method to recover funds in the even
... See moreDavid A. Harding • Mastering Bitcoin
This odd behavior is probably an unintentional consequence of a design decision in early Bitcoin software. As a practical matter, it means developers of Bitcoin software need to remember to reverse the order of bytes in transaction and block identifiers they show to users. In this book, we use the term internal byte order for the data that appears
... See moreDavid A. Harding • Mastering Bitcoin
Utreexo,
David A. Harding • Mastering Bitcoin
Another common application of this solution is for cold-storage or hardware signing devices. In that scenario, the extended private key can be stored on a paper wallet or hardware device, while the extended public key can be kept online. The user can create “receive” addresses at will, while the private keys are safely stored offline. To spend the
... See moreDavid A. Harding • Mastering Bitcoin
Not every transaction has a change output. Those that don’t are called changeless transactions, and they can have only a single output. Changeless transactions are only a practical option if the amount being spent is roughly the same as the amount available in the transaction inputs minus the anticipated transaction fee.
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
Bitcoin transaction validation is not based on a static pattern but instead is achieved through the execution of a scripting language. This language allows for a nearly…
Some highlights have been hidden or truncated due to export limits.