Skip to content

fix(bip32): EncodePrivateWIF for classic WIF (#2) - #6

Open
xre217 wants to merge 1 commit into
dogeorg:mainfrom
xre217:fix/bip32-encode-private-wif
Open

fix(bip32): EncodePrivateWIF for classic WIF (#2)#6
xre217 wants to merge 1 commit into
dogeorg:mainfrom
xre217:fix/bip32-encode-private-wif

Conversation

@xre217

@xre217 xre217 commented Jul 11, 2026

Copy link
Copy Markdown

#2 — `Bip32Key.EncodeWIF` returns extended keys

`EncodeWIF` has always returned BIP32 extended serialization (`dgpv`/`dgub`), not classic Wallet Import Format. Renaming would break every caller/test that round-trips xprv/xpub via `EncodeWIF`.

Fix (compat-preserving)

  • Document `EncodeWIF` as BIP32 extended (historical name)
  • Add `EncodePrivateWIF() (string, error)` → classic compressed WIF via `EncodeECPrivKeyWIF`
  • Test: classic WIF ≠ extended; round-trips through `DecodeECPrivKeyWIF`; public key errors

If maintainers prefer a breaking rename (`EncodeWIF` → classic, `EncodeExtended` for BIP32), happy to follow up.

DOGE

Tips/contract: `DTRJECKXfxgnSzGbt7TYRikLPDocqvdmo5` · trefongwork@gmail.com

EncodeWIF historically returns BIP32 extended keys (dgpv/dgub), not
classic Wallet Import Format. Document that and add EncodePrivateWIF()
which returns dumpprivkey-style compressed WIF for private keys.

Tips DOGE: DTRJECKXfxgnSzGbt7TYRikLPDocqvdmo5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant