View Source Bitcoinex.Secp256k1.Ecdsa (bitcoinex v0.1.8)

Link to this section Summary

Functions

deterministic_k implements rfc6979 and returns a deterministic k value for signatures

ecdsa_recover_compact does ECDSA public key recovery.

sign returns an ECDSA signature using the privkey and z where privkey is a PrivateKey object and z is an integer. The nonce is derived using RFC6979.

sign_message returns an ECDSA signature using the privkey and "Bitcoin Signed Message: <msg>" where privkey is a PrivateKey object and msg is a binary message to be hashed. The message is hashed using hash256 (double SHA256) and the nonce is derived using RFC6979.

verify whether the ecdsa signature is valid for the given message hash and public key

Link to this section Functions

Link to this function

deterministic_k(private_key, raw_z)

View Source

deterministic_k implements rfc6979 and returns a deterministic k value for signatures

Link to this function

ecdsa_recover_compact(msg, compact_sig, recoveryId)

View Source
@spec ecdsa_recover_compact(binary(), binary(), integer()) ::
  {:ok, binary()} | {:error, String.t()}

ecdsa_recover_compact does ECDSA public key recovery.

sign returns an ECDSA signature using the privkey and z where privkey is a PrivateKey object and z is an integer. The nonce is derived using RFC6979.

Link to this function

sign_message(privkey, msg)

View Source

sign_message returns an ECDSA signature using the privkey and "Bitcoin Signed Message: <msg>" where privkey is a PrivateKey object and msg is a binary message to be hashed. The message is hashed using hash256 (double SHA256) and the nonce is derived using RFC6979.

Link to this function

verify_signature(pubkey, sighash, signature)

View Source

verify whether the ecdsa signature is valid for the given message hash and public key