Expand description
This crate is the base foundation to build things that can interact with the CDK (Cashu Development Kit) and their internal crates.
This is meant to contain the shared types, traits and common functions that are used across the internal crates.
§CDK Common
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, andMelted - 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.
Re-exports§
pub use error::Error;pub use bitcoin;pub use cashu::lightning_invoice;
Modules§
- amount
- CDK Amount
- common
- Types
- database
- CDK Database
- dhke
- Diffie-Hellmann key exchange
- error
- Errors
- mint
- Mint types
- mint_
url - Url
- nut00
- NUT-00: Notation and Models
- nut01
- NUT-01: Mint public key exchange
- nut02
- NUT-02: Keysets and keyset ID
- nut03
- NUT-03: Swap
- nut04
- NUT-04: Mint Tokens via Bolt11
- nut05
- NUT-05: Melting Tokens
- nut06
- NUT-06: Mint Information
- nut07
- NUT-07: Spendable Check
- nut08
- NUT-08: Lightning fee return
- nut09
- NUT-09: Restore signatures
- nut10
- NUT-10: Spending conditions
- nut11
- NUT-11: Pay to Public Key (P2PK)
- nut12
- NUT-12: Offline ecash signature validation
- nut13
- NUT-13: Deterministic Secrets
- nut14
- NUT-14: Hashed Time Lock Contacts (HTLC)
- nut15
- NUT-15: Multipart payments
- nut17
- Specific Subscription for the cdk crate
- nut18
- NUT-18: Payment Requests
- nut19
- NUT-19: Cached Responses
- nut20
- Mint Quote Signatures
- nut21
- 21 Clear Auth
- nut22
- 22 Blind Auth
- nuts
- Nuts
- payment
- CDK Mint Lightning
- pub_sub
- Publish–subscribe pattern.
- secret
- Secret
- subscription
- Subscription types and traits
- util
- Cashu utils
- wallet
- Wallet Types
- ws
- Websocket types and functions for the CDK.
Structs§
- Amount
- Amount can be any unit
- Auth
Proof - Auth Proofs
- Blind
Auth Settings - Blind auth settings
- Blind
Auth Token - Blind Auth Token
- Blind
Signature - Blind Signature (also called
promise) - Blind
Signature Dleq - Blinded Signature on Dleq
- Blinded
Message - Blinded Message (also called
output) - Bolt11
Invoice - Represents a syntactically and semantically correct lightning BOLT11 invoice.
- Check
State Request - Check spendable request [NUT-07]
- Check
State Response - Check Spendable Response [NUT-07]
- Clear
Auth Settings - Clear Auth Settings
- Conditions
- P2PK and HTLC spending conditions
- Contact
Info - Contact Info
- HTLC
Witness - HTLC Witness
- Id
- A keyset ID is an identifier for a specific keyset. It can be derived by anyone who knows the set of public keys of a mint. The keyset ID CAN be stored in a Cashu token such that the token can be used to identify which mint or keyset it was generated from.
- KeySet
- Keyset
- KeySet
Info - KeySetInfo
- Keys
- Mint public keys per amount.
- Keys
Response - Mint Public Keys [NUT-01]
- Keyset
Response - Mint Keysets [NUT-02] Ids of mints keyset ids
- Melt
Bolt11 Request - Melt Bolt11 Request [NUT-05]
- Melt
Method Settings - Melt Method Settings
- Melt
Quote Bolt11 Request - Melt quote request [NUT-05]
- Melt
Quote Bolt11 Response - Melt quote response [NUT-05]
- Mint
Auth Request - Mint auth request [NUT-XX]
- Mint
Bolt11 Request - Mint request [NUT-04]
- Mint
Bolt11 Response - Mint response [NUT-04]
- Mint
Info - Mint Info [NUT-06]
- Mint
KeySet - MintKeyset
- Mint
Method Settings - Mint Method Settings
- Mint
Quote Bolt11 Request - Mint quote request [NUT-04]
- Mint
Quote Bolt11 Response - Mint quote response [NUT-04]
- Mint
Version - Mint Version
- Mpp
- Multi-part payment
- MppMethod
Settings - Mpp Method Settings
- NUT04
Settings - Mint Settings
- NUT05
Settings - Melt Settings
- NUT15
Settings - Mpp Settings
- Nut10
Secret - NUT10 Secret
- Nuts
- Supported nuts and settings
- P2PK
Witness - P2Pk Witness
- Payment
Request - Payment Request
- Payment
Request Builder - Builder for PaymentRequest
- Payment
Request Payload - Payment Request
- PreMint
- PreMint
- PreMint
Secrets - Premint Secrets
- PreSwap
- Preswap information
- Proof
- Proofs
- Proof
Dleq - Proof Dleq
- Proof
State - Proof state [NUT-07]
- Protected
Endpoint - List of the methods and paths that are protected
- Public
Key - PublicKey
- Restore
Request - Restore Request [NUT-09]
- Restore
Response - Restore Response [NUT-09]
- Secret
Data - Secert Date
- Secret
Key - SecretKey
- Swap
Request - Swap Request [NUT-03]
- Swap
Response - Split Response [NUT-06]
- TokenV3
- Token
- TokenV4
- Token V4
- Transport
- Transport
- Transport
Builder - Builder for Transport
Enums§
- Auth
Required - Required Auth
- Auth
Token - Auth Token
- Currency
Unit - Currency Unit
- Kind
- NUT10 Secret Kind
- Melt
Options - Melt Options
- Melt
Quote State - Possible states of a quote
- Method
- HTTP method
- Mint
Quote State - Possible states of a quote
- Notification
Payload - Subscription response
- Payment
Method - Payment Method
- Route
Path - Route path
- SigFlag
- Signature flag
- Spending
Conditions - Spending Conditions
- State
- State of Proof
- Token
- Token Enum
- Transport
Type - Transport Type
- Witness
- Witness
Statics§
- SECP256
K1 - Secp256k1 global context
Traits§
- Proofs
Methods - Utility methods for Proofs