-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Contribute even when a sender makes no change #259
Merged
Merged
Conversation
This file contains 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
DanGould
force-pushed
the
dont-force-change
branch
from
May 21, 2024 15:27
b610422
to
cf67715
Compare
DanGould
force-pushed
the
dont-force-change
branch
from
May 21, 2024 20:24
cf67715
to
44d67a4
Compare
A pure consolidation does not suffer from Unnecessary Input Heuristic. A Payjoin consolidation without sender change still breaks Common Input Heuristic. Allow it.
DanGould
force-pushed
the
dont-force-change
branch
from
July 8, 2024 22:00
44d67a4
to
da21bdc
Compare
Avoid UIH for multiple inputs, and just select any input where UIH does not apply.
Inputs naturally come before outputs in bitcoin transactions.
Such one-output transactions pay the base costs to transact and provide an incentive for a receiver to contribute with reduced marginal cost of adding an input rather than an explicit change output. Allowing payjoin sweeps breaks common input heuristic for them. Sweeps with many inputs are common, making ~5.2% or ~54M of ~1.037B monetary, non-coinbase txs. Source monetary non-coinbase transactions count: https://blockchair.com/bitcoin/transactions?q=is_coinbase(false)#f=hash,is_coinbase,time Source sweep transactions count: https://blockchair.com/bitcoin/transactions?s=time(desc)&q=is_coinbase(false),input_count(2..),output_count(1)#f=hash,time
DanGould
force-pushed
the
dont-force-change
branch
from
July 8, 2024 22:14
da21bdc
to
285ecd6
Compare
Since these changes makes sweeps first-class payjoin transactions, make the Requestbuilder recommend the appropriate parameters for sweeps too.
Without this, a sender would sign a receiver transaction that would get stuck.
spacebear21
approved these changes
Jul 15, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK 7361ba9
This was referenced Jul 18, 2024
Closed
This was referenced Aug 16, 2024
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.
A pure consolidation does not suffer from Unnecessary Input Heuristic. A Payjoin consolidation without sender change still breaks Common Input Heuristic. Allow it.
This is incomplete because the UIH checking should not be happening if only a consolidation is to occur. That does not suffer from change interpretation nor unnecessary input issues because there is no change to interpret, just a single output funded by all necessary inputs.
Supporting sweeps themselves introduce NO API change. It only allows a payjoin to be created with exactly 1 output paying the receiver.
HOWEVER I have taken the liberty to change
RequestBuilder::build_non_incentivising
to take a min_fee_rate as parameter. Without this, a sender could sign and broadcast transactions that have no chance of being mined. I've seen a persistent mempool for months!These are my notes on Unnecessary Input Heuristic that a reviewer may find helpful in understanding the constraints of the
try_preserving_privacy
function modified here.This ability
should beis tested with both a sender / receiver integration test and data to show that these types of transactions might be ambiguous with existing payment activity (self spends or sweeps to others)Data:
As of Jul 8, 2024, Out of Blockchair's 1,037,565,391 transactions, 53,232,056 of them
transactions that are not Coinbase transactions have exactly one output with a non-zero amount.
This means approximately 5.13% of all transactions are sweeps that might suffer from Common-input heuristic.
Source monetary non-coinbase transactions count: https://blockchair.com/bitcoin/transactions?q=is_coinbase(false)#f=hash,is_coinbase,time
source sweeps: https://blockchair.com/bitcoin/transactions?s=time(desc)&q=output_count(1),is_coinbase(false),fee(1..),input_count(2..),output_total(1..)#f=hash,time,output_total,fee,is_coinbase,output_count,block_id,input_count
Of the transactions in the past year, since height 797844
There have been 175,639,552 transactions and 8,080,966 of them
This means approximately 4.57% of all non-coinbase transactions in the past year are sweeps that might suffer from common input heuristic.
source all non-coinbase: https://blockchair.com/bitcoin/transactions?s=time(desc)&q=is_coinbase(false),fee(1..),block_id(797844..)#f=hash,time,output_total,is_coinbase,block_id,fee,input_count,output_count
source sweeps: https://blockchair.com/bitcoin/transactions?s=time(desc)&q=output_count(1),is_coinbase(false),fee(1..),input_count(2..),output_total(1..),block_id(797844..)#f=hash,time,output_total,is_coinbase,block_id,fee,input_count,output_count