Skip to content

Cairo verification working#1

Merged
YofiY merged 8 commits intofeature/spending-conditionsfrom
downg-cairo
Jul 30, 2025
Merged

Cairo verification working#1
YofiY merged 8 commits intofeature/spending-conditionsfrom
downg-cairo

Conversation

@vincentpalma
Copy link

Cairo/stwo verification logic working.

Next steps

  • Work on Nut10Secret format (need to be able to verify program hash) and Conditions.
  • Draft a complete spec in https://github.com/clealabs/nuts/.
  • Adapt the mint for our new SpendingConditions kind (look at the TODOs in the mint code).
  • Implement prover in wallet.

YofiY and others added 8 commits July 26, 2025 16:14
TODO: the test doesnt compile because the under nutxx/example_proof.json was created using the package cairo-prove, which at the latest version still uses an old version of stwo_cairo_prover and stwo_cairo_verifier, but in the project we use the more recent version (we use commit 335de15 but cairo-prove uses commit 62c3c4a). There are two option: 1. modify our project to use older packages 62c3c4a or 2. fork cairo-prove and update the packages to the latest version. I think option 2 would be better since the verify_cairo function doesn't require a PcsConfig in the newer version, which makes things cleaner to use in cashu
@vincentpalma vincentpalma requested a review from YofiY July 30, 2025 00:17

let secret: Secret = Nut10Secret::new(
Kind::Cairo,
"PROGRAM_HASH_TODO".to_string(),
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here needs to be a hash of the program (Felt type probably)

Some(Witness::CairoWitness(witness)) => witness,
_ => return Err(Error::IncorrectSecretKind),
};

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: here we also need to verify that the what the witness (Cairo proof) claims to prove match with the program hash in the secret data

@YofiY YofiY merged commit 7cd392c into feature/spending-conditions Jul 30, 2025
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.

2 participants