2 months ago
pablof7z
e2047927

README.md

Nutsack - Modern Cashu Wallet for iOS

Nutsack LogoPlatform


Swift


NDKSwift


CashuSwift


License

Overview

Nutsack is a modern Cashu ecash wallet for iOS that integrates seamlessly with Nostr, implementing NIP-60 (wallet data) and NIP-61 (nutzaps). It provides a beautiful, native iOS experience for managing ecash with full backup and social payment capabilities.

Features

🏦 Core Wallet Features

  • Multi-Mint Support: Connect to multiple Cashu mints for improved reliability

  • Lightning Integration: Mint ecash from Lightning invoices and melt back to Lightning

  • Send & Receive: Share ecash tokens via QR codes, text, or Nostr

  • Real-time Balance: Live balance updates with fiat conversion (USD, EUR, BTC)

  • Transaction History: Comprehensive tracking of all ecash movements

  • Proof Management: View, select, and manage individual ecash proofs

  • DLEQ Verification: Automatic verification of mint signatures for enhanced security

⚡ Nostr Integration

  • Nostr Authentication: Login with nsec or create new Nostr account

  • NIP-60 Backup: Automatic wallet backup to Nostr relays

  • NIP-61 Nutzaps: Zap other Nostr users with ecash

  • Contact Integration: See your Nostr follows and zap them easily

  • Multi-Relay Support: Connect to multiple Nostr relays with health monitoring

  • Mint Discovery: Find new mints through NIP-38000 announcements

🎨 UI/UX Features

  • Beautiful Dark Theme: Elegant design with glassmorphic effects

  • Native iOS Feel: Built with SwiftUI for smooth, native performance

  • QR Code Scanner: Scan ecash tokens, Lightning invoices, and mint URLs

  • Intuitive Navigation: Tab-based interface with clear actions

  • Real-time Updates: Live balance updates and transaction notifications

  • Pie Chart Visualization: Visual breakdown of balance across mints

  • Smooth Animations: Delightful animations for payments and interactions

🔒 Security Features

  • Biometric Lock: Protect your wallet with Face ID/Touch ID

  • Encrypted Storage: Local key storage with encryption

  • Mint Blacklisting: Block untrusted mints

  • Token Validation: Automatic validation of received tokens

  • Relay Health Monitoring: Track relay connection status

Architecture

The app is built using modern iOS technologies:

  • SwiftUI for the declarative UI layer

  • SwiftData for local persistence

  • NDKSwift for Nostr protocol integration

  • CashuSwift for Cashu protocol operations

  • Combine for reactive programming

Key Components

  1. WalletManager: Core wallet operations and state management

  2. NostrManager: Handles all Nostr operations including authentication and event publishing

  3. MintDiscoveryManager: Discovers and manages Cashu mints

  4. WalletDataSources: Reactive data sources for UI updates

  5. AppState: Global app state and user preferences

Requirements

  • iOS 17.0+

  • Xcode 15.0+

  • Swift 5.9+

Installation

Building from Source

  1. Clone the repository:

git clone https://github.com/pablof7z/Nutsack.git
cd Nutsack
  1. Install XcodeGen if you haven't already:

brew install xcodegen
  1. Generate the Xcode project:

./refresh-project.sh
  1. Open the project in Xcode:

open NutsackiOS.xcodeproj
  1. Build and run the project on your device or simulator

TestFlight

Coming soon! We'll be releasing Nutsack on TestFlight for beta testing.

Development

Building

# Refresh project after file changes
./refresh-project.sh

# Build with clean output
./build.sh

# Build for specific device
DESTINATION="platform=iOS Simulator,name=iPhone 16 Pro" ./build.sh

Testing

The project includes comprehensive Maestro UI tests:

# Run all tests
maestro test maestro-tests/

# Run specific test
maestro test maestro-tests/01-onboarding.yaml

Deploying to TestFlight

./deploy.sh

Configuration

Default Mints

The app comes pre-configured with trusted mints. Users can add their own mints via:

  • Scanning mint QR codes

  • Entering mint URLs manually

  • Discovering mints through Nostr

Relay Configuration

Default relays are configured for optimal performance. Users can customize relays in Settings.

Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

  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

Testing

The app includes comprehensive test coverage:

  • Unit tests for wallet operations

  • UI tests using Maestro

  • Integration tests for Nostr functionality

Run tests with:

swift test

Security

  • Private keys are encrypted and stored locally

  • All Nostr communications use standard encryption

  • Ecash tokens are validated before acceptance

  • Mint trust is explicit and user-controlled

  • Regular security audits are performed

Roadmap

  • [ ] Multi-language support

  • [ ] Backup/restore from seed phrase

  • [ ] Push notifications for received payments

  • [ ] Widget support for balance display

  • [ ] WalletConnect integration

  • [ ] Hardware wallet support

  • [ ] Tor support for enhanced privacy

License

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

Acknowledgments

Contact

  • Nostr: npub1l2vyh47mk2p0qlsku7hg0vn29faehy9hy34ygaclpn66ukqp3afqutajft

  • GitHub: @pablof7z


Made with 🥜 for the ecash future

Repository Details

name / identifier

nutsack

nostr clone url

nostr://_@f7z.io/nutsack
just install ngit and run
git clone nostr://...

description

nutsack + nutsack-cli / NIP-60 wallet, NIP-61 and onion-routing event publish

grasp servers

none

git servers

https://github.com/pablof7z/nutsack.git

maintainers

earliest unique commit

2e6839b2949369c09faffe865111f051422ead9f

gitworkshop.dev logo GitWorkshop.dev