NUT-06: Deprecate amount
in POST /split
#34
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.
The
amount
field inPOST /split
was an unnecessary contraint on the split operation. Now, wallets can choose the amount distribitions of the inputs (proofs) and outputs (and thus returned promises) as they wish, as long as they sum up to the same value.Closes #32
Changes:
Wallets:
Wallets simply don't send the
amount
field with thePOST /split
request anymore. They receive a new object with the fieldpromises
from which they then need to separate the promises to keep (first elements) and send (last elements).Previously, they took these two sets of elements from the fields
fst
andsnd
from the response. This is no longer the case! Note that wallets already should know how many elements of thepromises
response they need to slice to get the same as thefst
andsnd
responses because they have previously generated an array ofoutputs
that has the same distribution.Mints:
Mints now do no receive an
amount
field anymore. They can simply proceed as usual but remove any security checks that might have previously asserted that the distribution of amounts ofoutputs
must adhere to a certain pattern (for example perfectly decompose in powers of two). This is not necessary anymore. They MUST still check whether the sum ofproofs
is equal to the sum ofoutputs
and they SHOULD also check whether it equals the sum of generatedpromises
(as a sanity check).PostSplitRequest
Before:
Now:
PostSplitResponse
Before:
Now:
Testing:
For wallet development, use this Nutshell testnut mint that runs on the branch
nut06/no_amount_in_split
https://nut06.testnut.cashu.space
Tracking progress of NUT-06 update (please report):
Mints
Wallets
Ping: @BilligsterUser @gandlafbtc @clarkmoody @ngutech21 @gohumble @thesimplekid @KKA11010 @thunderbiscuit