⚙️ CAIRO RUNE DIFFICULTY: Apprentice Behavioral

The Template Method

Defining the unchangeable skeleton of a STARK proof.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Template Method
ARCANUM SCHOOL: Abjuration // Blueprinting
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CAIRO PATTERN //
trait IProofSkeleton {
    fn setup() -> felt252;
    fn compute_trace() -> felt252;
    fn generate_proof() -> felt252 {
        let s = Self::setup();
        let t = Self::compute_trace();
        s + t
    }
}

impl StandardSkeleton of IProofSkeleton {
    fn setup() -> felt252 { 'setup' }
    fn compute_trace() -> felt252 { 'trace' }
}

Lays down the immutable laws of proof generation, while leaving specific rituals to be filled in by subclasses.

Runic Tags: #cairo #design-pattern #template-method