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

outputs constructed when doing split can tell mint the intended payment amount vs change #54

Open
elnosh opened this issue Sep 29, 2023 · 0 comments

Comments

@elnosh
Copy link
Contributor

elnosh commented Sep 29, 2023

When sending from wallet, the way outputs are constructed in the request for /split they could be telling the mint which is the intended payment amount vs which is the change.

Code in wallet constructing output

	total := SumProofs(proofs)
	frstAmt := total - amount
	scndAmt := amount
	frstOutputs := mint.AmountSplit(frstAmt)
	scndOutputs := mint.AmountSplit(scndAmt)
	amounts := append(frstOutputs, scndOutputs...)

So if user has a balance of 100 and tries a send 20 the output amounts when requesting a split to the mint could look like [16, 64, 4, 16]

Describe the solution you'd like
Maybe sort the outputs slice before sending request to mint.

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

1 participant