Skip to content

TLOSCrowdfund.sol - Crowdfunded disclosure example #48

@igor53627

Description

@igor53627

Parent Issue

Closes part of #47

Description

Build a crowdfunded disclosure contract where a secret (e.g., dataset, source code, research) is revealed publicly once a funding threshold is reached.

Use Case (from iO "Decrypted Payments")

Traditional approach requires a trusted server to verify payments and release content. TLOS enables:

  • Secret embedded in obfuscated circuit
  • Contract checks on-chain funding condition
  • When threshold met, secret is revealed publicly (not per-payer)

Example Flow

Deployer                         Contract                          Funders
   |                                |                                  |
   | deploy(secretHash, goal)       |                                  |
   |------------------------------->| stores obfuscated secret         |
   |                                |                                  |
   |                                |<--- fund() ----------------------|
   |                                |<--- fund() ----------------------|
   |                                | total >= goal                    |
   |                                |                                  |
   |                                |--- reveal() -------------------->|
   |                                | emits SecretRevealed(secret)     |

Key Features

  • Funding goal stored as public parameter
  • Secret hidden inside TLOS puzzle (WeakLWEPuzzleV7 pattern)
  • Anyone can trigger reveal once goal is met
  • Refund mechanism if goal not met by deadline
  • Optional: milestone-based partial reveals

Security Model

  • What's hidden: The actual secret content
  • What's public: Funding goal, current total, deadline
  • Guarantee: 2^76 minimum brute-force to extract secret early

Implementation Notes

  • Use WeakLWEPuzzleV7 inline pattern (like TLOSTreasureHunt)
  • Consider: should secret be the puzzle solution itself, or derived from it?
  • Add comprehensive tests

Acceptance Criteria

  • Contract compiles and passes tests
  • Gas benchmark documented
  • Security warnings in contract header
  • Added to examples/ directory

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions