buidler-fest-ticketer

@txpipe

• v0.1.0

Buidler Fest 2026

Reference Docs

Using Tx3

This starter kit relies on the Tx3 toolchain, a development toolkit for UTxO protocols. Make sure to visit the Tx3 installation guide to setup your system before continuing.

The main.tx3 file contains the interface definition for the Buidler Fest protocol. This file uses the Tx3 DSL to describe the different on-chain interactions.

We encourage you to explore the Tx3 language, but the important thing to notice is that the main.tx3 file contains definition for the transaction to buy a ticket.

tx buy_ticket(
    ticket_name: Bytes, // TICKET + number
    ticket_price: Int, // Ticket Price in lovelace
    p_until_slot: Int, // Validity slot
) {
    ...
}

The body of this function contains the transaction building logic that you need for minting your ticket.

Building your transaction

First you need to install the Node dependencies:

npm install

Create a wallet

The following command uses cardano-cli to create a new private / public key for the buyer. This is the wallet that will pay for the ticket.

cardano-cli address key-gen --verification-key-file buyer.vk --signing-key-file buyer.sk

Run the following command to get the address of your new wallet:

cardano-cli address build --payment-verification-key-file buyer.vk --mainnet

Make sure to send some ADA to the address to use as "gas" for executing the required transactions and to pay for the ticket.

Get your wallet private key

In order to get your wallet private key you can use cbor.me.

Paste your cborHex value from the buyer.sk file and you'll get your wallet private key.

Buy Ticket Tx

This transaction mints a Ticket token and pays the ticket_price to the treasury. It also updates the Ticketer state to increment the ticket counter.

You need to implement a script that calls the buyTicketTx function from the generated SDK in offchain/protocol.ts.

Most of the protocol parameters (like policies and contract addresses) are provided in the .env file included by network. You mainly need to provide:

  • buyer: Your wallet address.
  • ticketName: The name of the ticket to mint. It must follow the format TICKET<N>, where <N> is the current ticket counter.
  • ticketPrice: The price of the ticket in lovelace (e.g., 20000000 for 20 ADA).
  • pUntilSlot: The slot until which the transaction is valid. You can set this based on the current slot plus some offset.

The other parameters (adminTokenName, adminTokenPolicy, ticketPolicy, ticketer, treasury) should be loaded from the environment variables.

Tip: Check the offchain/protocol.ts file to see the type definitions and the main.tx3 file to understand the transaction structure.

Note: You need to know the correct ticketNumber (it must be sequential) based on the current state of the Ticketer UTxO. You can find this value in the on-chain state.

buidler-fest-ticketer

Published by

@txpipe

Publication datePublished 10 days ago
Back to all Protocols