Metadata-Version: 2.4
Name: spec256k1
Version: 0.2.3
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: pytest ; extra == 'test'
Requires-Dist: coincurve ; extra == 'test'
Provides-Extra: test
Summary: Fast secp256k1 ECDSA signature recovery for Python
Requires-Python: >=3.11
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Repository, https://github.com/kevaundray/spec256k1

# spec256k1

[![PyPI](https://img.shields.io/pypi/v/spec256k1)](https://pypi.org/project/spec256k1/)
[![Python versions](https://img.shields.io/pypi/pyversions/spec256k1)](https://pypi.org/project/spec256k1/)
[![CI](https://github.com/kevaundray/spec256k1/actions/workflows/CI.yml/badge.svg)](https://github.com/kevaundray/spec256k1/actions/workflows/CI.yml)

A fast, Rust-backed Python library for secp256k1 ECDSA signature recovery.

## Install

```
pip install spec256k1
```

## Usage

```python
import spec256k1

# Recover a public key from a signature and message digest
pubkey = spec256k1.PublicKey.from_signature_and_message(sig65, msg32)
raw = pubkey.format(compressed=False)[1:]  # 64-byte x||y

# Sign a 32-byte digest with a recoverable signature
sk = spec256k1.PrivateKey(secret_bytes)
sig = sk.sign_recoverable(msg32)  # returns 65 bytes: r(32) || s(32) || v(1)

# Derive public key from private key
pk = sk.public_key
```

