Skip to content

Change reference implementation to select checksum type "application agnostically" #75

Description

@BenWestgate

For future applications, codex32 needs to be able to validate the header, string length, and select between regular/Long checksum to validate strings without caring what the human-readable prefix is, other than non-zero length printable characters.

To answer the question "Is this string valid in the codex32 format?"

@apoelstra suggested this issue here: bitcoin/bips#2040 (comment)

But I guess you should open a separate (small) PR to change the reference implementation so we can discuss it independent of anything else.

Is the reference I should change this one?
https://github.com/BlockstreamResearch/codex32/tree/master/reference/rust-codex32

To keep the PR small, I will only change the checksum selection math. I won't try to "generalize for any HRP" yet. That will be easiest to review.

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