Atomic Pools

Atomic Pools are an advanced privacy-enhanced pool variant coming soon to Darklake: a variation of Blind Slippage Pools, introducing better speed and gas-efficiency by condensing the two-step execution model into one atomic transaction.

BSP comparison

In the Blind Slippage Pools execution model, the trader first expresses intent of trading tokens based on which a ZK proof is generated and the min_out value committed. Next, the trader must deposit the tokens within an acceptable time frame, at which point the price action (dy) is calculated. Finally, the validity of the transaction - based on the accepted min_out value and the price action - is verified and the trade settled.

In the above model, the swap of the tokens must be executed in two separate transactions. This stems from the fact that slippage can only be known at execution time. On the other hand, traditional ZKPs assume all inputs are fixed at proof generation time. Atomic Pools are a solution that combines the deposit and settlement into one atomic transaction. To make this possible, Darklake introduces symbolic substitution, a cryptographic concept that extends the limitations of traditional ZKP setups.

Symbolic Substitution

Symbolic Substitution is Darklake's extension to rank-1 constraint systems and quadratic arithmetic programs that allows "late-bound" public inputs. By treating certain inputs symbolically during proof generation, the protocol enables the verifier to substitute real values at runtime while preserving zero-knowledge, completeness, and soundness.

In other words, while traditional ZKP setups require all variables to be substituted before the proof is generated, Symbolic Substitution introduces a new type of late-bound variable whose value can remain uninstantiated throughout the proof phase and only be substituted during proof verification.

In the case of Atomic Pools, Symbolic Substitution enables the proof of validity of token swap (see: proof phase ) to be generated before the deposit of the tokens, even though the price action value is still unknown at this point.


Implications

By introducing a more complex math off-chain, Atomic Pools simplify the on-chain flow of token swaps and provide better speed and gas-efficiency of transactions. Condensing the deposit and settlement into one transaction eliminates any issues stemming from the latency and possible changes of liquidity in-between the two transactions.

Last updated