ERC-7439 · Final · ERC · 2023-07-28
ERC-7439: Prevent ticket touting
An ERC-721 extension for event tickets where only authorised partners (organisers, official resale platforms) can move tickets, and each ticket carries a status such as Sold, Resell, Void or Redeemed, to curb scalping.
What problem does it solve?
Ticket touting (scalping) works because paper or e-mail tickets are easy to copy and hand over, so scalpers can buy in bulk and resell at a markup on unofficial markets. Legal bans have limited effect.
ERC-7439 makes tickets ERC-721 NFTs whose transfers are locked down: ordinary holders, including the owner, cannot transfer them. Only accounts with a partner role (the ticketing agent, promoter or an authorised resale platform) can move a ticket, so resale has to go through an official channel that can enforce price rules.
How it works
Each token has a TokenInfo record:
signature– data signed by the buyer or the agent, used at the venue to prove the ticket is genuine. What exactly is signed is left to the implementer.tokenStatus– one ofSold,Resell,Void,Redeemed.expireTime– recommended to be the event time; helps check the right session.
The interface adds:
safeMint(to, signature)– public primary sale; the ticket starts asSold.changeState(tokenId, signature, tokenStatus, newExpireTime)– callable only by a privileged role; emitsTokenStatusChanged.supportsInterfacemust returntruefor0x15fbb306(via ERC-165).
Typical lifecycles described in the spec:
- Normal: mint (
Sold) → checked at the door →Redeemed. - Resell: holder asks an authorised platform → status
Resell→ partner transfers it → new buyer, new signature, back toSold. - Void: if a holder is caught in an illegal sale, a partner sets the ticket to
Voidand it is no longer valid.
In the reference implementation, transfers are blocked in the transfer hook unless the caller has PARTNER_ROLE; mints and burns are still allowed.
Sample code
A partner reselling a ticket and checking it at the door (ethers v6):
import { Contract, Wallet, JsonRpcProvider } from "ethers";
const abi = [
"function changeState(uint256 tokenId, bytes signature, uint8 tokenStatus, uint256 newExpireTime)",
"function transferFrom(address from, address to, uint256 tokenId)",
"function tokenInfo(uint256) view returns (bytes signature, uint8 tokenStatus, uint256 expireTime)",
];
const Status = { Sold: 0, Resell: 1, Void: 2, Redeemed: 3 } as const;
const provider = new JsonRpcProvider(process.env.RPC_URL);
const partner = new Wallet(process.env.PARTNER_KEY!, provider);
const tickets = new Contract(process.env.TICKETS!, abi, partner);
// Resale through the authorised platform
await (await tickets.changeState(tokenId, "0x", Status.Resell, eventTime)).wait();
await (await tickets.transferFrom(seller, partner.address, tokenId)).wait();
await (await tickets.changeState(tokenId, buyerSignature, Status.Sold, eventTime)).wait();
await (await tickets.transferFrom(partner.address, buyer, tokenId)).wait();
// At the venue
const info = await tickets.tokenInfo(tokenId);
if (Number(info.tokenStatus) === Status.Sold) {
await (await tickets.changeState(tokenId, info.signature, Status.Redeemed, info.expireTime)).wait();
}
tokenInfo is a public getter in the reference implementation, not part of the required interface.
Things to know
- Status: Final.
- The scheme is deliberately centralised: holders depend on partners to resell, refund or void tickets, and a partner can change any ticket's status. Choose partner accounts and key management carefully.
- Anti-scalping only works if the off-chain check at the door verifies the
signatureand status; the NFT alone does not prove who is holding the phone. - Because normal transfers revert, these tickets do not work on generic NFT marketplaces. For tokens that can never move, see soulbound designs such as ERC-5192.