ElementsProject / ElementsProject/elements
Inconsistency of "fee at end" rule
- Dominant language
- C++
- Stars
- 1.2k
- Forks
- 416
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 15
Description
Some of our RPCs enforce a rule that the fee output must be last. I'm not clear on where this requirement comes from, or whether it needs to be enforced.
There is at least one case in blinding (blinded inputs / no blinded outputs) where we have to add a zero-value OP_RETURN output in order to balance the blinding factors. It looks like we add this at the end, which messes up the 'fee output must be last' logic.
If the fee output indeed must be last, I would like to add some checks to ensure we are consistent about this everywhere, rather than in an ad-hoc way as we do now. Then we can move the "bonus output" to be before the fee for consistency.
If not, I would like to revisit the "fee last" rule.
Contributor guide
Research direction
Trace the RPCs that enforce the fee-output ordering and the blinding case with blinded inputs and no blinded outputs. First establish whether the fee must be last; done means the rule has a clear basis and its enforcement and bonus-output ordering are consistent wherever applicable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- blockchain
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100