Blockchain Commons Crypto TypeScript Library - v1.0.0-alpha.13
    Preparing search index...

    Function ecdsaSign

    • Sign a message using ECDSA with secp256k1.

      The message is hashed with double SHA-256 before signing (Bitcoin standard).

      Security Note: The private key must be kept secret. ECDSA requires cryptographically secure random nonces internally; this is handled by the underlying library using RFC 6979 deterministic nonces.

      Parameters

      • privateKey: Uint8Array

        32-byte secp256k1 private key

      • message: Uint8Array

        Message to sign (any length, will be double-SHA256 hashed)

      Returns Uint8Array

      64-byte compact signature (r || s format)

      If private key is not 32 bytes