Spending Conditions implementation is placed in nut11 instead of NUT-10 module #1705

Open
opened 2026-03-05 22:07:04 +00:00 by TheMhv · 2 comments
TheMhv commented 2026-03-05 22:07:04 +00:00 (Migrated from github.com)

While reading the code of the spending conditions implementation inside the cashu crate, I noticed that the implementation is currently located in nut11/mod.rs.

However, spending conditions are defined in NUT-10, not NUT-11. Because of that, it seems the implementation might be misplaced in the current module structure.

This could potentially make the codebase a bit confusing for contributors trying to understand which NUT specification each module corresponds to.

It might make more sense for this implementation to live under a nut10 module, instead of nut11.

github.com/cashubtc/cdk@4aa305ba03/crates/cashu/src/nuts/nut11/mod.rs (L318-L322)

While reading the code of the spending conditions implementation inside the `cashu` crate, I noticed that the implementation is currently located in `nut11/mod.rs`. However, spending conditions are defined in **NUT-10**, not **NUT-11**. Because of that, it seems the implementation might be misplaced in the current module structure. This could potentially make the codebase a bit confusing for contributors trying to understand which NUT specification each module corresponds to. It might make more sense for this implementation to live under a `nut10` module, instead of `nut11`. https://github.com/cashubtc/cdk/blob/4aa305ba03dc3dc5244b7408684d59bd5b4f12bc/crates/cashu/src/nuts/nut11/mod.rs#L318-L322
thesimplekid commented 2026-03-06 08:35:54 +00:00 (Migrated from github.com)

I think this was like this because we used to feature flag each nut. But I am fine with moving it if you would like to open an PR.

I think this was like this because we used to feature flag each nut. But I am fine with moving it if you would like to open an PR.
TheMhv commented 2026-03-06 13:41:55 +00:00 (Migrated from github.com)

I think this was like this because we used to feature flag each nut. But I am fine with moving it if you would like to open an PR.

Sure! I'll do that.

Can you assign me to this issue?

> I think this was like this because we used to feature flag each nut. But I am fine with moving it if you would like to open an PR. Sure! I'll do that. Can you assign me to this issue?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cashubtc/cdk#1705
No description provided.