Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

An Introduction to Azoth

Azoth is Mirage's open-source tool for deterministic bytecode diversification. It produces reproducible variants of EVM contract bytecode while preserving the contract's behavior. Mirage uses Azoth for its temporary escrows, with the goal of helping them blend into the broader population of unverified contracts on Ethereum.

Bytecode Camouflage

Mirage uses a fresh escrow for each transaction. Reusing identical bytecode would give observers a recognizable pattern connecting those escrows. Azoth changes the bytecode's structure to reduce recognizable signs of its origin. We call this goal bytecode camouflage.

The escrow source code remains public and available for review. The privacy goal concerns the connection between a deployed contract and the source template or tool that produced it. Users and the parties they share verification data with can still check that the deployed contract matches the expected escrow.

Diversification and camouflage are separate requirements. Variants should differ from the original compiled contract and from one another. They should also avoid shared patterns that reveal Azoth itself. Producing different bytecode alone does not establish that the outputs blend into other unverified contracts.

How Azoth Works

When you compile a Solidity contract, the compiler produces EVM bytecode: the low-level instructions the Ethereum Virtual Machine executes. Azoth transforms this compiled bytecode in three stages.

Stage 1: Analysis

Azoth decodes the raw bytecode into individual instructions and builds a control flow graph (CFG). This graph represents execution paths and jumps between blocks of instructions, giving Azoth a structured view of the contract before it applies transformations.

Stage 2: Transformation

Azoth applies transforms that change the bytecode's structure while preserving the contract's behavior. Examples include:

  • Function dispatcher variation: changes the structure used to route function calls.
  • Control flow shuffling: changes the order of code blocks while maintaining correct jump targets.

The seed guides these transformations so that the resulting variant can be reproduced for verification.

Stage 3: Reassembly and Validation

Azoth reassembles the transformed graph into executable bytecode. It checks for semantic equivalence: the transformed contract must preserve the original contract's behavior.

Validation includes structural checks and formal verification using SMT solvers. Azoth rejects output when these checks find a mismatch. These checks address correctness; camouflage requires a separate assessment of how recognizable the output is.

Why Determinism Matters

With the same Azoth version and settings, the same input bytecode and seed produce exactly the same output. Different seeds allow variation between deployments while keeping each variant reproducible.

When a user creates a Mirage escrow, their client generates the seed used for Azoth's transformation. The seed is private by default. The user and anyone they share it with can verify a deployment:

  1. Take the public escrow contract source code.
  2. Compile it with the same compiler version and settings used for the deployment.
  3. Run the bytecode through the same Azoth version and settings with the same seed.
  4. Compare the result with the deployed bytecode.

A match confirms that the deployed bytecode is the expected escrow variant.

Evaluating Camouflage

Camouflage is a privacy objective whose effectiveness needs to be measured. Evaluation should compare Azoth outputs with representative unverified Ethereum contracts and test whether observers can recognize the original escrow template or identify patterns shared by Azoth variants. Differences between individual bytecode samples are only part of that assessment.

Bytecode is also only part of what an observer can inspect. Deployment patterns, gas usage, and transaction behavior can provide additional signals. Mirage combines Azoth with the other mechanisms described in the technical model, and supports independent analysis through researcher grants.