Skip to content
Akinbola0xKENZMAN
Work/Privacy & cryptography
Stellar

UltraHonk verification on Soroban

Verifying Noir proofs inside a Stellar smart contract.

Role
Integrator
When
May 2026 – now
Team
Solo
Stack
Rust, Soroban SDK, UltraHonk

Overview

A Soroban contract stores the verification key once at deploy time and verifies UltraHonk proofs against it, returning typed errors. Veilum's pool and Clash's game call it to accept private transfers and hidden moves.

The code

packages/contracts/rs-soroban-ultrahonk/src/lib.rsView on GitHub ↗
#[contractimpl]
impl UltraHonkVerifierContract {
    /// Initialize the on-chain VK once at deploy time.
    pub fn __constructor(env: Env, vk_bytes: Bytes) -> Result<(), Error> {
        env.storage().instance().set(&Self::key_vk(), &vk_bytes);
        Ok(())
    }

    /// Verify an UltraHonk proof using the stored VK.
    pub fn verify_proof(env: Env, public_inputs: Bytes, proof_bytes: Bytes) -> Result<(), Error> {
        if proof_bytes.len() as usize != PROOF_BYTES {
            return Err(Error::ProofParseError);
        }
        let vk_bytes: Bytes = env.storage().instance().get(&Self::key_vk()).ok_or(Error::VkNotSet)?;
        let verifier = UltraHonkVerifier::new(&env, &vk_bytes).map_err(|_| Error::VkParseError)?;
        verifier.verify(&proof_bytes, &public_inputs).map_err(|_| Error::VerificationFailed)?;
        Ok(())
    }
}

How it works

  1. The VK is set in the constructor and read from instance storage
  2. Proof length is checked before parsing, and every failure maps to a contract error code
  3. The same verifier is reused across Veilum and Clash

Part of

Stack

RustSoroban SDKUltraHonk