Summary
@xchainjs/xchain-bitcoin currently supports only P2WPKH (native SegWit, default, m/84'/0'/0'/0/) and P2TR (Taproot, m/86') via the AddressFormat enum. It has no support for two older, still-widely-held address types:
- P2PKH — legacy
1… addresses, BIP44 m/44'/0'/0'/0/
- P2SH-P2WPKH — wrapped-SegWit
3… addresses, BIP49 m/49'/0'/0'/0/
Consumers with funds on 1… or 3… addresses — common for older wallets, exchange withdrawals, and long-held cold storage — cannot derive, view balances for, or spend from those addresses using this client.
Scope decision: cover both P2PKH and P2SH-P2WPKH (the earlier open question about whether to include 3… is resolved: yes, include it).
Current state
packages/xchain-bitcoin/src/client.ts — default rootDerivationPaths are BIP84 (m/84').
AddressFormat supports P2WPKH and P2TR only (src/types/client-types.ts).
- Address building in
clientKeystore.ts / client.ts branches on P2WPKH vs P2TR (Bitcoin.payments.p2wpkh / p2tr) — no p2pkh or p2sh branch.
- Ledger (
clientLedger.ts) format handling only covers bech32 / bech32m.
Proposed work
Enum + paths
- Add
P2PKH and P2SH_P2WPKH to the AddressFormat enum.
- Add default paths: P2PKH
m/44'/0'/0'/0/ (mainnet) / m/44'/1'/0'/0/ (testnet); P2SH-P2WPKH m/49'/0'/0'/0/ (mainnet) / m/49'/1'/0'/0/ (testnet).
Address generation + tx build/sign (keystore + Ledger)
- P2PKH:
Bitcoin.payments.p2pkh; Ledger legacy uses p2pkh/base58 (not bech32).
- P2SH-P2WPKH:
Bitcoin.payments.p2sh({ redeem: Bitcoin.payments.p2wpkh(...) }); PSBT inputs need the redeemScript; Ledger uses the p2sh format.
Tests + release
- Derivation vectors for both new formats, plus build/sign coverage.
- Changeset (minor — additive feature).
Notes / open questions
- Confirm the underlying UTXO providers return
1… and 3… address UTXOs correctly.
3… is not exclusively wrapped-SegWit (P2SH also covers multisig/other scripts); this work specifically targets single-sig P2SH-P2WPKH (BIP49).
Context: scoped during a working session; scope confirmed to include both P2PKH and P2SH-P2WPKH. Parked to pick up later.
Summary
@xchainjs/xchain-bitcoincurrently supports only P2WPKH (native SegWit, default,m/84'/0'/0'/0/) and P2TR (Taproot,m/86') via theAddressFormatenum. It has no support for two older, still-widely-held address types:1…addresses, BIP44m/44'/0'/0'/0/3…addresses, BIP49m/49'/0'/0'/0/Consumers with funds on
1…or3…addresses — common for older wallets, exchange withdrawals, and long-held cold storage — cannot derive, view balances for, or spend from those addresses using this client.Scope decision: cover both P2PKH and P2SH-P2WPKH (the earlier open question about whether to include
3…is resolved: yes, include it).Current state
packages/xchain-bitcoin/src/client.ts— defaultrootDerivationPathsare BIP84 (m/84').AddressFormatsupportsP2WPKHandP2TRonly (src/types/client-types.ts).clientKeystore.ts/client.tsbranches onP2WPKHvsP2TR(Bitcoin.payments.p2wpkh/p2tr) — nop2pkhorp2shbranch.clientLedger.ts) format handling only coversbech32/bech32m.Proposed work
Enum + paths
P2PKHandP2SH_P2WPKHto theAddressFormatenum.m/44'/0'/0'/0/(mainnet) /m/44'/1'/0'/0/(testnet); P2SH-P2WPKHm/49'/0'/0'/0/(mainnet) /m/49'/1'/0'/0/(testnet).Address generation + tx build/sign (keystore + Ledger)
Bitcoin.payments.p2pkh; Ledger legacy usesp2pkh/base58 (not bech32).Bitcoin.payments.p2sh({ redeem: Bitcoin.payments.p2wpkh(...) }); PSBT inputs need theredeemScript; Ledger uses thep2shformat.Tests + release
Notes / open questions
1…and3…address UTXOs correctly.3…is not exclusively wrapped-SegWit (P2SH also covers multisig/other scripts); this work specifically targets single-sig P2SH-P2WPKH (BIP49).Context: scoped during a working session; scope confirmed to include both P2PKH and P2SH-P2WPKH. Parked to pick up later.