mirror of
https://github.com/luxfi/dex.git
synced 2026-09-24 00:26:31 +00:00
The venue V of the HTLC atomic-swap design: a pure relay that serves a maker-signed quote book and sequences a swap session between taker U (the secret-holder) and a CEX-backed maker M, validating each typed signed transition — role bindings (HTLC_A recipient=U/refund=M, HTLC_B recipient=M/refund=U), the cross-leg hashlock, and the timeout ordering T_B > T_A + Δ (maker locks first/shorter; spec Δ table: Lux<->BTC 2h, EVM<->EVM 5m). Non-custody is STRUCTURAL: the Coordinator holds no private key of any asset, is the recipient/refund of no HTLC, and has no fund-moving path — TestNonCustody reflects over it and fails if any field is a key type. After the hashlock commit V is irrelevant to safety; its crashing or lying can only deny service or relay a stale quote. Composes pkg/htlc for the shared hashlock/preimage and authenticates every message through crypto.Ecrecover directly (recoverAddr) with its own venue domain tags — a leaf, so the relay never pulls the GPU CLOB matcher. Builds and passes go test -race off a non-GPU box.