Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion bip-0328/_xpub.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ def deserialize(cls, xpub: str) -> 'ExtendedKey':

:param xpub: The Base58 check encoded xpub
"""
data = base58.decode(xpub)[:-4] # Decoded xpub without checksum
data = base58.decode_check(xpub)
if len(data) != 78: # BIP32 Serialization Format defines a 78-byte structure.
raise ValueError("Invalid extended key length")
return cls.from_bytes(data)

@classmethod
Expand Down