@btc-vision/ecpair - v4.0.2
    Preparing search index...

    Class LegacyBackend

    CryptoBackend adapter that delegates to a tiny-secp256k1 compatible library.

    Prefer createLegacyBackend for construction.

    Implements

    Index

    Constructors

    Accessors

    • get hasSchnorrSign(): boolean

      true when the underlying library supports Schnorr signing.

      Returns boolean

    • get hasSchnorrVerify(): boolean

      true when the underlying library supports Schnorr verification.

      Returns boolean

    Methods

    • Returns true if p is a valid SEC1-encoded secp256k1 point.

      Parameters

      • p: Uint8Array

        Compressed (33 bytes) or uncompressed (65 bytes) SEC1 encoding.

      Returns boolean

    • Returns true if d is a valid secp256k1 private key (32 bytes, in range [1, n)).

      Parameters

      • d: Uint8Array

        Raw bytes to test.

      Returns boolean

    • Returns true if p is a valid 32-byte x-only public key whose x-coordinate lies on the secp256k1 curve.

      Parameters

      • p: Uint8Array

        32-byte x-only encoding.

      Returns boolean

    • Adds a scalar tweak to a public key point (P + tweak·G).

      Parameters

      • p: PublicKey

        Base public key.

      • tweak: Bytes32

        32-byte scalar to add.

      • Optionalcompressed: boolean

        Encoding of the returned point.

      Returns PublicKey | null

      The resulting point, or null if the result is the point at infinity.

    • Derives the public key for a private key scalar.

      Parameters

      • d: PrivateKey

        Private key scalar.

      • Optionalcompressed: boolean

        Return compressed (33 bytes) when true (default), uncompressed (65 bytes) when false.

      Returns PublicKey | null

      The public key, or null if d is invalid.