Cashu Development Kit

C 15e10c0e90 Merge pull request #730 from crodas/fix/race-condition-state-update 1 روز پیش
.config e2041d3928 chore: flakebox install 7 ماه پیش
.github 7fbe55ea02 Test fees (#698) 3 هفته پیش
.helix 47ee54d7f5 feat: mint management rpc server and client cli 2 ماه پیش
LICENSES 5f2fd0bbc5 chore: rename for CDK 1 سال پیش
crates 15e10c0e90 Merge pull request #730 from crodas/fix/race-condition-state-update 1 روز پیش
misc 7fbe55ea02 Test fees (#698) 3 هفته پیش
.envrc bf5ea01c1f improve: nix flakebox fmt 1 سال پیش
.gitignore be93ff2384 Clear and Blind Auth (#510) 1 ماه پیش
.typos.toml be93ff2384 Clear and Blind Auth (#510) 1 ماه پیش
CHANGELOG.md 96179b7d14 chore: Bump CDK crates version from 0.8.1 to 0.9.0 2 هفته پیش
CODE_STYLE.md 4c2cb78327 chore: update CODE_STYLE 1 سال پیش
Cargo.toml 96179b7d14 chore: Bump CDK crates version from 0.8.1 to 0.9.0 2 هفته پیش
DEVELOPMENT.md 5df983c388 chore: fix typo in DEVELOPMENT.md (#720) 2 هفته پیش
Dockerfile dcca57dbd1 Introduce pluggable backend cache for the HTTP layer. (#495) 4 ماه پیش
LICENSE 5f2fd0bbc5 chore: rename for CDK 1 سال پیش
README.md db067a145d docs: Add README.md for cdk-mint-rpc crate (#717) 2 هفته پیش
SECURITY.md f0579071c1 release: v0.1.0 9 ماه پیش
docker-compose.yaml dcca57dbd1 Introduce pluggable backend cache for the HTTP layer. (#495) 4 ماه پیش
flake.lock 06a3237977 chore: update stable rust to 1.86.0 2 روز پیش
flake.nix 06a3237977 chore: update stable rust to 1.86.0 2 روز پیش
justfile 7fbe55ea02 Test fees (#698) 3 هفته پیش
rust-toolchain.toml 06a3237977 chore: update stable rust to 1.86.0 2 روز پیش
rustfmt.toml d46d4c5bd8 chore: rust fmt 5 ماه پیش

README.md

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

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.

Project structure

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

  • Libraries:
    • cdk: Rust implementation of Cashu protocol.
    • cdk-sqlite: SQLite Storage backend.
    • cdk-redb: Redb Storage backend.
    • cdk-rexie: Rexie Storage backend for browsers.
    • 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.
    • cdk-fake-wallet: Fake Lightning backend for mint. To be used only for testing, quotes are automatically filled.
    • cdk-mint-rpc: Mint management gRPC server and cli.
  • Binaries:

Development

For a guide to settings up a development environment see DEVELOPMENT.md

Code Style Guidelines

  • Large Enum Variants: When an enum variant contains a large type (>100 bytes), box it using Box<T> to reduce the overall enum size. This improves memory efficiency, especially for error types.

    // Instead of this:
    enum Error {
      SomeLargeError(LargeType),  // LargeType is >100 bytes
    }
      
    // Do this:
    enum Error {
      SomeLargeError(Box<LargeType>),
    }
    

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 :heavy_check_mark:
08 Overpaid Lightning fees :heavy_check_mark:
09 Signature restore :heavy_check_mark:
10 Spending conditions :heavy_check_mark:
11 Pay-To-Pubkey (P2PK) :heavy_check_mark:
12 DLEQ proofs :heavy_check_mark:
13 Deterministic secrets :heavy_check_mark:
14 Hashed Timelock Contracts (HTLCs) :heavy_check_mark:
15 Partial multi-path payments (MPP) :heavy_check_mark:
16 Animated QR codes :x:
17 WebSocket subscriptions :heavy_check_mark:
18 Payment Requests :heavy_check_mark:
19 Cached responses :heavy_check_mark:
20 Signature on Mint Quote :heavy_check_mark:
[21][21] Clear Authentication :heavy_check_mark:
[22][22] Blind Authentication :heavy_check_mark:

Bindings

Experimental JS bindings can be found in the bindings repository.

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.