NAME

Web3::Tiny::Secp256k1 - secp256k1 ECDSA (Ethereum/Bitcoin curve)

SYNOPSIS

use Web3::Tiny::Secp256k1 qw(privkey_to_address sign_hash recover_pubkey);

my $priv = pack('H*', '00' x 31 . '01');   # 32-byte private key
my $addr = privkey_to_address($priv);      # 20 raw bytes

my ($r, $s, $recid) = sign_hash($hash32, $priv);

DESCRIPTION

Thin wrapper around Crypt::PK::ECC (part of CryptX, an XS module wrapping libtomcrypt) for the secp256k1 elliptic curve, using CryptX's built-in RFC 6979 deterministic nonce generation and Ethereum-flavored signature format (sign_hash_eth/verify_hash_eth/recovery_pub_eth). Signatures are normalized to low-S form as required by Ethereum.