Skip to content

Base58 decode_check always returns invalid checksum #700

@craigraw

Description

@craigraw

As per title. Because the calculated checksum in

HWI/hwilib/_base58.py

Lines 96 to 98 in 17d5643

checksum = data[-4:]
calc_checksum = hash256(payload)
if checksum != calc_checksum:
uses the full result of the double sha256 and not just the first four bytes, the comparison to the received checksum always fails.

In 674cb08 HWI switched to using it's own base58 implementation for the Bitbox02. This bug is now causing all attempts to sign a multisig PSBT to fail on the Bitbox02 using HWI 2.3.0 due to use of this function in

decode_check(self._get_xpub(keyinfo.path)), xpub

cc @benma

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions