secp256k1
0.4.1, released 4 months ago by c0mm4nd.com
Pure Dart implementation of secp256k1 ECDSA signing and verification
What it does
Provides key generation, ECDSA signing, and signature verification on the secp256k1 curve. It also exposes utilities for public key handling and curve point validation.
AI-written summary of version 0.4.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- Generating Bitcoin or Ethereum private/public keys
- Signing messages for blockchain transactions
- Verifying ECDSA signatures in Dart applications
Skip it when
- When deterministic ECDSA signatures are required
- When using Schnorr signatures or other curve algorithms
Strengths
- Pure Dart, no native dependencies
- Security fixes for key generation and nonce handling
- Low‑S normalization and curve point validation
Weaknesses
- Does not provide deterministic ECDSA signatures
- Limited to ECDSA, no Schnorr support
- No high‑level blockchain abstractions
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 1
var pk = PrivateKey.fromHex('c37c299bb7f5ffd8d9329d052983342a8c3234ff3b3fa32a292187341f7146d7');
var pub = pk.publicKey;
print(pub.toHex());
print(pub.toCompressedHex());
var messageHash = 'b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9';
var sig = pk.signature(messageHash);
print(sig.verify(pub, messageHash));Alternatives
Packages that do the same job and could replace secp256k1.
- aws_signature_v4
Dart implementation of AWS Signature Version 4 for signing HTTP requests.
85Compare - elliptic
Pure Dart elliptic curve math for ECDSA, ECDH, key generation.
66Compare - result_type
A Result type representing success or failure in Dart
50Compare - package_signature
Retrieve Android package signature (SHA1/SHA256) in a Flutter app.
66Compare
Works with
Packages commonly used together with secp256k1: ones it builds on, ones built on it, and its own family.