Skip to content

hvmelo/cashu_app

Repository files navigation

Cashu Wallet

Cashu Logo

A reference implementation of a mobile wallet for the Cashu protocol - private, secure ecash for Bitcoin.

What is Cashu?

Cashu is a privacy-focused ecash protocol for Bitcoin that enables:

  • Private transactions: Using blind signatures to ensure the mint cannot track who is spending tokens
  • Offline payments: Send and receive payments without requiring an internet connection
  • Programmable money: Support for script conditions like time locks, public key locks, and more
  • Lightning Network integration: Seamless interoperability with the Lightning Network

Features

  • 🔒 Private Transactions: Send and receive Cashu tokens with complete privacy
  • Lightning Network Support: Deposit and withdraw using Lightning Network
  • 🌐 Multi-Mint Support: Connect to multiple mints to distribute trust
  • 🔄 Transaction History: View your complete transaction history
  • 🌙 Dark Mode: Toggle between light and dark themes
  • 🌍 Internationalization: Supports multiple languages (currently English and Spanish)
  • 📱 Cross-Platform: Built with Flutter for iOS and Android

Screenshots

Coming soon

Getting Started

Prerequisites

  • Flutter SDK (>=3.0.0)
  • Dart SDK (>=3.0.0)
  • Android Studio / Xcode for mobile development

Installation

  1. Clone the repository:
git clone https://github.com/hvmelo/cashu_app.git
cd cashu_app
  1. Install dependencies:
flutter pub get
  1. Generate code for Riverpod providers, Freezed models, and other generated files:
# Clean any previous build artifacts
dart run build_runner clean

# Generate code with build_runner
dart run build_runner build --delete-conflicting-outputs
  1. Generate localization files:
flutter gen-l10n
  1. Run the app:
# Development environment
flutter run --flavor development --target lib/main_development.dart

# Staging environment (uses a real mint)
flutter run --flavor staging --target lib/main_staging.dart

Building for Release

To build a release version of the app:

# Android
flutter build apk --flavor development --target lib/main_development.dart
flutter build apk --flavor staging --target lib/main_staging.dart

# iOS
flutter build ios --flavor development --target lib/main_development.dart
flutter build ios --flavor staging --target lib/main_staging.dart

Project Structure

lib/
├── config/         # App configuration and providers
├── data/           # Data layer with repositories
├── domain/         # Domain models and use cases
├── routing/        # App routing
├── ui/
│   ├── core/       # Core UI components, themes, and localization
│   ├── home/       # Home screen and related widgets
│   ├── mint/       # Mint-related screens and widgets
│   └── mint_manager/ # Mint management screens and widgets
├── utils/          # Utility classes and functions
└── main.dart       # App entry point

Development

Code Generation

The project uses several code generation tools:

  • Riverpod: For state management and dependency injection
  • Freezed: For immutable models
  • JSON Serializable: For JSON serialization/deserialization

After making changes to files with annotations, run:

dart run build_runner build --delete-conflicting-outputs

Build Modes

The app supports different build configurations:

Localization

The app supports multiple languages. To add a new language:

  1. Create a new ARB file in lib/ui/core/l10n/
  2. Run the localization generator:
flutter gen-l10n

Troubleshooting

Common Issues

  • Build failures after updating dependencies: Try cleaning the project and regenerating code:

    flutter clean
    dart run build_runner clean
    dart run build_runner build --delete-conflicting-outputs
  • Missing generated files: Ensure you've run the build_runner:

    dart run build_runner build --delete-conflicting-outputs

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

About

A reference app for Cashu

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors