Module

Contract.Crypto.Secp256k1.ECDSA

A module that implements crypto primitives that match CIP-49 SECP256k1 ECDSA spec.

#verifyEcdsaSecp256k1Signature

verifyEcdsaSecp256k1Signature :: ECDSAPublicKey -> MessageHash -> ECDSASignature -> Boolean

Verify ECDSA signature for a message hash.

This function matches CIP-49 definition:

https://github.com/cardano-foundation/CIPs/blob/master/CIP-0049/README.md

#signEcdsaSecp256k1

signEcdsaSecp256k1 :: Secp256k1PrivateKey -> MessageHash -> Aff ECDSASignature

Sign a message hash with a private key, producing a signature compatible with verifyEcdsaSecp256k1Signature.

#deriveEcdsaSecp256k1PublicKey

deriveEcdsaSecp256k1PublicKey :: Secp256k1PrivateKey -> ECDSAPublicKey

Derive a public key from a private key. Uses SECP256K1_EC_COMPRESSED format (compatible with CIP-49).

#mkECDSAPublicKey

mkECDSAPublicKey :: ByteArray -> Maybe ECDSAPublicKey

Construct a public key from its byte representation.

#mkMessageHash

mkMessageHash :: ByteArray -> Maybe MessageHash

Construct a message hash from its byte representation.

This function DOES NOT compute the hash. Use Contract.Crypto.Utils.hashMessageSha256 for that.

Re-exports from Noble.Secp256k1.ECDSA

Modules