Skip to content
hyperpolymath edited this page Aug 8, 2026 · 1 revision

API Internals

Svalinn's internal APIs are designed for zero-copy data processing and minimal overhead.

The Transit Buffer

At the core of the internal API is the TransitBuffer. This is a custom memory allocator that ensures memory is zeroed out immediately upon deallocation, preventing data remanence attacks.

pub trait TransitBuffer {
    fn allocate(size: usize) -> Result<Self, AllocError>;
    fn secure_zero(&mut self);
}

The Proving Engine API

The proving engine exposes a low-level FFI boundary for interacting with the ZK-SNARK circuits.

  • prove_ingress(payload, policy): Generates a proof that the payload satisfies the policy.
  • verify_ingress(proof, public_inputs): Fast verification of an incoming proof.

These APIs are asynchronous and utilize io_uring on Linux for maximum throughput. Do not use blocking calls within the proving engine tasks.

Clone this wiki locally