-
Notifications
You must be signed in to change notification settings - Fork 38.8k
wallet: Avoid leaking nLockTime fingerprint when anti-fee-sniping #15039
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
wallet: Avoid leaking nLockTime fingerprint when anti-fee-sniping #15039
Conversation
fa2b064 to
fae5f61
Compare
fa5a339 to
fa7c5c7
Compare
fa7c5c7 to
fa6addf
Compare
fa6addf to
fa48baf
Compare
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
|
Concept ACK
I remember this was one of the remarks back then too. Anti-fee sniping only makes sense if it's catched up with the chain. |
meshcollider
left a comment
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.
utACK fa48baf
| if (IsInitialBlockDownload()) { | ||
| return false; | ||
| } | ||
| constexpr int64_t MAX_ANTI_FEE_SNIPING_TIP_AGE = 8 * 60 * 60; // in seconds |
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.
Any rationale on why 8 hours was chosen? Seems sane though
| // that transactions that are delayed after signing for whatever reason, | ||
| // e.g. high-latency mix networks and some CoinJoin implementations, have | ||
| // better privacy. | ||
| if (GetRandInt(10) == 0) |
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.
This if needs {} but I understand if you prefer to keep this move-only.
|
utACK fa48baf |
… anti-fee-sniping fa48baf wallet: Avoid leaking locktime fingerprint when anti-fee-sniping (MarcoFalke) 453803a [test] wallet_txn_clone: Correctly clone txin sequence (MarcoFalke) Pull request description: The wallet sets the locktime to the current height of our active chain. This is fine, as long as our node is connected to other nodes. However, when we fall back and get stuck at a particular height (e.g. taking the wallet offline), the same (potentially unique) locktime is used for all transactions. This makes it easier for passive observers to cluster transactions by wallet. For reference, I visualized "locktime-reuse" with the data: * blocks 545k-555k (both inclusive) * locktimes<=60k * excluding coinbase txs  Tree-SHA512: 2af259dd8f9f863312e2732d80ca8ba6a20c8d6d1c486b10a48479e1c85ccf13b0c38723740ebadde0f28d321cd9c133ad3e5d1e925472eb27681143bda2d0e7
|
Thanks for fixing this. My analysis from 2017 is here, although the full output text file is no longer online. I had looked at all blocks to mid-2017. At that time there were 33 old locktimes in the blockchain in 94 transactions. |
Summary: ``` The wallet sets the locktime to the current height of our active chain. This is fine, as long as our node is connected to other nodes. However, when we fall back and get stuck at a particular height (e.g. taking the wallet offline), the same (potentially unique) locktime is used for all transactions. This makes it easier for passive observers to cluster transactions by wallet. ``` Backport of core [[bitcoin/bitcoin#15039 | PR15039]]. Test Plan: ninja check check-functional-extended Reviewers: #bitcoin_abc, deadalnix Reviewed By: #bitcoin_abc, deadalnix Differential Revision: https://reviews.bitcoinabc.org/D5560
Summary: ``` The wallet sets the locktime to the current height of our active chain. This is fine, as long as our node is connected to other nodes. However, when we fall back and get stuck at a particular height (e.g. taking the wallet offline), the same (potentially unique) locktime is used for all transactions. This makes it easier for passive observers to cluster transactions by wallet. ``` Backport of core [[bitcoin/bitcoin#15039 | PR15039]]. Test Plan: ninja check check-functional-extended Reviewers: #bitcoin_abc, deadalnix Reviewed By: #bitcoin_abc, deadalnix Differential Revision: https://reviews.bitcoinabc.org/D5560
merge bitcoin#10973, bitcoin#15039, bitcoin#15288: separate wallet from node

The wallet sets the locktime to the current height of our active chain. This is fine, as long as our node is connected to other nodes. However, when we fall back and get stuck at a particular height (e.g. taking the wallet offline), the same (potentially unique) locktime is used for all transactions. This makes it easier for passive observers to cluster transactions by wallet.
For reference, I visualized "locktime-reuse" with the data: