Skip to content

[Feature Request] Preserve and use the ed25519 seed to improve compatibility with modern implementations #1044

@aqua

Description

@aqua

MC's ed25519 library is a 2013 implementation by Orson Peters -- while it generates new keypairs from a 32-byte seed as normal, the representation it uses for the private key is the sha512 of the seed after cofactor clamping. This works, but few if any modern ed25519 libraries are compatible with that representation. Most just use the seed, or a few use the right half of the sha512 before clamping, neither of which are possible using the keys stored by the current MC firmware.

This mostly matters to loggers like mctomqtt, which do a get prv.key to obtain the secret key so they can decode the raw packets, and are thus very constrained in what crypto libraries they can use (mctomqtt shells out to a Node implementation of a WASM build of Peters' library).

Please consider preserving the original seed, and making it available via the CLI. I'll send a PR that implements this. It won't help nodes already deployed with current keys (their seeds are long gone) but loggers will generally be able well connected and able to regen their keys if they need the functionality.

Background:

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