- Rust 97.2%
- Shell 1%
- Nix 0.8%
- Just 0.4%
- Python 0.4%
|
Some checks failed
Nutshell integration / Nutshell Mint Integration Tests (push) Failing after 30s
Nutshell integration / Nutshell Wallet Integration Tests (push) Failing after 28s
CI / Discover examples (push) Successful in 1m45s
CI / Cargo fmt, typos (push) Successful in 1m49s
CI / Discover checks (push) Successful in 1m2s
CI / Discover MSRV checks (push) Successful in 1m39s
CI / Discover WASM checks (push) Successful in 1m23s
CI / Build integration test binaries (push) Has been cancelled
CI / PostgreSQL Tests (push) Has been cancelled
CI / Quick Check (lint, clippy, unit tests) (push) Has been cancelled
CI / Supabase Tests (push) Has been cancelled
CI / Integration regtest tests (push) Has been cancelled
CI / Integration regtest tests-1 (push) Has been cancelled
CI / Integration regtest Onchain tests (push) Has been cancelled
CI / Integration regtest Onchain tests-1 (push) Has been cancelled
CI / Integration fake mint tests (push) Has been cancelled
CI / Integration fake mint tests-1 (push) Has been cancelled
CI / Integration fake wallet tests (push) Has been cancelled
CI / Integration fake wallet tests-1 (push) Has been cancelled
CI / Integration fake wallet tests-2 (push) Has been cancelled
CI / Payment processor tests (push) Has been cancelled
CI / Payment processor tests-1 (push) Has been cancelled
CI / Payment processor tests-2 (push) Has been cancelled
CI / Integration fake mint auth tests (push) Has been cancelled
CI / Documentation tests (push) Has been cancelled
CI / Strict Documentation Check (push) Has been cancelled
CI / FFI Python tests (push) Has been cancelled
CI / Code Coverage (push) Has been cancelled
CI / Dart binding tests (push) Has been cancelled
CI / Kotlin binding tests (push) Has been cancelled
CI / Go binding tests (push) Has been cancelled
CI / Swift binding tests (push) Has been cancelled
CI / Example: example-melt-token (example-melt-token) (push) Has been cancelled
CI / Example: example-mint-token (example-mint-token) (push) Has been cancelled
CI / Example: example-p2pk (example-p2pk) (push) Has been cancelled
CI / Example: example-proof-selection (example-proof-selection) (push) Has been cancelled
CI / Example: example-wallet (example-wallet) (push) Has been cancelled
CI / Check: core-lib (core-lib) (push) Has been cancelled
CI / Check: lightning-and-api (lightning-and-api) (push) Has been cancelled
CI / Check: mintd-backends-postgres (mintd-backends-postgres) (push) Has been cancelled
CI / Check: mintd-backends-sqlite (mintd-backends-sqlite) (push) Has been cancelled
CI / Check: mintd-main (mintd-main) (push) Has been cancelled
CI / Check: storage-and-cli (storage-and-cli) (push) Has been cancelled
CI / MSRV: msrv-cdk-all-features (msrv-cdk-all-features) (push) Has been cancelled
CI / MSRV: msrv-cdk-cli (msrv-cdk-cli) (push) Has been cancelled
CI / MSRV: msrv-cdk-mintd-all (msrv-cdk-mintd-all) (push) Has been cancelled
CI / MSRV: msrv-cdk-wallet-only (msrv-cdk-wallet-only) (push) Has been cancelled
CI / WASM: wasm-cdk (wasm-cdk) (push) Has been cancelled
CI / WASM: wasm-cdk-no-default (wasm-cdk-no-default) (push) Has been cancelled
CI / WASM: wasm-cdk-wallet (wasm-cdk-wallet) (push) Has been cancelled
|
||
|---|---|---|
| .cargo | ||
| .github | ||
| .helix | ||
| bindings | ||
| crates | ||
| docs/migrations | ||
| fuzz | ||
| meetings | ||
| misc | ||
| nix | ||
| tor | ||
| .backportrc.json | ||
| .cargo-mutants.toml | ||
| .envrc | ||
| .gitignore | ||
| .typos.toml | ||
| AGENTS.md | ||
| Cargo.lock | ||
| Cargo.lock.msrv | ||
| Cargo.toml | ||
| CHANGELOG.md | ||
| clippy.toml | ||
| CODE_STYLE.md | ||
| codecov.yml | ||
| DEVELOPMENT.md | ||
| docker-compose.ldk-node.yaml | ||
| docker-compose.postgres.yaml | ||
| docker-compose.redis-cluster.yaml | ||
| docker-compose.tor.yaml | ||
| docker-compose.yaml | ||
| Dockerfile | ||
| Dockerfile.arm | ||
| Dockerfile.ldk-node | ||
| Dockerfile.ldk-node.arm | ||
| Dockerfile.static | ||
| flake.lock | ||
| flake.nix | ||
| justfile | ||
| LICENSE | ||
| README.md | ||
| REGTEST_GUIDE.md | ||
| rust-toolchain.toml | ||
| rustfmt.toml | ||
| SECURITY.md | ||
Warning
This project is in early development, it does however work with real sats! Always use amounts you don't mind losing.
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-lnbits: LNbits Lightning backend for mint. Note: Only LNBits v1 API is supported.
- cdk-ldk-node: LDK Node Lightning backend for mint.
- cdk-bdk: Onchain Bitcoin backend using BDK.
- cdk-fake-wallet: Fake Lightning 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.
- cdk-prometheus: Prometheus metrics integration.
- cdk-npubcash: npub.cash SDK integration.
- 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:
- cdk-cli: Cashu wallet CLI.
- cdk-mintd: Cashu Mint Binary.
- cdk-mint-cli: Cashu Mint management gRPC client cli.
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 under the MIT License
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.