Metadata-Version: 2.4
Name: pyzcash
Version: 0.1.0a1
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Rust
Requires-Dist: pytest>=7.0 ; extra == 'dev'
Requires-Dist: maturin>=1.0 ; extra == 'dev'
Provides-Extra: dev
License-File: LICENSE
Summary: Python bindings for librustzcash: address parsing, ZIP-321 URIs, and key derivation
License-Expression: MIT
Requires-Python: >=3.10
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM

# pyzcash

Python bindings for [librustzcash](https://github.com/zcash/librustzcash). Built with [PyO3](https://pyo3.rs).

Wraps `zcash_address`, `zip321`, and `zcash_keys` into four Python functions. All crypto runs in Rust.

## Install

```
pip install maturin
git clone https://github.com/craigraw/pyzcash && cd pyzcash
maturin develop
```

Needs a Rust toolchain. Pre-built wheels coming eventually.

## Usage

```python
import pyzcash

# Parse any Zcash address (full checksum validation, not prefix matching)
info = pyzcash.parse_address("tmEZhbWHTpdKMw5it8YDspUXSMGQyFwovpU")
info.address_type  # "p2pkh"
info.network       # "test"
info.is_shielded   # False

# Parse a ZIP-321 payment URI
payments = pyzcash.parse_payment_uri("zcash:tmEZhbWHTpdKMw5it8YDspUXSMGQyFwovpU?amount=42.5")
payments[0].amount_zatoshis  # 4250000000
payments[0].amount_zec       # 42.5

# Generate a ZIP-321 payment URI
pyzcash.create_payment_uri("tmEZhbWHTpdKMw5it8YDspUXSMGQyFwovpU", 4_250_000_000)
# "zcash:tmEZhbWHTpdKMw5it8YDspUXSMGQyFwovpU?amount=42.5"

# Derive a unified address from a seed
import os
result = pyzcash.derive_address(os.urandom(32), network="main", account=0)
result.unified_address  # "u1..."
```

## What it wraps

| Function | Crate | Does |
|---|---|---|
| `parse_address()` | `zcash_address` | Validate + classify addresses |
| `parse_payment_uri()` | `zip321` | Parse ZIP-321 URIs |
| `create_payment_uri()` | `zip321` | Generate ZIP-321 URIs |
| `derive_address()` | `zcash_keys` | Seed to unified address (Orchard + Sapling) |

No reimplemented crypto. Checksums, key derivation, encoding are all handled by the Rust libraries.

## Status

Alpha. Four functions that work. Next steps:

- Transaction building
- Wallet scanning via `zcash_client_backend`
- Viewing key import/export
- Pre-built wheels so you don't need Rust installed

## License

MIT

