You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add generate_proof and verify_proof methods to VersionedKvStore (#101)
* Add generate_proof and verify_proof methods to VersionedKvStore
Expose cryptographic proof functionality from ProllyTree to VersionedKvStore
in both Rust and Python APIs for consistent proof generation and verification
across versioned key-value operations.
## Changes
### Rust Implementation
- Add `generate_proof(&self, key: &[u8]) -> Proof<N>` to VersionedKvStore
- Add `verify(&self, proof: Proof<N>, key: &[u8], expected_value: Option<&[u8]>) -> bool`
- Both methods delegate to underlying ProllyTree implementation
- Add comprehensive unit test `test_versioned_store_proof_methods`
### Python Bindings
- Add `generate_proof(key: bytes) -> bytes` to PyVersionedKvStore
- Add `verify_proof(proof_bytes: bytes, key: bytes, expected_value: Optional[bytes]) -> bool`
- Handle proof serialization/deserialization with bincode
- Thread-safe implementation with proper GIL handling
## API Usage
```python
store = VersionedKvStore.open("/path/to/repo")
proof = store.generate_proof(b"key1")
is_valid = store.verify_proof(proof, b"key1", b"value1")
```
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* Update Python README to document VersionedKvStore proof methods
Add documentation for the newly added generate_proof and verify_proof
methods in the VersionedKvStore example section. Also update the
cryptographic verification feature description to clarify it's
available for both trees and versioned storage.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
---------
Co-authored-by: Claude <[email protected]>
0 commit comments