Skip to main content

Try it Live

Run Secp256k1 examples in the interactive playground
This page is a placeholder. All examples on this page are currently AI-generated and are not correct. This documentation will be completed in the future with accurate, tested examples.

Secp256k1 Test Vectors

Comprehensive test vectors from official standards to verify implementation correctness.

RFC 6979 Deterministic ECDSA

Test vectors from RFC 6979 Section A.2.5 (secp256k1 + SHA-256).

Test Case 1: “sample”

Private key:
Message: “sample” (UTF-8 encoded) Message hash (SHA-256):
Expected signature:
Verification:

Test Case 2: “test”

Private key:
Message: “test” (UTF-8 encoded) Message hash (SHA-256):
Expected signature:

IETF Test Vectors

Private Key = 1

Private key:
Public key (uncompressed):
This is the secp256k1 generator point G. Verification:

Private Key = n - 1

Private key (SECP256K1_N - 1):
Public key (uncompressed):
This is -G (negation of generator point). Verification:

Ethereum Test Vectors

Transaction Signature

Transaction (legacy format):
Private key:
RLP-encoded transaction (for signing):
Transaction hash (Keccak256):
Expected signature:

EIP-191 Personal Sign

Message: “Hello Ethereum” Prefixed message:
Message hash (Keccak256):
Private key:
Expected signature:
Recovered address:

Edge Cases

All-Zero Hash

Private key:
Message hash (all zeros):
Expected signature:

All-Ones Hash

Private key:
Message hash (all ones):
Expected signature:

Malleability Tests

Low-s Enforcement

Original signature:
Normalized (low-s):
Verification:

Invalid Input Tests

Invalid Private Keys

Invalid Signatures

Invalid Public Keys

Cross-Implementation Verification

Noble vs OpenSSL

Test that our TypeScript implementation (using @noble/curves) matches OpenSSL results:

Ethereum Clients

Test vectors used by Go-Ethereum, Nethermind, etc: Geth test vector:

Performance Benchmarks

Expected performance ranges for reference implementations: