Skip to content

PyR0 v0.1.0 - Alpha Release

Choose a tag to compare

@garyrob garyrob released this 15 Aug 18:53
· 9 commits to main since this release

πŸŽ‰ PyR0 v0.1.0 - First Alpha Release

This release marks PyR0's transition from pre-alpha to alpha status with a completely refined API that's cleaner, more Pythonic, and easier to use.

πŸš€ Major API Improvements

Simplified Proof Generation

# Before: Multiple steps
input_data = pyr0.prepare_input(data)
segments, info = pyr0.execute_with_input(image, input_data)
receipt = pyr0.generate_proof(segments[0])

# Now: One simple call
receipt = pyr0.prove(image, data)

Property-Based Access

# Before: Method calls
journal = receipt.journal_bytes()
image_id = image.image_id()

# Now: Properties
journal = receipt.journal
image_id = image.id

✨ Key Features

  • Unified prove() function - Combines execution and proof generation in one call
  • Direct byte handling - No more prepare_input() wrapper, just pass bytes directly
  • Efficient guest I/O - Guests now use env::read_slice() for better performance
  • Cleaner API - Properties instead of methods for data access
  • Optional serialization - Helper functions in pyr0.serialization module
  • Borsh support - Built-in support for cross-language serialization

πŸ“¦ What's Included

  • Full RISC Zero zkVM integration
  • Merkle tree implementation with Poseidon hash
  • Zero-knowledge proof generation and verification
  • Ed25519 signature verification in zkVM
  • Complete demo applications

πŸ”§ System Requirements

⚠️ Currently Apple Silicon Only

  • Apple Silicon Mac (M1/M2/M3)
  • macOS 11.0+
  • Python 3.8.3+
  • Rust toolchain
  • uv package manager

πŸ“š Examples

Two complete demonstration applications are included:

  • Merkle ZKP Demo - Privacy-preserving membership proofs
  • Ed25519 Demo - Zero-knowledge signature verification

πŸ› οΈ Installation

# Clone and build
git clone https://github.com/garyrob/PyR0.git
cd PyR0
uv tool run maturin build --release
uv pip install --force-reinstall target/wheels/PyR0-0.1.0-*.whl

# Run demos
uv run demo/merkle_zkp_demo.py
uv run demo/ed25519_demo.py

πŸ“ Breaking Changes from v0.0.x

This is a major API overhaul. Code using v0.0.x will need updates:

  • Replace prepare_input() calls with direct byte passing
  • Replace generate_proof() with prove()
  • Update property access (remove parentheses)
  • Update guest code to use env::read_slice()

πŸ™ Acknowledgments

Based on the original PyR0 by L2 Iterative, extended with Merkle trees and improved APIs.


Note: This is an alpha release for testing and development. Production use is not recommended yet.