BIP32는 각 key에 256-bit chain code를 결합하고 HMAC-SHA512와 numbered path로 child를 파생한다. xpub는 normal public descendants를 만들지만 hardened는 private material이 필요하며 이 경계가 위임과 유출 범위를 정한다.
Pieter Wuille가 BIP32를 작성했고 2012-02-11 assigned되었다. 계층은 account/receive branch만 위임한다. consensus가 아니며 mnemonic, passphrase, script, discovery는 BIP39, path 표준, descriptor의 별도 layer다. [BIP 32 — Hierarchical deterministic wallets] [BIP 39 — Mnemonic code for deterministic keys] [Bitcoin Developer Guide — Wallets]
Extended private key는 secp256k1 scalar k와 32-byte chain code c이며 public은 K=point(k)다. key ‘Bitcoin seed’의 HMAC-SHA512에서 IL은 master candidate, IR은 chain code다. IL=0 또는 IL≥n이면 seed가 invalid다. [BIP 32 — Hierarchical deterministic wallets]
CKDpriv는 parse256(IL)을 parent scalar에 mod n으로 더하고 IR을 child code로 쓴다. normal은 serP(Kpar)||ser32(i), hardened는 0x00||ser256(kpar)||ser32(i), i≥2^31. CKDpub는 normal public child만 가능하다. [BIP 32 — Hierarchical deterministic wallets]
xpub는 normal public descendants를 만든다. 하지만 parent xpub와 유출된 non-hardened child private key 하나로 parent private key와 siblings를 복구할 수 있다. hardened는 이 역산만 막으며 seed theft나 오승인은 막지 않는다. [BIP 32 — Hierarchical deterministic wallets]
78-byte serialization은 version, depth, 4-byte fingerprint, child number, chain code, key data 뒤 Base58Check다. mainnet xprv/xpub는 보통 111자다. fingerprint는 강한 인증이 아니며 SLIP132 ypub/zpub 지원도 일관되지 않다. [BIP 32 — Hierarchical deterministic wallets] [SLIP 132 — Registered HD version bytes]
BIP43은 purpose', BIP44는 m/44'/coin_type'/account'/change/index, 0/1, gap limit 20이다. BIP48은 multisig, BIP84는 SegWit, BIP86은 Taproot다. wallet convention이지 seed data나 node rule이 아니다. '는 +2^31. [BIP 43 — Purpose field for deterministic wallets] [BIP 44 — Multi-account hierarchy] [BIP 48 — Multi-script hierarchy for multisig wallets] [BIP 84 — Native SegWit derivation] [BIP 86 — Single-key Taproot derivation]
scoped xpub는 서명 없이 watch-only를 제공하지만 과거/미래 address, balance, timing을 연결한다. compromised host는 address를 바꿀 수 있으므로 중요한 receive address를 trusted signer 화면에서 확인한다. [BIP 32 — Hierarchical deterministic wallets] [Bitcoin Developer Guide — Wallets] [Trezor Learn — Hierarchical deterministic wallets]
xpub는 script를 모른다. descriptor는 origin [fingerprint/path], wpkh(), multisig threshold/cosigners, wildcard, checksum을 담는다. 한 multisig seed는 다른 xpub, 순서, threshold를 복구하지 못한다. tested descriptor를 보관한다. [BIP 380 — Output script descriptors] [BIP 389 — Multipath descriptor key expressions] [Bitcoin Core — Output descriptors] [Bitcoin Optech — Output script descriptors]
root seed는 각 key backup을 없애지만 recovery에는 passphrase, format, network, purpose/script, coin type, accounts, receive/change, gap policy, multisig descriptor가 필요하다. zero balance는 wrong tree일 수 있다. UTXO와 signing을 시험한다. [BIP 44 — Multi-account hierarchy] [BIP 380 — Output script descriptors] [Bitcoin Core — Output descriptors] [BIP 39 — Mnemonic code for deterministic keys]
희귀한 IL≥n, zero scalar, infinity point는 다음 index로 넘긴다. 흔한 실패는 origin 손실, 다른 discovery, ypub/zpub, change 누락, Taproot 미지원, wrong depth다. xprv는 spend authority, xpub는 financial metadata, descriptor는 policy map이다. [BIP 32 — Hierarchical deterministic wallets] [BIP 380 — Output script descriptors] [SLIP 132 — Registered HD version bytes] [Bitcoin Core — Output descriptors]
더 정확히 이해하려면 이 항목과 함께 다음도 읽어 보세요 지갑, Seed Phrase, Extended Public Key (xpub), Derivation Path, Gap Limit, Bitcoin. 다음 항목에서도 이 글을 참조합니다 비트코인 주소, BIP 39, Cold Storage, Watch-only Wallet.