Skip to content

Correct antiFeeSniping data for Cake Wallet, BitBoxApp, and Trezor Suite in wallet guide #80

@4rkad

Description

@4rkad

Source code verification reveals that 3 wallets currently listed with antiFeeSniping: true in src/data/guide/wallets.ts do not implement anti-fee-sniping based on their source code.

Findings

Cake Wallet — antiFeeSniping should be false

File: cw_bitcoin/lib/psbt/transaction_builder.dart

The PSBT transaction builder sets nVersion = 2 and nSequence = 0xFFFFFFFD (RBF) or 0xFFFFFFFF, but never sets nLocktime. No reference to block height, anti-fee-sniping, or locktime exists anywhere in the cw_bitcoin transaction construction code. The PSBT default is 0.

psbt.setGlobalTxVersion(2);
psbt.setInputSequence(i, enableRBF ? 0xfffffffd : 0xffffffff);
// No setGlobalLocktime() call anywhere

BitBoxApp — antiFeeSniping should be false

File: backend/coins/btc/maketx/maketx.go

Explicitly sets LockTime: 0 with a comment explaining the decision:

// Locktime is also enabled by this, but we keep
// the locktime at 0, which has no effect.
txIn.Sequence = wire.MaxTxInSequenceNum - 2

unsignedTransaction := &wire.MsgTx{
    Version:  wire.TxVersion,
    TxIn:     inputs,
    TxOut:    outputs,
    LockTime: 0,
}

Trezor Suite — antiFeeSniping likely false, needs confirmation

File: common/protob/messages-bitcoin.proto

The protobuf definition defaults lock_time to 0:

optional uint32 lock_time = 5 [default = 0];

Trezor Suite (sendFormBitcoinThunks.ts) only sets locktime when the user manually configures bitcoinLocktimeBlockHeight or bitcoinLocktimeDatetime. There is no automatic anti-fee-sniping logic that sets locktime to current block height. The enhanceSignTx function was not found to add it either.

Wallets correctly listed

For reference, the following wallets were verified to implement anti-fee-sniping:

  • Bitcoin Coresrc/wallet/spend.cppDiscourageFeeSniping(): sets nLocktime = block_height, 10% chance of subtracting random(0-99) blocks
  • Electrumelectrum/wallet.pyget_locktime_for_new_transaction(): same algorithm as Core
  • Blockstream Green (GDK)src/ga_tx.cppset_anti_snipe_locktime(): same algorithm as Core

Suggested change

In src/data/guide/wallets.ts:

  // Cake Wallet
- antiFeeSniping: true,
+ antiFeeSniping: false,

  // BitBoxApp
- antiFeeSniping: true,
+ antiFeeSniping: false,

  // Trezor Suite (pending further confirmation)
- antiFeeSniping: true,
+ antiFeeSniping: false,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions