Cashu-TS - v4.12.0
    Preparing search index...

    Function findSigningKey

    • Find the private key that can sign for a given compressed public key.

      Parameters

      • pubkey: string

        Compressed SEC1 public key (33 bytes, hex-encoded) to match against.

      • privkeys: string | string[]

        One or more candidate private keys (hex-encoded).

      Returns string

      The private key hex string that signs for pubkey.

      Matches on the x coordinate: a key imported from an x-only context (any nostr key) is published as 02 || x but its scalar derives the odd-y twin half the time. That twin is n - d, and it is what gets returned, so the caller signs for the point the quote actually names.

      If no candidate key derives to the expected pubkey.