Files
bitcoin/src/script
Ava Chow 21ee7f6c00 Merge bitcoin/bitcoin#35069: Refactor keypath parser
777aee77d1 refactor: deduplicate keypath element parsing (pythcoiner)
7d8fddfba2 refactor: define BIP32_HARDENED and BIP32_UNHARDENED constants (pythcoiner)

Pull request description:

  The codebase used raw `0x80000000` (and implicit `0`) as the bip32 hardened / unhardened flag.

  `ParseHDKeypath` and `ParseKeyPathNum` were two separate parsers for BIP32 keypath elements, #32784 aligned their rules (both accept ' and h as hardened marker and reject indexes > 0x7FFFFFFF), but the parsing logic itself was still duplicated.

  This PR:
  - Define `BIP32_HARDENED_FLAG` / `BIP32_UNHARDENED_FLAG` constants to replace magic `0x80000000` and `0` literals.
  - Add `ParseKeyPathElement` as bip32 parsing util and use it consistantly in `ParseHDKeyPath` and the descriptor keypath parser.

ACKs for top commit:
  Sjors:
    ACK 777aee77d1
  achow101:
    ACK 777aee77d1

Tree-SHA512: fb096eef82bb5a90baa7de41f5562b935665ee4b64c41586cf89e06c5633be44063a35a89d01a1432c8e63222d94bd06840bafc2a837f252013e317de0f5837a
2026-08-19 10:33:45 -07:00
..
2026-07-02 13:04:33 -07:00