Self-Trade Prevention
TL;DROrders backed by notes with the same owner commitment never match each other,
even when they use different trading keys. Trading-key equality is checked as a
second guard. If your bid and ask cross, the engine skips that self-pair and
keeps both eligible against other traders.
The rule
The primary identity is the collateral note’s owner commitment. The enclave re-derives the signed note commitment from its opening at intake, so a caller cannot simply claim a different owner for a note they do not control. The normal SDK derives one wallet-level owner commitment and reuses it across that wallet’s notes. The matcher also compares trading keys. A self-pair is skipped if either the note-bound owner commitment or the trading key matches.Why a single behavior
On a continuous order book, self-trade prevention comes in flavors (cancel the resting side, cancel the incoming side, cancel both) because there is a maker and a taker to choose between. A Darknyx batch has no maker/taker ordering: all crossing orders clear together at one price (see Clearing Price). There is no “resting vs. incoming” side to pick, so the honest behavior is a single rule: two orders are skipped when either their note-bound owner commitments or their trading keys match. Both remain available to match against everyone else.What it protects
- No accidental wash trades. A market maker quoting both sides cannot accidentally trade two notes from the same wallet, even when strategies use separate trading keys.
- Cleaner execution records. Every fill is against a distinct note owner.