bips
bips copied to clipboard
BIP328: Use Base58Check in ExtendedKey.deserialize and validate length
- Replace raw Base58 decode and manual slice with base58.decode_check(xpub) to enforce checksum validation as required by BIP-32 and as implied by the method docstring.
- Add strict len(data) == 78 check before parsing to ensure the serialized extended key length matches the BIP-32 78-byte structure.
- This prevents accepting corrupted or truncated extended keys and aligns deserialization behavior with Base58Check semantics.