Skip to content

Anti-fee-sniping nLockTime diverges #1676

Description

@bc1cindy

following up on #1597 nLockTime axis nLockTime is a per-tx fingerprint, matching the largest crowd (Core / Electrum) keeps payjoin txs in the same anonymity set.

wallet nLockTime now converges?
Core / Electrum tip + ~10% backdate
Liana tip + ~10% backdate
payjoin-cli / ldk-node / BBM exact-tip (no backdate) target
Cake 0
Boltz claim 0 / refund = swap timeout

payjoin-cli sets an explicit locktime = get_block_count() (wallet.rs#L54-L59). walletcreatefundedpsbt copies that into coin_control.m_locktime (wallet/spend.cpp#L1501), and a set m_locktime turns off Core's anti-fee-sniping wallet/spend.cpp#L1313-L1316, so every payjoin-cli tx lands on the exact tip, with no backdating.

both wallets we'd want to blend into backdate ~10% of the time: Core's DiscourageFeeSniping (wallet/spend.cpp#L1029-L1030: randrange(10)==0 → nLockTime -= randrange(100)) and Electrum (wallet.py#L224-L226). Always landing on the tip separates payjoin-cli (with ldk-node and BBM) from the Core/Electrum crowd over a few transactions. The code comment cites "anti-fee-sniping best practices", exact-tip keeps the anti-snipe protection but drops the randomized backdate Core/Electrum apply for privacy, and that skip is what makes it stand out.

proposed: drop the explicit locktime and let Core's DiscourageFeeSniping run. payjoin-cli then matches Core/Electrum exactly, same anonymity set, no new coupling.

other integrations:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions