Shielded swaps
Authorize an exchange from private state with explicit execution constraints.
Protocol behavior is proposed. This release is an interface preview; no funds or wallet signatures are accepted.
Proposed execution
A supported swap intent identifies an approved router, input asset and amount, minimum output, path, and deadline. The proof binds the swap to the signer; the pool executes against external liquidity and records the output as a new note.
The reference integration targets Uniswap V2-style exact-input swaps: native to token, token to native, and token to token. It is not a generic mechanism for arbitrary contract calls.
Output construction
Actual output is unknown until execution. The reference mechanism proves ownership-related output fields in advance and completes the value-bearing note using the amount returned by the router. This requires dedicated constraints and careful accounting.
What remains observable
External pool interaction, asset types, and trade amounts can remain visible on-chain. Shielding can obscure who owns the resulting note; it does not make the liquidity venue or market impact invisible.
Execution controls
- Show expected output and a minimum-output floor.
- Enforce the signed deadline and permitted route.
- Deduct fees from the correct asset pool and return change.
- Handle slippage reverts without presenting a completed swap.
- Verify actual received amounts and reject unsupported token behavior.