Core

Cryptographic Proofs for State Synchronization

19 Jun 2025 · 11 min read

Oraclizer’s state synchronization is implemented through a sophisticated cryptographic proof system based on Zero-Knowledge Proofs. By selectively utilizing zk-SNARK and zk-STARK proof systems depending on the situation, we mathematically guarantee the validity of state transitions between on-chain and off-chain environments. These cryptographic proofs go beyond simple data verification to provide both State Consistency and Transition Integrity simultaneously, while enabling the economic feasibility of large-scale state synchronization through verification cost optimization via the zkVerify network.

TL;DR

Oraclizer’s state synchronization is implemented through a cryptographic proof system based on Zero-Knowledge Proofs. By selectively utilizing zk-SNARK and zk-STARK proof systems depending on the situation, we mathematically guarantee the validity of state transitions between on-chain and off-chain environments. These cryptographic proofs go beyond simple data verification to provide both State Consistency and Transition Integrity simultaneously, while enabling the economic feasibility of large-scale state synchronization through verification cost optimization via the zkVerify network.

In our previous articles, we explored the core components of the Oracle State Machine and the operational mechanism of the D-quencer algorithm. Now, let’s delve into the world of cryptographic proofs that form the mathematical foundation of this entire system.

The most fundamental challenge in state synchronization is answering this essential question: “How can we mathematically prove that a state change in an external system truly occurred and that the change is valid?”

This goes beyond simply verifying “if the data is correct.” We need to prove that the evolution process of the state itself has been carried out correctly according to the rules.

The Necessity of Cryptographic Proofs: Mathematical Implementation of Trust

The fundamental limitation that traditional oracle systems face lies in the centralization of their trust model. When importing external data, they start from the premise that “this data source must be trusted.” However, in complete state synchronization, such a simple trust model is insufficient.

Important note: State synchronization must mathematically guarantee the integrity of state transition patterns over time, not just the verification of single data points.

Mathematical Modeling of State Transitions

In Oraclizer, state synchronization is modeled with the following mathematical structure:

Proving that the transition S(t) → S(t+1) is valid

The key here is not simply whether S(t+1) is the correct value, but proving that the transition itself from S(t) to S(t+1) followed system rules.

To achieve this, we define the following state transition function:

\(\displaystyle f: S \times E \times C \rightarrow S'\)

Where:

  • S: Current State
  • E: Set of External Events
  • C: Set of Constraints
  • S’: New State

The goal of cryptographic proof is to prove, in zero-knowledge, that this function f has been correctly executed.

Implementation of Zero-Knowledge Proofs: zk-SNARK vs zk-STARK

Oraclizer selectively utilizes two proof systems (zk-SNARK and zk-STARK) depending on the situation. Let’s examine the mathematical reasons why this selective approach is necessary.

Proof flow The transition is proved off-chain with a private witness; only the proof and public inputs reach the verifier, and a valid proof moves the on-chain state.
Proof flow from the off-chain state to the on-chain state On the prover side, off-chain, the off-chain state S(t), a map of asset id to value, comes with external events E, regulatory constraints C and private data w. The state transition f maps S times E times C to the new state S prime under validation rules, a compliance check and privacy preservation. ZK proof generation computes pi = Prove(pp, x, w), selects zk-SNARK or zk-STARK, proves incrementally and optimizes batches. The proof is made by one of two systems: zk-SNARK, succinct proofs, fast to verify, elliptic curve based, requiring a trusted setup, gas efficient; or zk-STARK, larger proofs, quantum resistant, hash function based, with no trusted setup, transparent. Both lead to the zkVerify network on the verifier side, which computes Verify(pp, x, pi) to 0 or 1 from the public input and the proof only, with parallel verification (mu greater than 1), specialized circuits (eta greater than 1) and batching at about 91 percent lower gas. When Verify(pi) is true the on-chain state moves to S(t + 1): verified, public commitment, state root updated, cross-chain sync. A dashed arrow from S(t) to S(t + 1) marks the transition as cryptographically valid, with completeness, soundness and zero knowledge of w. Prove · off-chain Verify · on-chain cryptographically valid completeness ∧ soundness ∧ zero knowledge of w Off-chain stateS(t) = {asset_id: value}E: external eventsC: regulatory constraintsw: private data State transitionf: S × E × C → S′validation rulescompliance checkprivacy preservation ZK proof generationπ = Prove(pp, x, w)SNARK/STARK selectionincremental provingbatch optimization zk-SNARKsuccinct proofsfast verificationelliptic curve basedrequires trusted setupgas efficient zk-STARKlarger proofsquantum resistanthash function basedno trusted setuptransparent zkVerify networkVerify(pp, x, π) → {0, 1}parallel verification, μ > 1specialized circuits, η > 1batch: ≈ 91% lower gas Verify(π) = true On-chain stateS(t + 1) verifiedpublic commitmentstate root updatedcross-chain sync
Off-chain stateS(t) = {asset_id: value}E: external eventsC: regulatory constraintsw: private data
State transitionf: S × E × C → S′validation rulescompliance checkprivacy preservation
ZK proof generationπ = Prove(pp, x, w)SNARK/STARK selectionincremental provingbatch optimization
zk-SNARKsuccinct proofsfast verificationelliptic curve basedrequires trusted setupgas efficient
zk-STARKlarger proofsquantum resistanthash function basedno trusted setuptransparent
zkVerify networkVerify(pp, x, π) → {0, 1}parallel verification, μ > 1specialized circuits, η > 1batch: ≈ 91% lower gas
On-chain stateS(t + 1) verifiedpublic commitmentstate root updatedcross-chain sync
S(t) → S(t + 1)cryptographically valid: completeness ∧ soundness ∧ zero knowledge of w
Figure 1Cryptographic Proof Flow for Oracle State Synchronization

zk-SNARK Based Proofs

zk-SNARK (Zero-Knowledge Succinct Non-Interactive Argument of Knowledge) is based on elliptic curve cryptography and features excellent gas efficiency due to its small proof size.

In Oraclizer, zk-SNARK proofs have the following mathematical structure:

$$\pi_{SNARK} = \text{Prove}(pp, x, w)$$

Where:

  • pp: Public Parameters (generated from a trusted setup)
  • x: Public Input (public information about the state transition)
  • w: Witness (private information about the state transition)
  • π_SNARK: The generated proof

Concrete application in the context of state synchronization:

// zk-SNARK based state transition proof example
struct StateTransitionProof {
    bytes32 previousStateRoot;    // part of x
    bytes32 newStateRoot;        // part of x  
    bytes proof;                 // π_SNARK
    uint256 timestamp;           // part of x
}

function verifyStateTransition(
    StateTransitionProof calldata proofData
) external view returns (bool) {
    // zk-SNARK verification: Verify(pp, x, π) → {0,1}
    return snarkVerifier.verifyProof(
        proofData.proof,
        [proofData.previousStateRoot, 
         proofData.newStateRoot, 
         proofData.timestamp]
    );
}

zk-STARK Based Proofs

zk-STARK (Zero-Knowledge Scalable Transparent Argument of Knowledge) is based on hash functions, providing quantum resistance and eliminating the need for a trusted setup.

$$\pi_{STARK} = \text{Prove}_{STARK}(\mathcal{C}, x, w)$$

Where:

  • C: Computation Circuit
  • x, w: Same as in zk-SNARK
  • π_STARK: STARK proof (larger in size but provides transparency)

Oraclizer’s selective utilization strategy:

# Proof system selection logic (pseudocode)
def select_proof_system(state_transition):
    if state_transition.criticality == "HIGH":
        # Choose STARK for high security requirements
        return ProofSystem.ZK_STARK
    elif state_transition.gas_optimization == "PRIORITY":
        # Choose SNARK when gas efficiency is a priority  
        return ProofSystem.ZK_SNARK
    elif state_transition.quantum_resistance == "REQUIRED":
        # Choose STARK when quantum resistance is needed
        return ProofSystem.ZK_STARK
    else:
        # Use SNARK by default
        return ProofSystem.ZK_SNARK
Proof system selection Three checks run in a fixed order and the first match decides; a transition that matches none gets zk-SNARK by default.
Proof system selection by three checks in order A state transition request goes through three checks in a fixed order, and the first match decides. Security criticality: if HIGH, zk-STARK for maximum security, quantum resistant, with a larger proof size. If LOW or MEDIUM, gas priority: if YES, zk-SNARK, gas efficient, fast verification, small proof size. If NO, quantum resistance: if YES, zk-STARK, post-quantum, no trusted setup, transparent. If NO, zk-SNARK by default: default choice, balanced performance, production ready. The approach is a hybrid one: context-adaptive, optimal performance, cost-effective. State transition request Security criticality? HIGH zk-STARKmaximum security · quantum resistantlarger proof size Gas priority? YES zk-SNARKgas efficient · fast verificationsmall proof size Quantum resistance? YES zk-STARKpost-quantum · no trusted setuptransparent LOW or MEDIUM NO NO zk-SNARKdefault choice · balanced performanceproduction ready Hybrid approach context-adaptive · optimal performance cost-effective Proof system selection by three checks in order A state transition request goes through three checks in a fixed order, and the first match decides. Security criticality: if HIGH, zk-STARK for maximum security, quantum resistant, with a larger proof size. If LOW or MEDIUM, gas priority: if YES, zk-SNARK, gas efficient, fast verification, small proof size. If NO, quantum resistance: if YES, zk-STARK, post-quantum, no trusted setup, transparent. If NO, zk-SNARK by default: default choice, balanced performance, production ready. The approach is a hybrid one: context-adaptive, optimal performance, cost-effective. Hybrid approach context-adaptive · optimal performance cost-effective State transition request Security criticality? HIGH zk-STARKmaximum security · quantum resistantlarger proof size LOW or MEDIUM Gas priority? YES zk-SNARKgas efficient · fast verificationsmall proof size NO Quantum resistance? YES zk-STARKpost-quantum · no trusted setuptransparent NO zk-SNARKdefault choice · balanced performanceproduction ready
Figure 2Dynamic Proof System Selection Algorithm

Advanced Cryptographic Techniques for Ensuring State Consistency

Beyond simple state transition proofs, Oraclizer implements advanced cryptographic techniques to ensure state consistency over time.

Merkle Tree Based State Commitments

All states are managed in a Sparse Merkle Tree structure, and each state change is represented as a change in the tree’s root hash:

$$\text{StateRoot}_{t+1} = \text{UpdateMerkleRoot}(\text{StateRoot}_t, \text{Changes})$$

The key point here is that the validity of the entire state transition can be verified with proofs of only the changed leaf nodes:

$$\text{Proof}_{\text{minimal}} = \{\text{path}_i, \text{sibling}_i\}_{i \in \text{Changed Nodes}}$$

Merkle tree state changes A change to one asset rewrites only the path from its leaf to the root, and the proof carries that path and its siblings.
A change rewrites one root-to-leaf path Two copies of a sparse Merkle tree with a root, two internal nodes and four leaves. At state t nothing is marked; the leftmost leaf holds asset A. The change Delta 1, asset A changed, applied with UpdateMerkleRoot, gives state t + 1, where only three nodes changed: the leaf A, its parent and the root, Root star, which form one path from the leaf to the root. The two siblings along that path, the second leaf and the right internal node, are drawn dashed: they go into the proof. The other two leaves are unchanged. State t Root A Δ1: asset A changed UpdateMerkleRoot State t + 1 only 3 nodes changed Root* A rewritten path sibling: in the proof unchanged A change rewrites one root-to-leaf path Two copies of a sparse Merkle tree with a root, two internal nodes and four leaves. At state t nothing is marked; the leftmost leaf holds asset A. The change Delta 1, asset A changed, applied with UpdateMerkleRoot, gives state t + 1, where only three nodes changed: the leaf A, its parent and the root, Root star, which form one path from the leaf to the root. The two siblings along that path, the second leaf and the right internal node, are drawn dashed: they go into the proof. The other two leaves are unchanged. State t Root A Δ1: asset A changed UpdateMerkleRoot State t + 1 only 3 nodes changed Root* A rewritten path sibling: in the proof unchanged
Figure 3Merkle Tree State Changes

Incremental Proving Mechanism

One of Oraclizer’s innovations is the incremental proving technique. Instead of proving the entire state anew each time, we reuse previous proofs to prove only the new changes:

$$\pi_{t+1} = \text{IncrementalProve}(\pi_t, \text{StateDiff}_{t \rightarrow t+1})$$

This satisfies the following mathematical property:

$$\text{Verify}(\pi_t) = true \land \text{Verify}(\pi_{t+1}) = true \Rightarrow \text{StateTransition}(S_t \rightarrow S_{t+1}) \text{ is valid}$$

Incremental proving · illustrative run After one full proof, each update proves only its difference on top of the previous proof, so each later proof costs a fraction of a full one.
Incremental proof chain and the cost of each proof An illustrative run of four updates on a time axis t, t + 1, t + 2, t + 3. At t the initial state S0, a full Merkle tree with root 0x1a2b, is proved in full: pi 0 = Prove(S0), cost 100 percent of a full proof. At t + 1, Delta 1, asset A changed, root 0x3c4d: pi 1 = IncrProve(pi 0, Delta 1), cost 15 percent. At t + 2, Delta 2, asset B changed, root 0x5e6f: pi 2 = IncrProve(pi 1, Delta 2), 12 percent. At t + 3, Delta 3, asset C changed, root 0x7a8b: pi 3 = IncrProve(pi 2, Delta 3), 10 percent. Each proof is built from the previous one, drawn as a chain pi 0 to pi 3. Outlined bars show a traditional oracle that proves in full at every update, 100 percent times n transactions; filled bars show the incremental oracle, O(log n) per update. Formula: pi t+1 = IncrementalProve(pi t, StateDiff from t to t+1). Cost of pi t+1 = Cost(Delta) + O(log n), much less than the cost of a full proof of S t+1; efficiency gain: reduction 1 - (log n)/n. π0 Prove(S0) π1 IncrProve(π0, Δ1) π2 IncrProve(π1, Δ2) π3 IncrProve(π2, Δ3) Proving cost 100% 50% 0% 100% 15% 12% 10% time t Initial state S0 full Merkle tree root 0x1a2b… t + 1 State S1 Δ1: asset A changed root 0x3c4d… t + 2 State S2 Δ2: asset B changed root 0x5e6f… t + 3 State S3 Δ3: asset C changed root 0x7a8b… Incremental oracle: O(log n) per update Traditional oracle: 100% × n transactions πt+1 = IncrementalProve(πt, StateDifft → t+1) Cost(πt+1) = Cost(Δ) + O(log n) ≪ Cost(FullProve(St+1)) efficiency gain: reduction 1 − (log n)/n Incremental proof chain and the cost of each proof An illustrative run of four updates on a time axis t, t + 1, t + 2, t + 3. At t the initial state S0, a full Merkle tree with root 0x1a2b, is proved in full: pi 0 = Prove(S0), cost 100 percent of a full proof. At t + 1, Delta 1, asset A changed, root 0x3c4d: pi 1 = IncrProve(pi 0, Delta 1), cost 15 percent. At t + 2, Delta 2, asset B changed, root 0x5e6f: pi 2 = IncrProve(pi 1, Delta 2), 12 percent. At t + 3, Delta 3, asset C changed, root 0x7a8b: pi 3 = IncrProve(pi 2, Delta 3), 10 percent. Each proof is built from the previous one, drawn as a chain pi 0 to pi 3. Outlined bars show a traditional oracle that proves in full at every update, 100 percent times n transactions; filled bars show the incremental oracle, O(log n) per update. Formula: pi t+1 = IncrementalProve(pi t, StateDiff from t to t+1). Cost of pi t+1 = Cost(Delta) + O(log n), much less than the cost of a full proof of S t+1; efficiency gain: reduction 1 - (log n)/n. π0 100% Prove(S0) t · Initial state S0 full Merkle tree · root 0x1a2b… π1 15% IncrProve(π0, Δ1) t + 1 · State S1 Δ1: asset A changed · root 0x3c4d… π2 12% IncrProve(π1, Δ2) t + 2 · State S2 Δ2: asset B changed · root 0x5e6f… π3 10% IncrProve(π2, Δ3) t + 3 · State S3 Δ3: asset C changed · root 0x7a8b… 0% 50% 100% Proving cost Incremental oracle: O(log n) per update Traditional oracle: 100% × n transactions πt+1 = IncrementalProve(πt, StateDifft → t+1) Cost(πt+1) = Cost(Δ) + O(log n) ≪ Cost(FullProve(St+1)) efficiency gain: reduction 1 − (log n)/n
Figure 4Incremental Proving Mechanism for State Synchronization

Batch Verification Optimization

When processing multiple state transitions at once, Oraclizer uses batch verification techniques:

$$\pi_{batch} = \text{AggregatePf}(\{\pi_1, \pi_2, …, \pi_n\})$$

In this case, the verification cost is significantly lower than the sum of individual proof verifications:

$$\text{Cost}(\text{Verify}(\pi_{batch})) \ll \sum_{i=1}^{n} \text{Cost}(\text{Verify}(\pi_i))$$

zkVerify Integration: Mathematical Optimization of Verification Costs

The integration of Horizen Labs’ zkVerify network has special significance in the Oraclizer architecture. It’s not merely about reducing verification costs, but modularizing and parallelizing the verification process itself.

Mathematical Modeling of Verification Cost Function

Let’s denote the traditional on-chain verification cost as C_onchain(n) and the verification cost through zkVerify as C_zkVerify(n):

$$C_{\text{onchain}}(n) = \alpha \cdot n + \beta \cdot \log(n) + \gamma$$

$$C_{\text{zkVerify}}(n) = \frac{\alpha \cdot n}{\eta} + \frac{\beta \cdot \log(n)}{\mu} + \delta$$

Where:

  • η > 1: Hardware optimization coefficient
  • μ > 1: Parallel processing improvement coefficient
  • δ < γ: zkVerify’s basic overhead (lower)

Actual cost reduction effect:

# zkVerify cost reduction calculation (pseudocode)
def calculate_cost_reduction(num_proofs, proof_complexity):
    traditional_cost = num_proofs * proof_complexity * GAS_PER_VERIFICATION

    # Batch processing via zkVerify
    batch_cost = (
        ZKVERIFY_SETUP_COST + 
        (num_proofs * proof_complexity) / OPTIMIZATION_FACTOR
    )

    reduction_percentage = (
        (traditional_cost - batch_cost) / traditional_cost
    ) * 100

    return reduction_percentage

# Example: Processing 1000 proofs in batch
cost_reduction = calculate_cost_reduction(1000, SNARK_COMPLEXITY)
# Result: Approximately 91% cost reduction

Privacy-Preserving State Synchronization

Achieving both regulatory compliance and privacy protection during the state synchronization process is a challenging problem. Oraclizer combines advanced cryptographic techniques to address this challenge.

Selective Disclosure Protocol

Selective disclosure mechanism combined with the OCID (Oracle Contract ID) system:

$$\text{Disclosure}(\text{State}, \text{ViewerLevel}) = \text{Filter}(\text{State}, \text{Permissions}[\text{ViewerLevel}])$$

This is implemented with the following zero-knowledge proof:

Note: “This state transition satisfies regulatory requirements, and the information you can see is accurate. However, the complete transaction details are not disclosed.”

Regulatory Compliance Proof Circuit

Circuit proving that a state transition satisfies RCP requirements:

Circuit RegulatorCompliance(
    public: regulation_id, asset_type
    private: transaction_details, kyc_data
) {
    // 1. KYC verification
    assert(verify_kyc(kyc_data))

    // 2. Transaction limit check
    assert(transaction_details.amount <= get_limit(asset_type))

    // 3. Blacklist check
    assert(!is_blacklisted(transaction_details.parties))

    // 4. Regional regulation check
    assert(complies_with_region(regulation_id, transaction_details))
}

Proofs generated through this circuit ensure regulatory compliance while protecting the privacy of transaction details.

Complexity and Solutions in Actual Implementation

Concurrency Issues in State Synchronization

Maintaining consistency while preserving performance when state changes occur simultaneously across multiple chains is a very difficult problem.

Vector Clock-based order determination:

$$\text{GlobalOrder}(e_1, e_2) = \text{Compare}(\text{VectorClock}(e_1), \text{VectorClock}(e_2))$$

Cryptographic consensus for conflict resolution:

# State conflict resolution protocol (pseudocode)
def resolve_state_conflicts(conflicting_states):
    # 1. Generate priority proof for each state
    priorities = []
    for state in conflicting_states:
        priority_proof = generate_priority_proof(
            state.timestamp,
            state.source_authority,
            state.transaction_fee
        )
        priorities.append((state, priority_proof))

    # 2. Determine final state through cryptographic verification
    verified_priorities = [
        (state, proof) for state, proof in priorities 
        if verify_priority_proof(proof)
    ]

    # 3. Select state with highest priority
    final_state = max(verified_priorities, key=lambda x: x[1].priority)

    return final_state[0]

Performance Optimization of Proof Generation

Proof generation time is a significant bottleneck in large-scale state synchronization. Oraclizer uses the following optimization techniques:

Parallel proof generation:

$$\text{Time}_{\text{parallel}} = \frac{\text{Time}_{\text{sequential}}}{N_{\text{cores}}} + \text{Overhead}_{\text{coordination}}$$

Predictive proof caching:

class PredictiveProofCache:
    def __init__(self):
        self.cache = LRUCache(maxsize=10000)
        self.predictor = StateTransitionPredictor()

    async def get_proof(self, state_transition):
        # 1. Check cache
        if self.cache.has(state_transition.hash):
            return self.cache.get(state_transition.hash)

        # 2. Check predicted proofs
        predicted_transitions = self.predictor.predict_next_states(
            state_transition.current_state
        )

        for predicted in predicted_transitions:
            if predicted.matches(state_transition):
                # Found a predicted proof
                return self.cache.get(predicted.hash)

        # 3. Generate new proof
        new_proof = await self.generate_proof(state_transition)
        self.cache.set(state_transition.hash, new_proof)

        return new_proof

Future Directions: Quantum Resistance and Post-Quantum Cryptography

Current elliptic curve-based cryptography may be vulnerable to quantum computer threats. Oraclizer is preparing for a transition to Post-Quantum cryptographic proof systems to address this.

Lattice-Based Proof Systems

Quantum-resistant proofs based on NTRU lattices:

$$\text{Proof}_{\text{PQ}} = \text{LatticeBased}(\text{Statement}, \text{Witness}, \text{LatticeParams})$$

Integration with Hash-Based Signatures

State proofs combined with Merkle Signature Scheme:

$$\text{HashBasedProof} = \{\text{MerkleAuth}, \text{OneTimeSign}(\text{StateTransition})\}$$

Conclusion: Implementation of Mathematical Trust

Oraclizer’s state synchronization goes beyond simple “data transfer” to implement mathematically verifiable trust. Through zero-knowledge proofs, we have achieved:

  • Privacy preservation: Proving validity without disclosing sensitive information
  • Scalability: Dramatically reducing verification costs through zkVerify
  • Interoperability: Selective utilization of various proof systems
  • Regulatory compliance: Transparent proof systems that satisfy RCP requirements

The rollback mechanisms and smart contract integration of the state machine that we will explore next are higher-level functions built upon this cryptographic foundation. When the foundation of mathematical trust is solid, all innovations built on top of it can have meaning.

This article describes technology under active research and development. Specifications, interfaces and implementation details may change as research, testing and community feedback progress, and performance figures are theoretical analyses or design targets unless stated otherwise.


References

[1]. Groth, J. (2016). On the Size of Pairing-based Non-interactive Arguments. https://eprint.iacr.org/2016/260.pdf

[2]. Ben-Sasson, E., Bentov, I., Horesh, Y., & Riabzev, M. (2018). Scalable, transparent, and post-quantum secure computational integrity. https://eprint.iacr.org/2018/046.pdf

[3]. Bitansky, N., Canetti, R., Chiesa, A., & Tromer, E. (2012). From extractable collision resistance to succinct non-interactive arguments of knowledge, and back again. https://eprint.iacr.org/2011/443.pdf

[4]. Horizen Labs. (2024). zkVerify: Modular ZK Proof Verification Network. https://zkverify.io/

[5]. Goldwasser, S., Micali, S., & Rackoff, C. (1989). The knowledge complexity of interactive proof systems. SIAM Journal on Computing, 18(1), 186-208.

[6]. Maller, M., Bowe, S., Kohlweiss, M., & Meiklejohn, S. (2019). Sonic: Zero-Knowledge SNARKs from Linear-Size Universal and Updatable Structured Reference Strings. https://eprint.iacr.org/2019/099.pdf

Subscribe

New research, by email.

  • One email when a new article is published
  • Confirm once, leave with one click
  • Privacy