mix inputs with highest number of rounds first #1248
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently we are mixing like this (imagine columns are number of rounds and we mix simple input, for simplicity sake, and inputs are selected in some order (which is not the case, we randomize them and even drop some to break possible patterns)):
and so on until finally we get to
nPrivateSendRounds
round (N, M=N-1):NMMMMMMMM
This is the first time user will finally see smth in his Private balance (input with N rounds).
What I'm proposing is changing this scheme to:
and so on.
This way user will see (and will be able to use) mixed funds much earlier.
One thing to note is that together with multi-session option this scheme actually morphs into a mixed one because we don't use non-confirmed inputs for mixing. Smth like this:
and so on. This way user will be able to get even more private funds faster.
I was thinking about it for a while and wasn't able to find any reasonable arguments why this could not work or why this would defeat/leak some privacy. Suggestions and possible attack vector ideas are highly welcome.