All projects

StacksTix — Automated Ticket Lifecycle Enforcement

Trust-minimized ticketing powered by Chainlink CRE on Bitcoin L2

DeFi & Tokenization CRE & AI

What it is

StacksTix solves the $6B annual ticketing fraud problem through automated, trust-minimized ticket lifecycle enforcement.
THE PROBLEM: The global ticketing industry ($85B+ market) relies on manual intervention to lock ticket transfers when events start and invalidate tickets after events end. This creates fraud opportunities, scalping windows, and requires platform trust.
THE SOLUTION: StacksTix uses Chainlink Runtime Environment (CRE) to automatically enforce ticket state transitions based on real-world event timing:

  • BEFORE EVENT: Tickets are ACTIVE and freely transferable
  • DURING EVENT: Chainlink Automation triggers → tickets become LOCKED, transfers blocked
  • AFTER EVENT: Chainlink Automation triggers → tickets become EXPIRED, invalid for entry
    This happens automatically with zero manual intervention and zero trust assumptions.
    TECHNICAL IMPLEMENTATION:
  • Smart Contract: Clarity language on Stacks (Bitcoin L2)
  • Automation: Chainlink CRE workflow monitors event timestamps
  • Integration: CRE workflow uses CronCapability + HTTPClient for external data
  • Access Control: Only authorized Chainlink automation principal can trigger state changes
  • Testing: 10/10 passing tests prove the automation logic works correctly
    IMPACT:
  • Prevents $6B+ in annual ticketing fraud
  • Eliminates manual verification costs ($2B+ annually)
  • Reduces platform fees from 15-30% to <5%
  • Opens Chainlink services to 600M+ Stacks ecosystem users
  • One of the first production-aligned CRE implementation on Bitcoin L2
    This demo validates our core architecture for a pending Chainlink Grant application.

How it Works

STACK:

  • Blockchain: Stacks (Bitcoin Layer 2)
  • Smart Contracts: Clarity language (decidable, secure-by-design)
  • Automation: Chainlink Runtime Environment (CRE)
  • Workflow SDK: @chainlink/cre-sdk v1.0.9
  • Testing: Vitest + @stacks/clarinet-sdk
  • Runtime: Bun v1.3.9
    ARCHITECTURE: Three-layer CRE-aligned design:
  1. OFFCHAIN (Chainlink CRE Workflow):
    • CronCapability fires every 5 minutes
    • HTTPClient fetches external event data
    • Consensus aggregation across DON nodes (Byzantine fault tolerant)
    • Determines ticket lifecycle phase (UPCOMING/LIVE/ENDED)
  2. INTEGRATION BOUNDARY:
    • Access control via AUTOMATION-PRINCIPAL constant
    • Only authorized Chainlink address can call lifecycle functions
    • Minimal trust assumptions enforced at contract level
  3. ONCHAIN (Stacks Smart Contract):
    • automation-start-event() locks all tickets when event starts
    • automation-end-event() expires all tickets when event ends
    • transfer-ticket() checks both ticket state AND parent event status
    • Deterministic state machine: no reversals, no manual overrides
      KEY IMPLEMENTATION DETAILS:
  • CRE workflow uses TypeScript compiled to WebAssembly
  • Smart contract uses O(1) lookups via Clarity maps
  • Event status: UPCOMING → LIVE → ENDED (unidirectional)
  • Ticket state: ACTIVE → LOCKED → EXPIRED (no rollbacks)
  • Tests validate the critical automation hook prevents transfers after event start
    Built with production deployment in mind — all integration patterns are production-ready.

Links

Created by

  • Terkaa Tarkighir