Merged
Conversation
- Add OpCode enum for binary operation codes - Add attestation types (Pending, Bitcoin, EAS, Unknown) - Add status enums and result types (VerifyStatus, UpgradeStatus) - Add timestamp step types (Append, Prepend, Hash, Attestation, Fork) - Add DigestHeader and DetachedTimestamp types - Add error classes (UTSError, EncodeError, DecodeError, RemoteError)
- Add constants for magic bytes, attestation tags, digest lengths - Implement Encoder class with LEB128 encoding - Implement Decoder class with LEB128 decoding - Support all attestation types and timestamp steps - Add round-trip tests for encode/decode
- Add sha256, keccak256, ripemd160, sha1 hash functions - Implement UnorderedMerkleTree with proof generation - Add MerkleProof and SiblingNode types - Support tree serialization/deserialization - Add comprehensive tests for Merkle tree operations
- Add BitcoinRPC async client for JSON-RPC - Add BitcoinBlockHeader dataclass - Support get_block_hash and get_block_header methods - Add async context manager support - Add mock-based tests for RPC client
- Add EAS contract ABI definitions - Add OnChainAttestation dataclass - Implement read_eas_timestamp for timestamp verification - Implement read_eas_attestation for attestation reading - Add decode_content_hash utility - Define EAS_SCHEMA_ID and NO_EXPIRATION constants
- Add SDK class with async context manager support - Implement stamp() for submitting digests to calendars - Implement verify() for timestamp verification - Support Bitcoin and EAS attestation verification - Add VerificationResult dataclass - Configure default calendars and EAS addresses
- Add codec round-trip tests for encoder/decoder - Add Merkle tree tests for proof generation - Add Bitcoin RPC mock tests - Total 16 passing tests
- Simplify AttestationStatus to a single dataclass - Simplify UpgradeResult to a single dataclass - Add upgrade() method to SDK for upgrading pending attestations - Update public API exports in __init__.py - Add AttestationStatusKind enum export
- Test initialization and options - Test default calendars - Test invalid hash algorithm error - Test async context manager - Test verify with pending attestation - Test upgrade method
- Remove duplicate return statement in merkle.py - Move Self import to top of file - Add SDK.from_env() class method - Fix UpgradeResult.original type to PendingAttestation - Add Literal type for hash_algorithm parameter - Add missing public API exports (MerkleProof, SiblingNode, sha256, keccak256)
- Add test_sdk_from_env for environment variable configuration - Add test_sdk_from_env_defaults for default values - Create conftest.py with common fixtures
- Add SHA256Step, SHA1Step, RIPEMD160Step, Keccak256Step exports - Add AppendStep, PrependStep, ReverseStep, HexlifyStep exports - Add ForkStep export - Update __all__ list
- Add test_types.py for type validation tests - Add test_encoder.py for encoder module tests - Add test_decoder.py for decoder module tests - Add test_crypto_utils.py for hash function tests - Add test_errors.py for error class tests - Total 121 tests passing
There was a problem hiding this comment.
Pull request overview
Introduces an initial Python SDK (uts_sdk) intended to mirror the existing TypeScript SDK, including core types, binary codec, Merkle tree utilities, RPC/EAS integrations, and a test suite.
Changes:
- Adds Python package scaffolding (
pyproject.toml, public API exports, README) and a new async-firstSDKimplementation. - Implements core protocol types (attestations, ops, status enums, timestamp steps) plus encoder/decoder for the OpenTimestamps-compatible binary format.
- Adds crypto utilities (hashing + Merkle tree) and RPC/EAS helpers, along with extensive pytest coverage.
Reviewed changes
Copilot reviewed 37 out of 39 changed files in this pull request and generated 18 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/sdk-py/src/uts_sdk/sdk.py | Main async SDK (stamp/verify/upgrade) and result aggregation |
| packages/sdk-py/src/uts_sdk/_crypto/utils.py | Hash helper functions used across the SDK |
| packages/sdk-py/src/uts_sdk/_crypto/merkle.py | Merkle tree + proof generation used by stamping |
| packages/sdk-py/src/uts_sdk/_codec/encoder.py | Binary encoder for detached timestamps and steps |
| packages/sdk-py/src/uts_sdk/_codec/decoder.py | Binary decoder for detached timestamps and steps |
| packages/sdk-py/src/uts_sdk/_rpc/bitcoin.py | Bitcoin JSON-RPC client used during verification |
| packages/sdk-py/tests/* | Unit tests for types/codec/crypto/SDK/RPC |
| packages/sdk-py/README.md | Package documentation and usage snippet |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 39 out of 41 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.