Skip to content

Commit

Permalink
Don't check for compliance with BIP69's lexicographical ordering
Browse files Browse the repository at this point in the history
I was convinced that BIP69 is not such a great idea (primarily due to
concerns relating to the transition period) and that there might be
better alternatives to it (like deterministically sorting based on a
user secret). At the very least, it seems like BIP69's usefulness is
controversial enough to not warrant a warning message for non-compliance.

Also see: bitcoin/bitcoin#12457
  • Loading branch information
shesek authored and greenaddress committed Mar 6, 2019
1 parent 23491ae commit d592eac
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
18 changes: 0 additions & 18 deletions client/src/lib/privacy-analysis.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,6 @@ export default function getPrivacyAnalysis(tx) {
detected.push('self-transfer')
}

// Detect non BIP69 lexicographically ordered transactions
if (tx.vin.length+tx.vout.length > 2 && !isLexicographicallyOrdered(tx)) {
detected.push('non-lexicographical')
}

// Detect CoinJoin-looking transactions
if (!hasCT && isCoinJoinLike(tx)) {
detected.push('coinjoin')
Expand Down Expand Up @@ -125,16 +120,3 @@ const isCoinJoinLike = tx => {
const inc = counter(), target = Math.max(Math.min(tx.vout.length/2|0, 2), 5)
return tx.vout.some(out => inc(out.value) >= target)
}

// check compatibility with BIP 69 lexicographical ordering
// TODO: how to treat CT's explicit fee outputs?
const isLexicographicallyOrdered = tx => {
const sortedIns = tx.vin.slice().sort(compareIns)
, sortedOuts = tx.vout.slice().sort(compareOuts)

return tx.vin.map(vin => `${vin.txid}:${vin.vout}`).join(',') == sortedIns.map(vin => `${vin.txid}:${vin.vout}`).join(',')
&& tx.vout.map(out => `${out.scriptpubkey}:${out.value}`).join(',') == sortedOuts.map(out => `${out.scriptpubkey}:${out.value}`).join(',')
}

const compareIns = (a, b) => a.txid.localeCompare(b.txid) || a.vout - b.vout
, compareOuts = (a, b) => a.value - b.value || Buffer.from(a.scriptpubkey, 'hex').compare(Buffer.from(b.scriptpubkey, 'hex'))
7 changes: 0 additions & 7 deletions client/src/views/tx-privacy-analysis.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,6 @@ const messages = {
, 'https://en.bitcoin.it/wiki/Privacy#Sending_to_a_different_script_type'
]

, 'non-lexicographical': [
'warning'
, 'Non-lexicographical ordering'
, 'This transaction does not follow the lexicographical ordering defined in BIP 69. This makes it easier to fingerprint behaviours by specific wallets and identify transactions made by them.'
, 'https://en.bitcoin.it/wiki/Privacy#Wallet_fingerprinting'
]

, 'change-detection-uih1': [
'warning'
, 'Unnecessary input heuristic'
Expand Down

0 comments on commit d592eac

Please sign in to comment.