bitpay / jsonPaymentProtocol

JSON Payment Protocol Interface
46 stars 57 forks source link

`requiredFeeRate` is ambiguous #28

Open swansontec opened 5 years ago

swansontec commented 5 years ago

There are two ways to calculate transaction sizes on the Bitcoin (BTC) chain. The literal way simply takes the total transaction size, but the weighted way discounts bytes in the segwit area by 4x. Both metrics are in units of "bytes", so it is not clear which calculation approach this specification intends.

The Bitcoin Core software gives suggested fees in weighted bytes (see the estimatesmartfee method). Full nodes and miners also use weighted sizes in their block-size calculations. Therefore, it would make the most sense for this specification to clarify that the requiredFeeRate is in weighted bytes.

Bitcoin Cash doesn't have this distinction, of course. This is only an issue for segwit-enabled coins.

joshuamorris23 commented 5 years ago

On Wed, Jul 3, 2019 at 7:07 PM William Swanson notifications@github.com wrote:

There are two ways to calculate transaction sizes on the Bitcoin (BTC) chain. The literal way simply takes the total transaction size, but the weighted way discounts bytes in the segwit area by 4x. Both metrics are in units of "bytes", so it is not clear which calculation approach this specification intends.

The Bitcoin Core software gives suggested fees in weighted bytes (see the estimatesmartfee method https://bitcoin.org/en/developer-reference#estimatesmartfee). Full nodes and miners also use weighted sizes in their block-size calculations. Therefore, it would make the most sense for this specification to clarify that the requiredFeeRate is in weighted bytes.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/bitpay/jsonPaymentProtocol/issues/28?email_source=notifications&email_token=ALQWBQHJ2WJHHLKTQRMCY4LP5U5LNA5CNFSM4H5ODO52YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G5IDHGQ, or mute the thread https://github.com/notifications/unsubscribe-auth/ALQWBQGO45N4BOPYZ5WYTPLP5U5LNANCNFSM4H5ODO5Q .

-- peace