Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sorting webcash in wallet to enable effecient consolidation #39

Open
xorson opened this issue Jul 6, 2022 · 3 comments
Open

Sorting webcash in wallet to enable effecient consolidation #39

xorson opened this issue Jul 6, 2022 · 3 comments

Comments

@xorson
Copy link

xorson commented Jul 6, 2022

Does it make sense to auto-sort webcash secrets in the wallet?
This mimics real life behaviour where you use up small denoms for any transaction before dipping into bigger denoms.
Currently the wallet searches for exact value or consolidates top of stack, irrespective of value.

I have an implementation and PR available to be merged.

@kanzure
Copy link
Owner

kanzure commented Jul 6, 2022

"Random" was found to be a somewhat good coin selection algorithm for bitcoin. Random sort (or rather, random choice) could work. Originally when I made the reference wallet software, I decided against random choice because at the time there was no deterministic wallet, and it would be better to let wallet backups keep the majority of existing outputs with some sense of rotation over time corresponding to wallet backup rotation itself. Maybe picking the smallest outputs would have been ideal at that time to help preserve backups of larger value outputs

By picking smaller denomination outputs before larger denomination outputs, the wallet could become easily exhausted of small denomination outputs, leaving only a single larger denomination output. In the asymptotic case, this turns into a wallet that has a single output and after each payment also has only a single output (leftover change). From a privacy perspective, this is not ideal.

On the other hand, output consolidation helps the server and the wallets.

It's tricky.

@xorson
Copy link
Author

xorson commented Jul 6, 2022

the motivation was sever/wallet, but privacy is a good pt. I will close this issue as most likely such feature can be implemented by a wallet client serving a specific need.

@xorson xorson closed this as completed Jul 6, 2022
@kanzure
Copy link
Owner

kanzure commented Jul 6, 2022

It's a reasonable issue worthy of discussion.

@kanzure kanzure reopened this Jul 6, 2022
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

No branches or pull requests

2 participants