Skip to content

[CORE] Implement Loop-Unrolled Validator Signature Set Verifier in Yul #696

Description

@mijinummi

Labels:* high-difficulty, yul, cryptography, gasguard
Difficulty: High
Module: contracts/crypto/


🧠 Concept

Develop a threshold signature set verifier in Yul that uses loop unrolling techniques for fixed validator set sizes ($k$-of-$n$) to eliminate loop counter overhead.

⚠️ Problem

Iterating over signature verification loops using standard for loops incurs loop counter increments, boundary checks, and dynamic stack management gas on every iteration.

📁 Implementation Scope

  • contracts/crypto/UnrolledSignatureVerifier.sol
  • test/crypto/UnrolledSignatureVerifier.test.ts

🛠️ Requirements

  1. Unroll signature validation checks for common consensus thresholds (e.g., 3-of-5, 5-of-7) using inline Yul assembly.
  2. Execute ecrecover calls inline with direct stack-based address comparisons.

🎯 Acceptance Criteria

  • Eliminates loop management gas overhead during threshold signature verification.
  • Correctly verifies signature quorums and rejects invalid or duplicate signatures.

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions