+The store library's transaction API has been redesigned to be more generic, composable, and extensible. The new design allows users to freely compose transactions across different store types and easily integrate custom stores.
+
+## Key Improvements
+
+### 1. Generic Transaction System
+- **Before**: Fixed `CombinedTransaction` for only RangeStore and NamespaceStore
+- **After**: Flexible `Transaction` and `ExtendedTransaction` that support any number of stores
+
+### 2. Composable API
+- **Before**: Required specific store instances in constructor
+- **After**: Builder pattern with `.with_range_store()`, `.with_namespace_store()`, `.with_custom_store()`, `.with_tree()`
+
+### 3. Type-Safe Store Access
+- **Before**: Generic context methods like `assign_range()`, `reserve_namespace()`
+- **After**: Store-specific contexts via `ctx.use_range()`, `ctx.use_namespace()`
+
+### 4. Custom Store Integration
+- **Before**: No support for custom stores
+- **After**: `TransactionProvider` trait allows any store to participate in transactions
+
+## API Changes
+
+### Basic Transaction API
+
+```rust
+// New composable API
+let transaction = Transaction::new()
+ .with_range_store(&range_store)
+ .with_namespace_store(&namespace_store)
+ .with_tree(&metadata_tree);
+
+let result = transaction.execute(|ctx| {
+ let ip_bit = ctx.use_range().assign("ip_pool", "192.168.1.100")?;
+ let reserved = ctx.use_namespace().reserve("users", "alice", "data")?;
+ Ok((ip_bit, reserved))
+})?;
+```
+
+### Extended Transaction API
+
+```rust
+// Support for custom stores with type identification
+- `custom_store.rs` - Conceptual example (demonstration only)
+
+## Documentation
+
+- `TRANSACTION_API.md` - Comprehensive API documentation
+- `examples/README.md` - Example usage patterns and best practices
+- Inline documentation with usage examples
+
+## Testing
+
+- All existing tests pass
+- New tests cover transaction composition scenarios
+- Custom store integration tests included
+- Rollback behavior thoroughly tested
+
+This refactoring provides a solid foundation for the store library to grow while maintaining backward compatibility and improving developer experience.
+The store library provides a flexible and composable transaction system that allows atomic operations across multiple stores. The API has been redesigned to be more generic and extensible, supporting both built-in stores (RangeStore, NamespaceStore) and custom user-defined stores.
+
+## Key Features
+
+- **Composable Transactions**: Mix and match different stores in a single transaction
+- **Type Safety**: Store-specific transaction contexts prevent API misuse
+- **Extensibility**: Easy integration of custom stores via the `TransactionProvider` trait
+- **Atomic Operations**: All-or-nothing semantics with automatic rollback on errors
+- **Backward Compatibility**: Legacy API remains available
+
+## Core Concepts
+
+### TransactionProvider Trait
+
+Any store that wants to participate in transactions must implement the `TransactionProvider` trait:
+ let trees = ctx.custom_store_trees("my_store")?;
+ Some(MyTransactionHelper {
+ store,
+ data: trees[0],
+ metadata: trees[1],
+ })
+}
+```
+
+### Step 4: Use in Transactions
+
+```rust
+// With ExtendedTransaction
+let transaction = ExtendedTransaction::new()
+ .with_custom_store(&my_store, "my_store");
+
+transaction.execute(|ctx| {
+ let helper = use_my_store_extended(ctx, &my_store)
+ .ok_or_else(|| Error::StoreError(sled::Error::Unsupported("Store not available".to_string())))?;
+
+ helper.set("key", "value")?;
+ Ok(())
+})?;
+```
+
+## Error Handling
+
+All transaction operations follow Rust's `Result` pattern. When any operation within a transaction returns an error, the entire transaction is automatically rolled back.
+- `custom_store.rs` - Conceptual example (demonstration only)
+
+## Legacy Support
+
+The original `CombinedTransaction` and `CombinedTransactionContext` types are still available for backward compatibility. However, new code should use the updated API for better composability and type safety.
+This directory contains examples demonstrating how to use the store library's transaction system, including how to create custom stores and integrate them with the transaction framework.
+
+## Examples
+
+### 1. `custom_store.rs` - Basic Custom Store
+Demonstrates the fundamentals of creating a custom store type with versioning capabilities. This example shows:
+- How to implement the `TransactionProvider` trait
+- Basic transaction operations within a custom store
+- Creating a custom transaction context
+
+**Note**: This example uses placeholder implementations for demonstration purposes and is not intended for production use.
+
+### 2. `extended_custom_store.rs` - Production-Ready Custom Store
+A comprehensive example showing how to create a production-ready custom store (AuditStore) that integrates seamlessly with the extended transaction system. This example demonstrates:
+
+- **Custom Store Implementation**: An audit logging store that tracks operations with timestamps
+- **Transaction Provider**: Proper implementation of `TransactionProvider` for the custom store
+- **Transaction Context**: Creating a custom transaction context for type-safe operations
+- **Extension Traits**: How to extend `ExtendedTransactionContext` with custom functionality
+- **Atomic Operations**: Coordinating operations across multiple stores (Range, Namespace, and Audit)
+- **Error Handling**: Proper transaction rollback and error propagation
+- **Real-world Usage**: Complete example with setup, operations, and verification
+
+## Running the Examples
+
+To run the extended custom store example:
+
+```bash
+cd collar/crates/store
+cargo run --example extended_custom_store
+```
+
+To run the tests for the custom store:
+
+```bash
+cargo test --example extended_custom_store
+```
+
+## Key Concepts
+
+### Transaction Composition
+
+The new transaction system allows you to compose transactions flexibly:
+
+```rust
+// Basic transaction with built-in stores
+let transaction = Transaction::new()
+ .with_range_store(&range_store)
+ .with_namespace_store(&namespace_store)
+ .with_tree(&metadata_tree);
+
+// Extended transaction with custom stores
+let transaction = ExtendedTransaction::new()
+ .with_range_store(&range_store)
+ .with_namespace_store(&namespace_store)
+ .with_custom_store(&audit_store, "audit")
+ .with_tree(&config_tree);
+```
+
+### Custom Store Integration
+
+To create a custom store that works with the transaction system: