Proposing to add fees to the mandatory part of the spec as I expect most public mints will require fees at some point. If the fees are not set, we should assume it as being 0.
Moved around some existing text. The new part is:
Fees (parts per thousand)
Keysets indicate the fee input_fee_ppk that is charged when a Proof of that keyset is spent as an input to a transaction. The fee is given in parts per thousand (ppk) per input measured in the unit of the keyset and the sum is rounded up to the next larger integer.
As an example, we construct a transaction spending 3 inputs (Proofs) from a keyset with unit sat and input_fee_ppk of 100. A fee of 100 ppk means 0.1 sat per input. The sum of the fees would be 300 ppk for this transaction and the mint would charge 1 sat in fees (ceil(0.3) == 1). The fees for spending 1-10 inputs is 1 sat, 11-20 inputs is 2 sat and so on.
...
Wallet input and output construction
When constructing a transaction with ecash inputs (example: /v1/swap or /v1/melt), wallets MUST add fees to the inputs (or subtract from the outputs) if they spent ecash from a keyset with fees. The mint checks the following equation:
sum(inputs) - sum(fees) == sum(outputs)
The fees are calculated for each input individually (by summing the fee from the keyset they are from) and then rounded up to the next integer.
Proposing to add fees to the mandatory part of the spec as I expect most public mints will require fees at some point. If the fees are not set, we should assume it as being 0.
Moved around some existing text. The new part is:
Fees (parts per thousand)
Keysets indicate the fee
input_fee_ppk
that is charged when aProof
of that keyset is spent as an input to a transaction. The fee is given in parts per thousand (ppk) per input measured in theunit
of the keyset and the sum is rounded up to the next larger integer.As an example, we construct a transaction spending 3 inputs (
Proofs
) from a keyset with unitsat
andinput_fee_ppk
of100
. A fee of100 ppk
means0.1 sat
per input. The sum of the fees would be 300 ppk for this transaction and the mint would charge1 sat
in fees (ceil(0.3) == 1
). The fees for spending 1-10 inputs is 1 sat, 11-20 inputs is 2 sat and so on....
Wallet input and output construction
When constructing a transaction with ecash inputs (example:
/v1/swap
or/v1/melt
), wallets MUST add fees to the inputs (or subtract from the outputs) if they spent ecash from a keyset with fees. The mint checks the following equation:The
fees
are calculated for each input individually (by summing the fee from the keyset they are from) and then rounded up to the next integer.Tracking progress
Mints:
Wallets