Implement JoinMarket n_locktime Coinjoin detection#26
Implement JoinMarket n_locktime Coinjoin detection#26bc1cindy wants to merge 4 commits intopayjoin:masterfrom
Conversation
| tx.locktime() >= 1 && tx.locktime() <= 499_999_999 | ||
| } | ||
|
|
||
| /// Unix timestamp locktime, defined by Bitcoin protocol >= 500_000_000. | ||
| pub fn with_fidelity_bond(tx: &impl HasNLockTime) -> bool { | ||
| tx.locktime() >= 500_000_000 |
There was a problem hiding this comment.
Is this sufficient? Any txs with these locktimes will get missclassified as a joinmarket tx.
Can you provide the docs that led you to this conclusion
There was a problem hiding this comment.
it was based on https://learnmeabitcoin.com/technical/transaction/locktime/
I actually had the same concern about both paths and you're right, I'm going to add more specific joinmarket checks
to be more specific in without_fidelity_bond, since locktime is relative to when the transaction was created we would need to know the block height at that time, can we expose like a HasBlockHeight?
# set locktime for best anonset (Core, Electrum)
it would still be a weak filter since they do the same for anonset
with_fildelity_bond at first I thought that being set as u32 would be enough, but we can really have better filters and HasBlockHeight would be great on that too
|
Converting this to a draft for now |
arminsabouri
left a comment
There was a problem hiding this comment.
There is alot left here. I don't know too much about the join market protocol. The current state of things only scrutinizes the nlocktime value i believe there is more to look at (# of inputs, # of outputs, output value decomposition) + we should add tests from real join market txs
there is a lot left ( #5 (comment) ), but my idea was to add others in follow up PRs but its better to add here and write tests with real txs to check the detection I'll also add more context on the PR description to make it easier to review it sounds good? |
|
Sounds good to me. Starting small is fine. Please also take a look at other codebases for inspiration. For example: https://github.com/Copexit/am-i-exposed/blob/main/src/lib/analysis/heuristics/coinjoin-detectors.ts#L73 Im not sure how important the fidelity bond tx is for classifying the actual coinjoin tx. |
adds JoinMarket Coinjoin detection based on n_locktime` field, covering both block height (without fidelity bond) and Unix timestamp (with fidelity bond) cases and tests.
parte of #5