The Composite
Aggregating STARK proofs into recursive trees.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Composite
ARCANUM SCHOOL: Transmutation // Amalgamation
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CAIRO PATTERN //
#[derive(Drop)]
enum ProofNode {
Leaf: felt252,
Composite: Array<ProofNode>,
}
trait IProofVerifier {
fn verify(self: @ProofNode) -> bool;
}
impl ProofVerifierImpl of IProofVerifier {
fn verify(self: @ProofNode) -> bool {
match self {
ProofNode::Leaf(val) => true,
ProofNode::Composite(nodes) => {
// Recursive verification logic
true
},
}
}
}
Treat recursive proofs and singular leaves alike, forming a grand tree of STARK verifications.
Runic Tags:
#cairo
#design-pattern
#composite