Skip to content

Latest commit

 

History

2,607 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Warning

This project is in early development, it does however work with real sats! Always use amounts you don't mind losing.

crates.io Documentation License

Cashu Development Kit

CDK is a collection of rust crates for Cashu wallets and mints written in Rust.

ALPHA This library is in early development, the api will change and should be used with caution.

Quick Start

CDK uses Nix flakes to manage development environments. We provide a lean default shell for standard development and a full-stack shell for integration testing.

# Enter the lean development shell (Rust + PostgreSQL)
nix develop

# OR enter the full regtest environment (Bitcoind + Lightning Nodes)
nix develop .#regtest

For more details on available environments, see the Development Guide.

Project structure

The project is split up into several crates in the crates/ directory:

  • Libraries:
    • cashu: Core Cashu protocol implementation.
    • cdk: Rust implementation of Cashu protocol.
    • cdk-http-client: HTTP client abstraction for wallet-to-mint communication.
    • cdk-sqlite: SQLite Storage backend.
    • cdk-postgres: PostgreSQL Storage backend.
    • cdk-redb: Redb Storage backend.
    • cdk-supabase: Supabase Storage backend.
    • cdk-axum: Axum webserver for mint.
    • cdk-cln: CLN Lightning backend for mint.
    • cdk-lnd: Lnd Lightning backend for mint.
    • cdk-ldk-node: LDK Node Lightning backend for mint.
    • cdk-bdk: Onchain Bitcoin backend using BDK.
    • cdk-fake-wallet: Fake payment backend for mint. To be used only for testing, quotes are automatically filled.
    • cdk-common: Common utilities and shared code.
    • cdk-sql-common: Common SQL utilities for storage backends.
    • cdk-signatory: Signing utilities and cryptographic operations.
    • cdk-payment-processor: Payment processing functionality; LNbits integrations should use an external payment processor.
    • cdk-prometheus: Prometheus metrics integration.
    • cdk-nostr: Nostr integration — keys, NIP-44 encryption, NIP-17 inbox listener, NIP-47 wallet service, npub.cash SDK.
    • cdk-ffi: Foreign Function Interface bindings for other languages.
    • cdk-integration-tests: Integration test suite.
    • cdk-mint-rpc: Mint management gRPC server and cli.
  • Binaries:

Implemented NUTs:

Mandatory

NUT # Description
00 Cryptography and Models
01 Mint public keys
02 Keysets and fees
03 Swapping tokens
04 Minting tokens
05 Melting tokens
06 Mint info

Optional

# Description Status
07 Token state check ✔️
08 Overpaid Lightning fees ✔️
09 Signature restore ✔️
10 Spending conditions ✔️
11 Pay-To-Pubkey (P2PK) ✔️
12 DLEQ proofs ✔️
13 Deterministic secrets ✔️
14 Hashed Timelock Contracts (HTLCs) ✔️
15 Partial multi-path payments (MPP) ✔️
16 Animated QR codes ✔️
17 WebSocket subscriptions ✔️
18 Payment Requests ✔️
19 Cached responses ✔️
20 Signature on Mint Quote ✔️
21 Clear Authentication ✔️
22 Blind Authentication ✔️
23 Payment Method: BOLT11 ✔️
25 Payment Method: BOLT12 ✔️
26 Payment Request Bech32m Encoding ✔️
27 Nostr Mint Backup ✔️
28 Pay to Blinded Key (P2BK) ✔️
29 Batch Mint Tokens ✔️
30 Payment Method: onchain ✔️

License

Code is licensed under either the Apache License 2.0 or the MIT License, at your option. See LICENSE.md for details.

Contribution

All contributions are welcome.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, shall be licensed as above, without any additional terms or conditions.

Please see the development guide.

About

Cashu Development Kit

Resources

Security policy

Stars

229 stars

Watchers

8 watching

Forks

Releases

Used by

Contributors

Languages