Skip to content

Conversation

delta1
Copy link
Member

@delta1 delta1 commented May 22, 2024

Allow -mintxfee=0, so the elements wallet can create transactions with 0 value fee outputs.

Elements can already accept 0 value fees with -minrelaytxfee=0 and -blockmintxfee=0, but before this change the wallet would not create a transaction with 0 feerate.

Note: this check for 0 was inherited from upstream and subsequently removed in bitcoin/bitcoin@f11eb1f

This check for 0 feerate was inherited from upstream, and subsequently
removed in this commit:

bitcoin/bitcoin@f11eb1f
@delta1 delta1 requested a review from tomt1664 July 8, 2025 17:13
@delta1 delta1 marked this pull request as draft July 11, 2025 08:49
Copy link
Member

@tomt1664 tomt1664 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HasValidFee is a consensus check (in CheckTxInputs) which was introduced with CA.

I'm not sure why the fee == 0 was originally added, as a transaction without any fee output (i.e. also zero fee) is consensus valid. (the fee == 0 check in only applied to individual fee outputs, not the total fees for the tx).

I've verified that removing this fee == 0 check will cause a hard-fork if a zero fee output tx is confirmed in a block.

Suggestion: we add a -con_ config parameter (e.g. -con_allowanyfee) that removes this optionally.

@delta1
Copy link
Member Author

delta1 commented Jul 11, 2025

why the fee == 0 was originally added

I think that part was inherited from upstream initially

add a -con_ config parameter (e.g. -con_allowanyfee) that removes this optionally

Good idea, thanks

@tomt1664 tomt1664 mentioned this pull request Jul 18, 2025
@tomt1664 tomt1664 self-assigned this Jul 22, 2025
@tomt1664
Copy link
Member

Modified so that the wallet now creates a transaction without a fee output if the mintxfee=0 and fee rate set to zero.

This is consensus valid and so the fee == 0 check in HasValidFee does not prevent this.

Functional test updated to verify number of transaction outputs and no fee output in zero fee case.

@tomt1664 tomt1664 marked this pull request as ready for review July 22, 2025 11:17
@delta1
Copy link
Member Author

delta1 commented Jul 25, 2025

Hey @tomt1664 the macos failure is because the wallet in that job is sqlite (descriptors) only - I'm able to repro on macos by running test/functional/wallet_send_zero_fee.py --descriptors

@delta1
Copy link
Member Author

delta1 commented Jul 31, 2025

ACK ab5777e

Ran tests locally

@delta1 delta1 merged commit 6e2d879 into ElementsProject:master Jul 31, 2025
14 checks passed
delta1 added a commit to delta1/elements that referenced this pull request Aug 8, 2025
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

Successfully merging this pull request may close these issues.

2 participants