Security · source-reviewed engineering guide
Counter-trading and signing-chain safety: verify before execution
Reviewed 27 October 2026 · Next review 27 January 2027. Technical guidance for operators of their own systems only. Not investment advice, trading signals or an offer to manage third-party funds. Crypto-asset trading can result in loss of all invested capital.
1. Two boundaries that a key alone does not protect
Disabling withdrawals on a trading API key reduces direct-transfer risk but does not prevent a compromised trading key from executing harmful orders. A system also needs instrument allowlists, position limits, price/slippage limits, per-order volume bounds and explicitly owned stop decisions. No fixed percentage is safe across all venues and market states.
Hardware signing, MPC, HSM and multisig can protect signing material. They do not independently prove that the operator’s intended transfer matches the exact payload presented to a signer. A separately controlled policy and decoding layer must compare what is shown with what will actually be signed.
2. Public incident evidence and its limits
In its 24 September 2026 notice, Bitget described unauthorized transfers affecting hot/warm wallet infrastructure and an initial $351.6 million estimate; reconciliation detected discrepancies at 19:05 UTC. Its incident overview updated 20 October gives a final estimate of approximately $388 million, describes transfers starting at around 18:31 UTC and says attackers abused credentials gained through a third-party security product to send fraudulent withdrawal commands. These figures and times describe different reporting stages, not contradictory estimates for one fixed accounting snapshot. They remain provider/investigation statements, not BitEvo forensic findings.
The FBI alert I-022625-PSA, published 26 February 2025, attributes the approximately $1.5 billion Bybit theft around 21 February 2025 to TraderTraitor actors associated with North Korea. It does not establish what each internal Bybit control did during the event.
Not repeated as verified: granular XRP transaction totals or minute-by-minute hot-wallet top-ups from the source draft, a claimed $185 million one-minute flow, guaranteed recovery and sub-second kill-switch outcomes. Their independent transaction-level verification remains outstanding.
3. Reconstructing a trustworthy L2 order book
Treat local order-book data as trusted only while sequence continuity and snapshot freshness are proven. Buffer depth events, obtain an appropriate exchange snapshot, apply events in the documented order and suspend new orders on sequence gaps. Binance’s USDⓈ-M futures diff-depth documentation describes the relevant data interface; its sequence rules must not be silently copied to a different Binance product or Bybit feed.
Lost heartbeat, stale timestamps, missing sequence identifiers or an unavailable authoritative snapshot mean UNTRUSTED_BOOK → NO_NEW_ORDERS → RESYNC. A delivered websocket message is not proof that quoted liquidity will still be available at execution.
4. Five control domains: 18 review questions
This is a proposed engineering checklist, not an exchange standard or a promise of zero loss.
A. Credentials and authority (1–4): [1] separate read-only and trading keys; [2] withdrawal and unnecessary transfer rights denied; [3] IP restrictions and tested revocation; [4] isolated trading sub-account with owner-defined exposure.
B. Pre-trade integrity (5–9): [5] explicit symbol allowlist; [6] fresh sequence-valid L2 snapshot; [7] slippage/price-deviation gate; [8] visible-depth-aware order-size gate; [9] turnover and order-rate caps. Calibrate limits to the venue and test fail-closed handling.
C. Independent stop circuit (10–13): [10] out-of-process watchdog; [11] independently calculated equity/drawdown thresholds; [12] stop new orders and verify cancellation/position state; [13] suspend automated treasury top-ups when unauthorized transfers are suspected. Provider acknowledgements need independent readback.
D. What-you-see-is-what-you-sign (14–16): [14] decode raw calldata and target contract independently; [15] compare typed EIP-712 order fields and recipients to signed intent; [16] restrict and review ERC-20 approvals, conduit and expiry. The Seaport reference documents fields including offer, consideration, zone, conduitKey and counter; their semantics matter beyond signature validity.
E. Effect verification (17–18): [17] simulate state changes before signing where supported; [18] verify authoritative post-submission effects with an independent reader and hold unknown outcomes instead of blind retry.
5. Isolated test procedure
Use synthetic data and a test environment. Record object IDs, authority grants, expected and forbidden effects, an independent observer, recovery owner and explicit retest criteria. Introduce missing depth updates, price spikes, duplicate requests and payload/intent mismatches without using real customer funds or production secrets. Report expected / observed / not proven.
Related: Trading bot API key safety and Bitget authority boundary review.