mirror of
https://github.com/logos-co/lambda-prize.git
synced 2026-08-31 03:21:07 +00:00
improvements
This commit is contained in:
@@ -38,7 +38,8 @@ All prizes live in the `[prizes/](prizes/)` directory. Each prize is a markdown
|
||||
| [LP-0012](prizes/LP-0012.md) | Event/Log mechanism | Large | Open |
|
||||
| [LP-0013](prizes/LP-0013.md) | Token program improvements (authorities) | Medium | Open |
|
||||
| [LP-0014](prizes/LP-0014.md) | Token program improvements (ATAs + wallet tooling) | Medium | Closed |
|
||||
| [LP-0015](prizes/LP-0015.md) | General cross-program calls via tail calls | Large | Open |
|
||||
| [LP-0015](prizes/LP-0015.md) | General cross-program calls via tail calls | Large | Open |
|
||||
| [LP-0016](prizes/LP-0016.md) | Adversarial testing/fuzzing infrastructure | Large | Draft |
|
||||
|
||||
### Proposing a New Prize
|
||||
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
# LP-0016: Adversarial testing/fuzzing infrastructure: stress-test the protocol under hostile inputs
|
||||
|
||||
**`Logos Circle: <N/A>`**
|
||||
|
||||
## Overview
|
||||
This prize is for building a *repeatable adversarial testing + fuzzing framework* that continuously stress-tests the protocol implementation to uncover edge cases: crashes/panics, invariant violations, inconsistent state transitions, and (where applicable) sequencer vs replayer divergences.
|
||||
|
||||
The deliverable should make it easy for contributors to add new fuzz targets, generate hostile inputs, reproduce failures deterministically, and minimise failing cases into small regression tests. Coverage-guided fuzzing tools such as *libFuzzer* (commonly used via *cargo-fuzz* in Rust) are well-suited to automatically explore large input spaces and evolve a corpus to maximise code coverage.
|
||||
|
||||
## Motivation
|
||||
Manual testing cannot reasonably cover the full input space of a protocol: transaction decoding, boundary sizes, invalid state combinations, ordering/pathological sequences, and resource exhaustion behaviours. A dedicated fuzzing and adversarial testing harness finds bugs that conventional unit tests miss—especially those caused by malformed inputs and weird state transitions.
|
||||
|
||||
A competitive prize is appropriate because different teams can optimise for different strengths (coverage vs performance, stateful vs stateless fuzzing, differential testing, minimisation quality), and the ecosystem benefits from adopting the most robust, maintainable approach.
|
||||
|
||||
## Success Criteria
|
||||
- [ ] Turn-key fuzz runner: A single entrypoint (e.g., `make fuzz` / `cargo fuzz run …`) that runs fuzz targets locally with clear instructions and expected dependencies. `cargo-fuzz` is an accepted approach.
|
||||
- [ ] Multiple fuzz targets (minimum 4): Provide distinct targets covering, at minimum:
|
||||
1. transaction decoding / instruction parsing,
|
||||
2. stateless verification checks,
|
||||
3. state transition / execution engine,
|
||||
4. block verification / replayer logic (or the closest equivalent in the current codebase).
|
||||
- [ ] Invariant detection: Implement a shared invariant framework that asserts protocol rules (e.g., no invalid transitions accepted, nullifier/commitment uniqueness constraints, authorisation checks, deterministic roots/hashes, etc.) and fails fast with actionable diagnostics.
|
||||
- [ ] Crash + panic capture with minimisation: Demonstrate automatic minimisation of failing inputs (smallest reproducer) and a workflow to convert findings into regression tests. Property-testing shrinkers (e.g., `proptest`) are acceptable for structured inputs; coverage-guided fuzzers should also be supported.
|
||||
- [ ] CI integration: Add a CI job that:
|
||||
- runs fuzzing for a fixed time budget (e.g., short smoke fuzz),
|
||||
- runs regression reproducer tests from the saved corpus,
|
||||
- and clearly reports failures.
|
||||
- [ ] Performance baseline: Document achieved throughput for key targets (e.g., exec/sec for parsing and for execution) and the recommended local settings.
|
||||
|
||||
## Scope
|
||||
|
||||
|
||||
### In Scope
|
||||
- Fuzz targets: TBD.
|
||||
- Coverage-guided fuzzing harnesses (libFuzzer via cargo-fuzz recommended) and/or complementary property-based adversarial generators for structured inputs.
|
||||
- Input generators for:
|
||||
- malformed and boundary-value transactions,
|
||||
- invalid account/state combinations,
|
||||
- re-ordered / duplicated inputs,
|
||||
- pathological sequences intended to violate protocol rules.
|
||||
- Invariant-checking utilities and differential-testing hooks (where applicable).
|
||||
- Failure minimisation, reproduction, and regression workflows.
|
||||
|
||||
### Out of Scope
|
||||
- Manual audits or “one-off” bug reports without reusable infrastructure (those belong in the bug bounty prize).
|
||||
- Fuzzing unrelated third-party libraries unless required to reach protocol code paths.
|
||||
- Non-deterministic tests that can’t be reliably reproduced.
|
||||
|
||||
## Prize Structure
|
||||
|
||||
- **Total Prize:** $TBD
|
||||
- **Effort:** Large
|
||||
|
||||
|
||||
## Eligibility
|
||||
|
||||
Open to any individual or team. Submissions must be original work. Teams must hold the rights to all submitted code and agree to license it under MIT or Apache-2.0.
|
||||
|
||||
## Submission Requirements
|
||||
- Public repository containing:
|
||||
- fuzz targets + harnesses,
|
||||
- seed corpus (and dictionaries if relevant),
|
||||
- invariant framework + examples of invariants,
|
||||
- CI integration (smoke fuzz + regression runs),
|
||||
- documentation: `docs/fuzzing.md` with “how to run”, “how to add a fuzz target”, and “how to minimise + reproduce”.
|
||||
|
||||
## Evaluation Process
|
||||
By default, submissions are evaluated first-come-first-served against the success criteria. The first submission that meets all criteria wins.
|
||||
|
||||
## Resources
|
||||
|
||||
- [LEZ Github repository](https://github.com/logos-blockchain/lssa)
|
||||
- [Fuzzing with cargo-fuzz - Rust Fuzz Book](https://rust-fuzz.github.io/book/cargo-fuzz.html)
|
||||
- [libFuzzer and AFL++ | ClusterFuzz](https://google.github.io/clusterfuzz/setting-up-fuzzing/libfuzzer-and-afl)
|
||||
- [libFuzzer – a library for coverage-guided fuzz testing](https://llvm.org/docs/LibFuzzer.html)
|
||||
+27
-51
@@ -4,62 +4,41 @@
|
||||
|
||||
## Overview
|
||||
|
||||
This prize funds a protocol for anonymous, moderated forums. Members post without revealing their identity and their posts are unlinkable to one another — yet a coordinated group of moderators can act on individual posts, and a member who accumulates too many moderation strikes loses their membership. The accountability mechanism is built on Rate Limiting Nullifiers (RLN): each moderation event consumes a share of a member's secret polynomial, and once the threshold is reached, the secret is recoverable and the member is slashed from the registry.
|
||||
This prize funds a protocol for anonymous, moderated forums. Members post without revealing their identity and their posts are unlinkable to one another — yet a coordinated group of moderators can act on individual posts, and a member who accumulates too many moderation strikes loses their membership. The accountability mechanism is built on Rate Limiting Nullifiers (RLN): each moderation event accumulates cryptographic evidence against a member, and once the threshold is reached, the evidence is sufficient to revoke their membership and slash their stake.
|
||||
|
||||
The deliverable has two required parts: a **protocol library** (reusable SDK encapsulating membership, ZK proofs, share derivation, and moderation primitives) and an **end application** (a working forum demonstrating the full lifecycle). The library defines the composable primitives; the application proves they are sufficient to build a real product on top of.
|
||||
Moderation is gasless: all forum activity and moderation happens off-chain using the Logos stack — nothing goes on-chain until a member reaches the revocation threshold and a slash is submitted. This keeps the common path free of transaction costs while preserving trustless enforcement at the point of revocation.
|
||||
|
||||
The deliverable has two required parts: a **forum-agnostic moderation library** (a standalone SDK for threshold moderation and RLN-based revocation, making no assumptions about forum content or structure) and an **end application** (a working forum of any shape built on top of the library). The library defines the reusable primitives; the application proves they are sufficient for a real product without requiring library changes.
|
||||
|
||||
## Motivation
|
||||
|
||||
Anonymous participation prevents censorship and surveillance but creates accountability problems: bad actors can post freely with no consequence. Conventional solutions either break anonymity (linking posts to identity) or rely on a trusted moderator with unilateral power.
|
||||
|
||||
RLN offers a different trade-off: a member's secret is embedded in a polynomial such that accumulating enough publicly verifiable moderation events exposes the secret — without any single moderator being able to act alone. This makes revocation trustless and proportionate: the community must agree N-of-M times before a member is removed, and the removal is cryptographically enforced rather than administratively imposed.
|
||||
RLN offers a different trade-off: moderation events produce verifiable cryptographic evidence that accumulates off-chain against an anonymous member — without any single moderator being able to act alone. The process stays gasless until a member crosses the revocation threshold, at which point anyone can submit a single on-chain slash transaction to enforce revocation. No trusted party is needed to enforce the outcome.
|
||||
|
||||
The key design challenge is that moderators must be able to act on posts without learning who wrote them, while the accumulated moderation evidence must be sufficient to reconstruct the member's secret when the threshold is reached.
|
||||
The key design challenge is that moderators must be able to act on posts without learning who wrote them, while the accumulated evidence must be sufficient to identify and revoke the member when the threshold is reached.
|
||||
|
||||
## Core Mechanism
|
||||
|
||||
Each forum or sub-forum is an independent instance with its own:
|
||||
- **Membership registry**: on-chain commitment set and revocation list.
|
||||
- **Moderator set**: a fixed group of M designated moderators.
|
||||
- **Parameters**: moderation threshold K (strikes before revocation), and the N-of-M agreement required per moderation event.
|
||||
Each forum is an independent instance with its own membership registry, moderator set, and parameters: how many moderation strikes revoke membership (K) and how many moderators must agree to issue one strike (N-of-M).
|
||||
|
||||
### Membership
|
||||
**Membership**: Members register anonymously by committing to a private identity with a small stake. The commitment is recorded on-chain; the identity remains private. Registration uses RLN, which encodes the revocation threshold into the identity commitment in a way that accumulating enough moderation evidence cryptographically exposes the member's secret.
|
||||
|
||||
A member holds a private secret `k`. They register by submitting a commitment `C = H(k)` to the forum's on-chain membership registry, with a small stake. The secret `k` is embedded as the constant term of a degree-(K−1) polynomial:
|
||||
**Anonymous content**: Forum content is published over Logos Messaging and stored on Logos Storage. Each piece of content carries a ZK proof that the author is a registered, non-revoked member — without revealing which member. Content from the same author is unlinkable to outside observers. Each item also includes a piece of cryptographic evidence that moderators can use to issue a strike without learning the author's identity. The specific nature of forum content (text posts, images, comments, reactions, or other interactions) is left to the applicant.
|
||||
|
||||
```
|
||||
f(x) = k + a₁·x + … + a_{K-1}·x^{K-1}
|
||||
```
|
||||
**Threshold moderation**: Moderation happens entirely off-chain using the Logos stack. When N out of M designated moderators agree a piece of content violates forum rules, they produce a joint moderation certificate. Fewer than N signatures are insufficient — no single moderator can act unilaterally. Certificates are publicly auditable without any on-chain transaction.
|
||||
|
||||
The coefficients are derived deterministically from `k` and a forum-specific domain separator.
|
||||
|
||||
### Anonymous Posting
|
||||
|
||||
To post, a member produces a ZK proof of membership (proving their commitment is in the registry and is not revoked) without revealing which commitment. Alongside the proof, they attach a moderation share:
|
||||
|
||||
```
|
||||
x = H(post_id || forum_domain)
|
||||
y = f(x)
|
||||
```
|
||||
|
||||
The share `(x, y)` is published with the post. Non-moderated posts are unlinkable: different posts produce different `x` values, and `y` values reveal nothing about `k` individually.
|
||||
|
||||
### Threshold Moderation
|
||||
|
||||
When N out of M designated moderators agree that a post violates the forum's rules, they jointly produce a **moderation certificate**: a threshold signature (or equivalent N-of-M attestation) over the post identifier and its attached share `(x, y)`. The certificate is submitted on-chain to the forum's moderation program.
|
||||
|
||||
Each accepted certificate records the share `(x, y)` from that post as a moderation strike. Once K distinct shares from the same polynomial are recorded, any observer can interpolate the polynomial and recover `k`. The recovered `k` is used to re-derive `C = H(k)` and submit a **slash transaction** to the membership registry, revoking the commitment and slashing the stake.
|
||||
**Revocation**: Certificates accumulate off-chain. Once K certificates exist for the same member, any party can present the collected evidence in a single on-chain slash transaction to the membership registry. The registry verifies the evidence, revokes the membership, and claims the stake. Future posts from that identity are rejected. No gas is spent until this final step.
|
||||
|
||||
## Success Criteria
|
||||
|
||||
- [ ] A member can register in a forum instance with a stake and subsequently publish posts with valid ZK proofs of membership. Posts from the same member are unlinkable to a third-party observer.
|
||||
- [ ] N-of-M moderators can jointly produce a valid moderation certificate for a post. Fewer than N moderator signatures are rejected by the on-chain program.
|
||||
- [ ] Each accepted moderation certificate records one RLN share on-chain. The share is tied to the post and verifiably derived from the posting member's polynomial.
|
||||
- [ ] When K moderation certificates are accumulated for the same member, any party can interpolate the polynomial, recover `k`, and submit a slash transaction that is accepted by the membership registry.
|
||||
- [ ] N-of-M moderators can jointly produce a valid moderation certificate off-chain using the Logos stack. Fewer than N signatures produce a certificate that is rejected at slash time. Certificates are publicly auditable without any on-chain transaction.
|
||||
- [ ] When K moderation certificates are accumulated for the same member, any party can submit a single slash transaction to the membership registry. The registry verifies the off-chain evidence and revokes the membership.
|
||||
- [ ] A slashed commitment is added to the revocation list. Subsequent posts with a ZK proof tied to that commitment are rejected.
|
||||
- [ ] The protocol is parameterisable: forum instances can independently set K (revocation threshold) and N-of-M.
|
||||
- [ ] A reusable protocol library (SDK) exposing well-documented APIs for: membership registration, ZK proof generation and verification, share derivation, moderation certificate construction, and slash submission. The library must be usable independently of the bundled application.
|
||||
- [ ] A working end application (web or CLI) built on top of the library demonstrating the full lifecycle: registration, posting, moderation, and revocation.
|
||||
- [ ] A standalone, forum-agnostic moderation library exposing well-documented APIs for: membership registration, ZK proof generation and verification, off-chain moderation certificate construction and coordination, and slash submission. The library operates on abstract content identifiers, makes no assumptions about forum content structure, and uses the Logos stack for all off-chain activity.
|
||||
- [ ] A working Logos mini-app (runnable inside the Logos app), built using the library without modifying it. The app allows anyone to create a new forum instance. Forum content and moderation are handled off-chain via the Logos stack. The specific forum functionality (text posts, image board, comments, reactions, etc.) is at the applicant's discretion. The app demonstrates the full moderation lifecycle: instance creation, registration, publishing content, moderation, and revocation.
|
||||
- [ ] End-to-end demonstration on LEZ testnet with at least two independent forum instances using different K and N-of-M parameters.
|
||||
|
||||
## Scope
|
||||
@@ -67,21 +46,19 @@ Each accepted certificate records the share `(x, y)` from that post as a moderat
|
||||
### In Scope
|
||||
|
||||
- **Membership registry LEZ program**: commitment registration, staking, revocation list, and slash verification.
|
||||
- **Moderation program**: on-chain recording of moderation certificates and accumulated RLN shares.
|
||||
- **ZK membership proof circuit**: proves commitment is in the registry and not revoked, without revealing which commitment.
|
||||
- **Threshold moderation mechanism**: N-of-M signature scheme or equivalent for producing moderation certificates.
|
||||
- **Slash verifier**: reconstructs `k` from K shares and submits a valid slash transaction.
|
||||
- **Protocol library (SDK)**: a standalone, documented package exposing APIs for membership, ZK proof generation/verification, share derivation, moderation certificate construction, and slash submission. Must be importable by third-party applications.
|
||||
- **End application**: a working forum (web UI or CLI) built using the SDK, demonstrating the complete user-facing lifecycle end-to-end.
|
||||
- Documentation covering: protocol design, RLN polynomial construction, unlinkability analysis, moderator trust model, threat model, and integration guide.
|
||||
- **Moderation library**: a standalone, forum-agnostic SDK for threshold moderation and RLN-based revocation. It operates on abstract content identifiers, makes no assumptions about the shape of forum content, and uses the Logos stack for all off-chain activity. It handles certificate construction, evidence aggregation, and slash transaction submission. Must be importable by any application regardless of forum type.
|
||||
- **Slash verifier**: verifies accumulated off-chain certificates and submits a valid on-chain slash transaction.
|
||||
- **End application**: a Logos mini-app, runnable inside the Logos app, built using the moderation library. The app must allow users to create new forum instances. Forum content and moderation are handled off-chain via the Logos stack. The specific forum functionality — content types, interaction model, layout — is left entirely to the applicant. The application must not require changes to the library to function.
|
||||
- Documentation covering: library API reference, integration guide, unlinkability analysis, moderator trust model, and threat model.
|
||||
|
||||
### Out of Scope
|
||||
|
||||
- Content storage or retrieval (posts may reference off-chain content by hash).
|
||||
- Discovery, search, feeds, or social graph features.
|
||||
- Reputation tiers or rate limits on posting frequency.
|
||||
- Multi-forum identity linking or cross-forum revocation.
|
||||
- Production-quality UI or hosted infrastructure.
|
||||
- End-to-end encryption of forum content — applicants may implement it but it is not required.
|
||||
- Hosted infrastructure beyond what is required to run the Logos mini-app.
|
||||
|
||||
## Prize Structure
|
||||
|
||||
@@ -96,15 +73,14 @@ Open to any individual or team. Submissions must be original work. Teams must ho
|
||||
## Submission Requirements
|
||||
|
||||
- Public repository (MIT or Apache-2.0) containing:
|
||||
- LEZ programs (membership registry, moderation program),
|
||||
- LEZ program (membership registry with slash verification),
|
||||
- ZK membership proof circuit,
|
||||
- threshold moderation implementation,
|
||||
- **moderation library** (forum-agnostic, standalone package) with public API, documentation, and usage examples,
|
||||
- slash verifier,
|
||||
- **protocol library (SDK)** with public API, documentation, and usage examples,
|
||||
- **end application** (web UI or CLI) built on the SDK,
|
||||
- tests covering: valid registration, valid post proof, moderation certificate acceptance, share accumulation, slash submission, post rejection after revocation.
|
||||
- Protocol specification (`docs/protocol.md`) covering: polynomial construction, share derivation, unlinkability argument, moderator trust assumptions, and threat model.
|
||||
- End-to-end demo (video or live link) showing: registration, posting, N-of-M moderation, share accumulation, slash, and post rejection.
|
||||
- **Logos mini-app** (runnable in the Logos app) built on the library without modifying it — forum functionality at applicant's discretion,
|
||||
- tests covering: valid registration, valid post proof, moderation certificate construction and verification, strike accumulation, slash submission, post rejection after revocation.
|
||||
- Protocol specification (`docs/protocol.md`) covering: unlinkability argument, moderator trust assumptions, revocation mechanism, and threat model.
|
||||
- End-to-end demo (video or live link) showing: registration, posting, N-of-M moderation, strike accumulation, slash, and post rejection.
|
||||
- Two live forum instances on LEZ testnet with different K and N-of-M parameters and verified program IDs.
|
||||
|
||||
## Evaluation Process
|
||||
|
||||
Reference in New Issue
Block a user