An intent-based dApp reference implementation built with GCScript DSL and a lightweight HTML/JS frontend.
👉 Live demo: https://builder-fest-ticket-demo.netlify.app/
This repository is meant to become a friendly, practical reference for developers who want to understand how to build intent-based Cardano dApps with GameChanger Wallet tooling and the Universal Dapp Connector approach.
The frontend was originally generated with the GameChanger Wallet Playground / in-wallet code editor and then iterated into a more guided developer experience. The result is a demo that not only lets users buy tickets, but also helps developers understand how to:
- 🧠 model a dApp as reusable intents rather than a tightly-coupled frontend flow
- 🧾 run the preprod testnet demo out of the box
- 🔁 reuse a user-agnostic buy intent through a sharable URL or QR code
- 🏗️ support self-sovereign deployments by re-parameterizing the validator on the user's own device
- 🌐 publish the full raw buy intent as an on-chain reusable GCScript DSL library via GCFS (GameChanger File System), so later integrations can stay tiny and QR-friendly
This project is a nice “Rosetta Stone” example for Cardano developers:
- you can compare the same Cardano use case across DSL flavors since the original codebase was created with TX3 DSL: https://github.com/txpipe/buidler-fest-2026-buy-ticket/tree/main
- It shows how a real-world ticketing flow can be expressed in GCScript DSL.
- It demonstrates how frontend UX and wallet-executed intents can collaborate cleanly.
- It highlights a very powerful pattern: once an intent is parameterized correctly, the URL and QR become reusable distribution artifacts.
- For Cypherpunks only: It introduces a path toward removing the frontend from the critical path entirely. Users can eventually scan a QR and execute the purchase without any middleman web app in between!.
The demo frontend is prepared to run on Cardano preprod out of the box.
This repository intentionally focuses on the preprod path as the best developer onboarding experience. The demo validator deployment used for this experience is intentionally limited in stock — fewer than 100 tickets are expected in this demo setup — which keeps the scenario concrete and easy to reason about.
For the up-to-date intent used by the frontend, start here:
The historical mainnet version is still included for comparison:
.
├── README.md
├── LICENSE
├── serve.sh
├── src/
│ ├── mainnet/
│ │ ├── README.md
│ │ └── buy.gcscript.json
│ └── preprod/
│ ├── README.md
│ ├── buy.QR.png
│ ├── buy.URL.txt
│ └── buy.gcscript.json
└── www/
└── index.html
This repository serves the frontend with Python's built-in HTTP server:
python3 --versionIf Python 3 is missing:
- Ubuntu / Debian
sudo apt update sudo apt install python3
- macOS: Python 3 is often already available, otherwise install it with your preferred package manager.
- Windows: install Python 3 and make sure it is available in your terminal.
Make the script executable once if needed:
chmod +x ./serve.shThen run:
./serve.shThis serves the www/ folder locally using:
python3 -m http.server -d wwwNow open the local address printed by Python in your browser.
One of the nicest things about intent-based dApps is that the final interaction artifact can often be shared directly.
In this repository, the preprod buy flow already has:
- a reusable URL:
src/preprod/buy.URL.txt - a reusable QR code:
src/preprod/buy.QR.png
You can also open the buy intent directly in GameChanger Wallet here:
👉 Open the reusable preprod buy intent
Because the intent is generally user-agnostic, the same URL/QR can be distributed broadly. The wallet resolves the active user context at execution time.
The buy flow is powered by an on-chain reusable library which contains the full intent implementation.
Import the library, execute the intent with some custom arguments, then capture the results at frontend:
{
"type": "script",
"title": "Buy a ticket",
"description": "Purchase a ticket to participate in the event. Works by importing the intent source code from an on-chain reusable library stored via GCFS filesystem protocol",
"exportAs": "TicketData",
"args": {
"script-lang": "plutus_v3",
"script-hash": "d7f1193b244518fce5ca5a1c7b2c4340438c8a1c4ad87b08a70eeebe",
"script-size": 2690,
"script-address": "addr_test1zrtlzxfmy3z33l89efdpc7evgdqy8ry2r39ds7cg5u8wa0nmmk6d9tdz4cz9np3rjpaar2krctzs2rl2ttney2klk2jqwqjsdv",
"script-utxo-hash": "23cf61539db485464ce08ef449d237700d2c0e166b2a1b27b74df031391afcc2",
"script-utxo-index": 1,
"beacon-policyId": "1ae0de15972869ee677a120a4d6073f918d8f6ed515fae4ec77b1ea9",
"beacon-assetNameHex": "53544154455f424541434f4e5f76313230363236393832",
"treasury-address": "addr_test1qrl07u9ssdtdwtzhrt0zrrr79yejxhfvmsmjt9jxqyaz0ktp6ydulqht6r9z4ld0jms3a3c7gw45u32vhc2ftdp2f6rqvz02jw",
"ticket-cost": 5000000
},
"return": {
"mode": "last"
},
"run": {
"importedScript": {
"type": "importAsScript",
"args": "{get('args')}",
"from": [
"gcfs://b5609d8fdc910c698152072ebba6b5e572dc85098f482a9d9d5a74ae.BuilderFest@latest://src/buy.gcscript"
]
}
},
"returnURLPattern": "http://0.0.0.0:8000/"
}And the overal design of the on-chain library is mainly:
query last ticket state → compute the next ticket state → build the transaction with next state → ask the wallet to sign → submit. 🎯
This repository also documents a bigger idea than “buying a ticket”.
The frontend is designed to help developers move toward a fully self-sovereign flow where users can:
- re-parameterize the validator on their own device,
- produce their own deployment artifacts,
- publish the full raw buy intent as a reusable on-chain GCScript DSL library using GCFS, and
- replace larger downstream integrations with smaller wrapper intents that import and reuse that published logic.
That matters because it leads to:
- ✂️ smaller final integration code
- 📦 easier QR packing
- 🔓 less dependence on a hosted frontend
- 🤝 a more open, forkable, inspectable ecosystem
A good next step is to explore the official GameChanger Wallet repository and docs:
If this is your first time with this repo, a fun path is:
- run the frontend using the online demo,
- buy some tickets using the frontend and using the QR code,
- hacker mode: inspect the buy intent using the wallet live debugger,
- inspect the buy intent in the HTML file,
- run the frontend locally,
- play/modify the HTML file,
- run the new frontend locally,
- compare this repo with the original TX3 version,
- then imagine how you would publish part of the logic on-chain for reuse.
Have fun and happy hacking! ✨
This was made for educational purposes to keep the example developer-friendly. Mind to add more validations for any production release!
This repository is licensed under the MIT License.
