BIP: 274 Title: Simplified Payment Protocol Fee Rate Information Author: Wallet Workshop Created: 2019-02-22
The simplified payment protocol by itself does not provide a mechanism for the user to know how much they ought to pay in miner fees. This BIP specifies a way for merchants to specify fee rate information they will be willing to accept in a payment request so the user knows how much to pay in miner fees. Presumably, the merchant will query this information directly from miners using the yet-to-be-defined Miner ID protocol.
A PaymentRequest object will have a new property on the object:
PaymentRequest { feeRate // FeeRate object. optional. }
The FeeRate object looks like this:
FeeRate { satoshisPerByte // number. optional. }
The satoshisPerByte variable is is a number indicating how many satoshis per byte each transaction in the Payment ought to pay to miners. The fee rate object is specifically designed to be extensible to other formats in the future if the miners decide to price things differently. For instance, a new variable satohisPerPushDataByte
could be created and used as a substitute for satoshisPerByte
which would indicate that fees are paid per pushdata byte rather than per byte. Such a variable is not yet defined, but gives a hint at the way in which miners pay price things in the future. For now, the only way to specify fees is with the satoshisPerByte
variable.
If this variable is present, the wallet should create a transaction with at least that amount of fee, and the user should be informed about the total cost of the transaction including all outputs plus the total fee before paying the merchant.