Efficient RAM and control flow in verifiable outsourced computation

Riad S. Wahby, Srinath T. V. Setty, Zuocheng Ren, Andrew J. Blumberg, Michael Walfish

TL;DR

Buffet is a breakthrough system for verifiable outsourced computation that dramatically reduces the cost of handling RAM and dynamic control flow. By hybridizing two previous state-of-the-art approaches and introducing "loop flattening," Buffet achieves performance gains of 1 to 3 orders of magnitude while supporting nearly the entire C programming language.

What Problem Does This Paper Address?

In the world of cloud computing, how do you know a server actually ran your code correctly without re-running it yourself? Verifiable Computation (VC) uses cryptographic proofs to solve this. However, translating high-level code (like C) into the "arithmetic circuits" (systems of equations) required for these proofs is notoriously difficult.

Previous systems faced a "pick your poison" trade-off:

  1. The "ASIC" Approach (e.g., Pantry): Compiles code line-by-line. It's very fast for math but incredibly slow for RAM operations (using expensive cryptographic hashes) and can't handle loops with dynamic bounds.
  2. The "CPU" Approach (e.g., BCTV): Simulates a whole MIPS-like CPU inside the proof. It handles RAM and complex loops easily, but you pay a massive "CPU tax" on every single instruction, even simple additions.

Methods

The authors introduce Buffet, which finds the "sweet spot" between these two extremes through two primary innovations:

  • Hybrid RAM Model: Buffet adopts the "line-by-line" efficiency of Pantry for standard logic but "grafts" on the elegant RAM abstraction from BCTV. Instead of using expensive hashes for every memory access, it uses permutation networks. This allows the system to provide "a la carte" RAM: you only pay for memory operations when you actually use them, and the cost per operation is much lower.
  • Loop Flattening: To handle dynamic control flow (like if statements, break, continue, and loops with data-dependent bounds), Buffet adapts techniques from the compiler literature. It transforms complex, nested C loops into a single, flat state machine. This state machine can be unrolled into a fixed number of steps (a "bound" provided by the programmer), allowing the proof system to handle code that was previously impossible to verify efficiently.

Datasets

The authors evaluated Buffet using a diverse suite of algorithmic benchmarks that represent common computational tasks:

  • Straight-line math: Matrix multiplication, PAM clustering, Fannkuch.
  • RAM-intensive: Pointer chasing, Merge sort, Boyer-Moore table generation.
  • Data-dependent control flow: Knuth-Morris-Pratt (KMP) search, RLE decoding, Sparse matrix-vector multiplication.

These benchmarks were used to compare Buffet against its predecessors, Pantry and BCTV.

Key Insights and Ideas

  • Breaking the Abstraction Barrier: The "aha moment" was realizing that BCTV's efficient RAM checking wasn't tied to its simulated CPU. By lifting that technique and applying it to a line-by-line compiler, they eliminated the "CPU tax" while keeping the "RAM discount."
  • Control Flow as a State Machine: Arithmetic circuits are inherently static. By treating a C program as a state machine and "flattening" its execution, the authors proved that you don't need a full CPU simulation to handle complex C constructs like break or continue.
  • Compiler Optimizations Matter: Buffet applies classical compiler optimizations (like load-store elimination) specifically to reduce the number of constraints in the proof. In the context of VC, a few lines of code saved by the compiler can translate to hours of saved Prover time.

Key Results

  • Massive Speedups: Buffet outperforms BCTV by 1–2 orders of magnitude for RAM-heavy operations and 1–3 orders of magnitude for programs with complex, data-dependent loops.
  • Parity with the Best: For simple mathematical tasks, Buffet matches the performance of Pantry, meaning there is no "penalty" for using Buffet's more flexible system.
  • Broad Language Support: Buffet supports an expansive subset of C, disallowing only goto and function pointers. This makes it the most "programmable" high-performance VC system in the literature at the time of publication.
  • Scalability: Buffet can handle computations resulting in up to 10 million constraints, limited primarily by the memory of the testbed machines.

Limitations and Future Work

  • Prover Overhead: Despite the massive improvements, the "Prover" (the server) still incurs a significant cost—often millions of times slower than native execution. This remains the primary hurdle for widespread adoption.
  • Non-Universal Circuits: Unlike BCTV, which uses a "universal" circuit (one circuit for any program of length $t$), Buffet generates a custom circuit for every program. This means if the program changes, the Verifier must perform a new, expensive "setup" phase.
  • Function Pointers: The current architecture cannot easily handle function pointers or object-oriented dispatch tables, as these require a software-controlled program counter that Buffet lacks. The authors suggest that future work could map higher-level language features (like those in Rust or Haskell) to Buffet's model to overcome this.

Summary updated

BibTeX
@inproceedings{wahby2015efficient,
  author = {Riad S. Wahby and Srinath T. V. Setty and Zuocheng Ren and Andrew J. Blumberg and Michael Walfish},
  title = {{Efficient RAM and control flow in verifiable outsourced computation}},
  booktitle = {NDSS},
  year = {2015},
  url = {https://openreview.net/forum?id=cifMEMMblZ},
}
Figure