Skip to content

Is it intentional to allow deriving keys with depth over 255 that cannot be dumped? #114

@quapka

Description

@quapka

Hi,
when a new extended key is derived, the depth can grow over 255. Such an extended key is later not serializable, because python-hdwallet's code raises an exception ValueError: byte must be in range(0, 256). This behavior is in compliance with BIP32's serialization format, however, I wonder if keys with greater depths should be allowed to be derived in the first place at all. See also this bitcoin/bitcoin#32201 for occurrences in other libraries.

The MWE can be quickly created by using the example from the README.md and using "m" + "/0" * 256 and dumping the wallet.

(The first link also hints that Cardano derivation variant might also be affected.)

Is it intentional to allow deriving keys with depth over 255 that cannot be serialized?

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomersquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions