Repository navigation
policy: Charge a fee penalty for 1-of-N witness keys - #449
Closed
connorslab wants to merge 1 commit into
Closed
connorslab wants to merge 1 commit into
connorslab wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
BPUB encodes 31 payload bytes into each valid compressed public key, then reveals them in a P2WSH
1-of-Nmultisig script. Its largest script uses fourteen payload keys and one signing key. A public-key validity check cannot distinguish those keys from wallet keys. See the encoder and script construction.This draft adds a default fee penalty for that structure, rather than rejecting it as nonstandard. The purpose is to increase the cost of the current BPUB encoding while allowing legitimate matching multisig spends to pay the additional fee. It is a fee-based alternative to the rejection approaches discussed in #422 and #435.
Behavior
-oneofnkeypenalty=1is the default. For each input, match only a complete script of either form:1 <key1> ... <keyN> N CHECKMULTISIG.<key1> CHECKSIG <key2> CHECKSIGADD ... 1 NUMEQUAL.Calculate the weight corresponding to the witness discount on all but one key:
3 * 33 * (N - 1)for compressed multisig keys, or3 * 32 * (N - 1)for Tapscript keys. Sum across inputs, round up to virtual bytes, and charge that amount at the node'sminrelaytxfee. Subtract the charge from the transaction's modified fee, which feeds relay fee checks and fee-based mempool/mining selection. The transaction's actual fee, weight, vsize, and size-limit accounting do not change.For a single BPUB-style
1-of-15P2WSH input, this is 347 additional satoshis at a 1 sat/vB minimum relay rate. This is a fixed penalty at the configured minimum rate, not a multiplier on the prevailing market feerate.Spending compatibility
There is no new key-count limit or data-carrier classification. Legitimate
1-of-Nwallets incur the same penalty; the policy cannot infer why their keys were chosen. Other thresholds, complex recovery scripts, non-witness multisig, and key-path spends receive no new penalty. Block validity is unchanged.-oneofnkeypenalty=0disables the penalty;-corepolicyalso disables it unless explicitly overridden.The charge is applied after the existing ephemeral zero-fee check. It does not tighten TRUC or ancestor-size limits. A package child can cover it where existing package policy permits. It does not fix the separate dust-fee interaction addressed by #438.
Wallet funding reserves a conservative allowance at its selected feerate, including for explicitly supplied input weights. This may overestimate the penalty at rates above
minrelaytxfee, or when a different Taproot path is used. The existing Taproot estimator still assumes key-path spending; script-path funding needs an appropriate input weight. Already signed or externally constructed transactions may need a fee adjustment.Limits of this approach
This is deliberately a narrow draft, not a general BPUB filter. An encoder can avoid the match by changing the threshold to
2-of-Nor changing the script structure, including adding a wrapper. No durable increase in the cost of adapted encodings is claimed. The review question is whether this limited default penalty is useful enough to justify its cost to legitimate1-of-Nusers.Validation
One commit. No generated files, manpages, or shell completions.