Skip to content
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

Add anti-fee-sniping code using nSequence to help improve privacy of off-chain protocols #161

Closed
chris-belcher opened this issue Jul 22, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@chris-belcher
Copy link

I saw on twitter that Sparrow has already implemented taproot single-sig wallets.

Please consider adding privacy-improving code which I suggested on the mailing list: https://gist.github.com/chris-belcher/903feab321bf41055c91eaec46581e89

It will help provide some cover traffic for off-chain protocols like Lightning. If we pull this off we could end up in a great situation where LN channel openings and closings look exactly the same as on-chain taproot transactions. That would be great for the privacy and fungibility of bitcoin.

The BIP proposal contains some pseudocode which hopefully you can just copypaste and translate into your language: https://gist.github.com/chris-belcher/903feab321bf41055c91eaec46581e89#pseudocode

@craigraw
Copy link
Collaborator

Thanks for suggesting the proposal here - I’ve had it in my inbox for some time but haven’t got to it yet. Will look at this for the next release.

@6102bitcoin 6102bitcoin added the enhancement New feature or request label Jul 26, 2021
@craigraw
Copy link
Collaborator

Added in sparrowwallet/drongo@c9e57fa.

I'll note that currently the pseudocode will not only disable absolute locktime, but disable or enable RBF depending on whether the absolute locktime is set. I believe it would be better to use

input.nsequence = 2**32 - 3

which would leave locktime and RBF enabled in all cases. The absolute locktime can be set to zero when relative locktime is used.

@chris-belcher
Copy link
Author

Great work, thanks!

Good suggestion regarding the nsequence value, I've updated the document to have that: https://gist.github.com/chris-belcher/903feab321bf41055c91eaec46581e89/revisions#diff-089b3248b5f1e9b7bccc09e372a83a19f87818a11263087e7961bc999cca2bf2

@craigraw
Copy link
Collaborator

Great, this is going out with the Sparrow release today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants