Files
cdk/crates/cdk-common
Cesar Rodas abdde307c6 Fix race conditions with proof state updates.
Add a strict set of updates to prevent incorrect state changes and correct
usage. Supporting the transaction at the trait level prevented some cases, but
having a strict set of state change flows is better.

This bug was found while developing the signatory. The keys are read from
memory, triggering race conditions at the database, and some `Pending` states
are selected (instead of just selecting `Unspent`).

This PR also introduces a set of generic database tests to be executed for all
database implementations, this test suite will make sure writing and
maintaining new database drivers
2025-04-19 18:15:42 -03:00
..
2025-03-25 23:27:38 +00:00

CDK Common

crates.io Documentation MIT licensed

Common types, traits, and utilities for the Cashu Development Kit (CDK).

Overview

The cdk-common crate provides shared functionality used across the CDK crates. It contains core data structures, error types, and utility functions that are essential for implementing Cashu wallets and mints.

Features

  • Core Data Types: Implementations of fundamental Cashu types like MintUrl, ProofInfo, and Melted
  • Error Handling: Comprehensive error types for Cashu operations
  • Database Abstractions: Traits for database operations used by wallets and mints
  • NUT Implementations: Common functionality for Cashu NUTs (Notation, Usage, and Terminology)

Usage

Add this to your Cargo.toml:

[dependencies]
cdk-common = "*"

Components

The crate includes several key modules:

  • common: Core data structures used throughout the CDK
  • database: Traits for database operations
  • error: Error types and handling
  • mint_url: Implementation of the MintUrl type
  • nuts: Common functionality for Cashu NUTs

License

This project is licensed under the MIT License.