Skip to main content

The delta Network

A domain executes application logic and enforces custom transaction rules through local laws.

delta verifies constraints, not execution: domains prove that outputs satisfy specified rules (valid signatures, balance requirements, custom logic), and the base layer settles the results.

The separation of execution from settlement allows domain developers to build in standard programming languages, use APIs without needing oracles, and design transaction guardrails without smart contract limitations.

domains_high_level.png

Building a domain

Define custom logic

Your domain's execution logic can be written in any programming language. Using the provided Generic Domain as a base, your application logic runs independently and communicates through an OpenAPI interface that exposes all required domain operations (debits, transaction submission, state queries, and proof handling).

This separation means you can build in your preferred language and framework while the Generic Domain handles the integration with delta's base layer.

// Your execution logic (any language) calls the Generic Domain
function executionLogic(userTxs, state) {
for tx in userTxs {
// add payout transaction to the txs base on state
executionResult.push(...)
}
return executionResult
}

executionResult = executionLogic(userTxs, state)
IntentsService.intentsExecute(executionResult)

Define Local Laws

Local laws are cryptographic constraints that govern valid state transitions in your domain. The constraints can enforce any property your domain requires (financial invariants, game mechanics, or compliance policies).

Local laws are currently written in Rust.

As an example, the below local law proves that a swap satisfied the user's slippage tolerance and maintained correct pool mathematics, without requiring validators to re-execute the AMM logic.

// Define constraint for a swap transaction
fn verify_swap(
amount_in: u64,
min_amount_out: u64,
pool_state_before: PoolReserves,
pool_state_after: PoolReserves,
) -> bool {
// Calculate actual output from the swap
let actual_output = calculate_output(
amount_in,
pool_state_before.reserve_x,
pool_state_before.reserve_y
);

// Constraint 1: Slippage protection
assert!(actual_output >= min_amount_out);

// Constraint 2: Constant product formula (x * y = k)
let k_before = pool_state_before.reserve_x * pool_state_before.reserve_y;
let k_after = pool_state_after.reserve_x * pool_state_after.reserve_y;
assert!(k_after >= k_before);

true
}

Deploy on delta

Building a domain is that simple. Use the generic domain as a base to communicate with the delta base layer, build your application in whatever language is optimal, and optionally design local laws to cryptographically enforce constraints.