Skip to content

Feature/cairo spending conditions#1

Open
YofiY wants to merge 5 commits intomainfrom
feature/cairo-spending-conditions
Open

Feature/cairo spending conditions#1
YofiY wants to merge 5 commits intomainfrom
feature/cairo-spending-conditions

Conversation

@YofiY
Copy link
Collaborator

@YofiY YofiY commented Sep 7, 2025

Description

This PR implements Cairo spending conditions as specified in NUTXX for the cashu.me web wallet, enabling privacy-preserving arbitrary spending conditions through zero-knowledge proofs.

Features:

  • Sending Cairo-locked tokens:

    • Cairo spending condition dialog UI (CairoDialog.vue)
    • Integration with existing token sending workflow
    • Cairo executable and expected output input handling
    • State management through dedicated Cairo store (cairo.ts)
  • Receiving Cairo-locked tokens:

    • Cairo receive dialog with proof generation (CairoReceiveDialog.vue)
    • Integration of WASM64 compiled stwo-cairo prover
    • Enhanced token receiving workflow with Cairo proof handling, analagous to the receiving workflow for P2PK locked tokens
  • other:

    • Cross-origin isolation headers in nginx configuration
    • Browser compatibility checks.
    • Quasar configuration updates for WASM support
    • Unit tests for Cairo functionality

Note to the reader

…ility

Completely redesigned the Cairo token experience to be more intuitive and user-friendly:

• Remove manual Cairo button - tokens now automatically trigger unlock dialog when Cairo secrets are detected
• Redesign Cairo receive dialog with modern styling, better organization, and professional loading animations
• Improve Cairo send interface with structured inputs, icons, and consistent visual design
• Add comprehensive browser compatibility detection for Cairo prover support:
  - macOS (Intel/ARM): Firefox 142+
  - Windows/Linux x64: Firefox 142+ or Chrome 140+
• Add file upload support for executable.json files in both send and receive flows
• Streamline user workflow - paste any token and system automatically handles Cairo unlock when needed
• Enhanced visual feedback with animated proving states and clear compatibility indicators

The new flow eliminates confusion by automatically detecting Cairo tokens and guiding users through the unlock process.
Updates the Cairo implementation with improved browser compatibility detection
and better user experience for proving workflows. Also adds cross-origin
isolation headers required for Cairo WASM workers to function properly.

Changes:
- Add browser detection for Cairo prover compatibility (Firefox 142+, Chrome 140+)
- Update Cairo receive dialog with enhanced UI and file upload capabilities
- Improve automatic token detection to handle Cairo locked tokens seamlessly
- Configure cross-origin isolation headers for development and production
- Update dependencies and build configuration for Cairo WASM support
- Add comprehensive browser compatibility messaging and debug tools

The Cairo prover now works more reliably across different browsers and
provides clear feedback when compatibility issues are detected.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant