Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Comments

[NUT-XX] Compact Nut Filters#261

Draft
a1denvalu3 wants to merge 26 commits intocashubtc:mainfrom
a1denvalu3:gcs-filter
Draft

[NUT-XX] Compact Nut Filters#261
a1denvalu3 wants to merge 26 commits intocashubtc:mainfrom
a1denvalu3:gcs-filter

Conversation

@a1denvalu3
Copy link
Contributor

@a1denvalu3 a1denvalu3 commented May 14, 2025

Golomb-Coded Set Filters provide a compressed data structure for testing set membership.

Wallets can fetch GET v1/filter/spent and download the compressed set, then check to see if the ecash notes they have belong in the set (and thus are spent).

This drastically improves privacy in some cases:

  • During recovery from seed phrase.
  • After a cold-start, wallets might be checking the state of pending (sent) ecash in bulk.

@prusnak
Copy link
Collaborator

prusnak commented May 16, 2025

IIRC the GCS filters have:

  • no false negatives
  • false positives

This is fine for BIP158 blockfilters (the worst that can happen is that you download a block which is not relevant for you).

If I understand this correctly, this can be catastrophic for what you are trying to achieve here, right? False positive will mark the note as spent even though it is unspent.

Or do you suggest to use the filter to identify "surely unspent" (unmatched by GCS) notes and then query only the ones that have been "possibly spent" (all matches by GCS)? This would work. But if that is the case then this is not clear from the text or I missed it.

@a1denvalu3
Copy link
Contributor Author

a1denvalu3 commented May 16, 2025

Or do you suggest to use the filter to identify "surely unspent" (unmatched by GCS) notes and then query only the ones that have been "possibly spent" (all matches by GCS)?

Yes that's the idea. Unmatched notes are surely unspent and matched notes are possibly spent with probability $p = 1 - 1/m$. So the client has to decide whether the FPS is acceptable or query the "possibly spent" ecash for confirmation. This is only meant for client side use, so the Mint still relies on the DB to decide whether to accept notes in the redemption.

@a1denvalu3
Copy link
Contributor Author

@prusnak how would you change it to make it clearer?

@a1denvalu3 a1denvalu3 changed the title [NUT-XX] Golomb-Coded Set Filters [NUT-XX] Compact Nut Filters Jul 5, 2025
@a1denvalu3 a1denvalu3 marked this pull request as draft August 19, 2025 13:25
@a1denvalu3 a1denvalu3 marked this pull request as ready for review August 19, 2025 13:25
@a1denvalu3 a1denvalu3 marked this pull request as draft September 11, 2025 08:26
@ye0man ye0man added this to nuts Jan 13, 2026
@github-project-automation github-project-automation bot moved this to Backlog in nuts Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants