Mastering Bitcoin
Except for increasing the complexity of Bitcoin slightly, there are no significant downsides of MAST for Bitcoin and there were two solid proposals for it, BIP114 and BIP116, before an improved approach was discovered, which we’ll see in “Taproot”.
David A. Harding • Mastering Bitcoin
Each input in a transaction must contain three fields: an outpoint field, a length-prefixed input script field, and a sequence
David A. Harding • Mastering Bitcoin
The other part of a bech32m address is called the “data part.” There are three elements to this part: Witness version A single byte that encodes as a single character in a bech32m Bitcoin address immediately following the separator. This letter represents the segwit version. The letter “q” is the encoding of “0” for segwit v0, the initial version o
... See moreDavid A. Harding • Mastering Bitcoin
the original Bitcoin whitepaper describes a system where bitcoins were received to public keys (pubkeys) and spent with signatures (sigs). The public key defined who was authorized to spend the bitcoins (whoever controlled the corresponding private key) and the signature provided authentication that the spending transaction came from someone who co
... See moreDavid A. Harding • Mastering Bitcoin
The input script field is a remnant of the legacy transaction format. Our example transaction input spends a native segwit output that doesn’t require any data in the input script, so the length prefix for the input script is set to zero (0x00).
David A. Harding • Mastering Bitcoin
Every modern Bitcoin wallet of which we’re aware uses hierarchical deterministic (HD) key generation by default. This standard, defined in BIP32, uses deterministic key generation and optional public child key derivation with an algorithm that produces a tree of keys. In this tree, any key can be the parent of a sequence of child keys, and any of t
... See moreDavid 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 is a peer-to-peer (P2P) network. Full nodes are the peers: each peer individually validates every confirmed transaction and can provide data to its user with complete authority. Lightweight wallets and other software are clients: each client depends on one or more peers to provide it with valid data. Bitcoin clients can perform secondary va
... See moreDavid A. Harding • Mastering Bitcoin
Additionally, it may be useful for wallet applications to provide a standardized format to export labels so that they can be used in other applications (e.g., accounting software). A standard for that format is proposed in BIP329.
David 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.