Economic Attack Surface and Boundary Enforcement

permalink SUBTC
#attack#boundary#economic#enforcement#surface

WAproxy must enforce strict economic boundaries to prevent abuse.

Execution endpoints represent financial operations.
They are potential attack surfaces.

------------------------------------------------------------
ATTACK CATEGORY 1 — DUST FLOODING
------------------------------------------------------------

Attempt:
Send extremely small amounts repeatedly.

Defense:
Enforce per-coin min_send thresholds.

Rule:
amount_sat >= coin_min_send_sat

------------------------------------------------------------
ATTACK CATEGORY 2 — FEE GAMING
------------------------------------------------------------

Attempt:
Exploit rounding behavior in protocol fee calculation.

Defense:
- Integer-only arithmetic
- Basis-point calculation
- Deterministic rounding discipline

protocol_fee = amount_sat × FEE_BPS / 10000

------------------------------------------------------------
ATTACK CATEGORY 3 — IDEMPOTENCY ABUSE
------------------------------------------------------------

Attempt:
Reuse idempotency keys to manipulate execution.

Defense:
- Persist (wallet_id, idempotency_key)
- Reject parameter mismatch
- Return deterministic conflict error

------------------------------------------------------------
ATTACK CATEGORY 4 — BALANCE DRAIN EDGE CASE
------------------------------------------------------------

Attempt:
Send full balance without safety margin.

Defense:
Require:

wallet_balance >= amount_sat + safety_margin

------------------------------------------------------------
ATTACK CATEGORY 5 — CONCURRENCY RACE
------------------------------------------------------------

Attempt:
Submit parallel sends from same WID.

Defense:
- Wallet-level locking
- Atomic state transitions
- Serialized execution

------------------------------------------------------------
BOUNDARY PRINCIPLE
------------------------------------------------------------

WAproxy does not attempt to:

- optimize user strategy
- dynamically alter economic rules
- speculate on network behavior

It enforces deterministic boundaries.

------------------------------------------------------------
DESIGN INVARIANTS
------------------------------------------------------------

- All arithmetic is integer.
- All economic limits are explicit.
- All retries are deterministic.
- All state transitions are atomic.
- All validation occurs before broadcast.

------------------------------------------------------------
ARCHITECTURAL STATEMENT
------------------------------------------------------------

Economic discipline is mandatory
for deterministic execution safety.

WAproxy protects execution boundaries,
not market outcomes.