Skip to content

BIP340Signer: possible performance improvement via ECPrivateKeyParameters subclass #2420

Description

@msgilligan

The current implementation of BIP340Signer.sign() must calculate pBytes with a point multiply.

In libsecp256k1 this multiply operation is avoided by passing a secp256k1_keypair to secp256k1_schnorrsig_sign32().

BIP340Signer could potentially be optimized by creating a subclass of ECPrivateKeyParameters (or maybe ParametersWithRandom?) that contains the x-only pubkey. If BIP340Signer.sign() checks for the subclass it could use the x-only pub-key to avoid this multiplication.

This should speed up signing by approximately 2x.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions