ShadowTix: an event ticketing platform on Ootle L2 — the contract, 20 security findings, and what we learned about walletd and self-custody
We spent the last months building a complete event ticketing platform on Tari Ootle and running it as a real deployment rather than a demo. It is live on testnet at https://shadowtix.shop — a public catalogue, purchase in XTR, door check-in, refunds and a capped resale market, with every rule that touches money enforced by a contract rather than by our server.
This post is the write-up we wanted to read when we started. It covers what the platform does, how the contract defends itself, and — the parts we think are actually valuable to this community — where we hit the limits of the engine and what self-custody costs you when your only convenient transaction-building surface is walletd .
It also includes our security findings in full: 20 of them, three Critical, all closed. We are publishing them deliberately. A hardening cycle with nothing in it is a hardening cycle that did not happe n.
If you write contracts on Ootle, section 4 has three engine limits and the workaround patterns we ended up with. If you build consumer apps with self-custody, section 5 has five ways walletd answers plausibly and wrongly for accounts it does not own — that one cost us days, and money in test ru ns.
Everything below runs on esmeralda testnet. Test tokens have no value; the faucet is open. Nothing here is a production payment system, and the site says so.
Screenshot 1. the public cat alogue
1. What the plat form does
Four roles, each with a full path through th e product.
Buyer.Browses a catalogue with filters (genre, date, venue, price, status), buys a ticket in XTR with either a custodial wallet or one whose key lives only in their browser, gets a QR ticket, can request a refund under the organizer’s published policy, and can list the ticket for resale within a price ceiling the organizer set. If an event is cancelled, refund for a covered event is an on-chain guarantee, not a suppo rt promise.
Organizer.Creates an event (two transactions — see 4.3 for why), sets refund and resale policy, appoints door controllers, watches revenue and reserve as separate figures, and can cancel — with a pre-flight check that tells them whether obligations to ticket holders are actually covered bef ore they do.
Platform operator.Provisions organizers via on-chain badges, sets the fee, keeps a journal of contract events, and reconciles local records against the network.
Controller.Scans QR at the door for one of three verdicts — valid, already redeemed, not a ticket for this event — signing each redemption with their own key.
Screenshot 2. event page — terms read from the contract, plu s the seat map
Two product decisions worth calling out because they sha ped the contract:
· The terms shown to the buyer are the only truth.Refund and resale policy
freeze on the first sale. Nobody can change them retroactively — not the organizer, not us.
· The door does not learn who you are.Redemption chec ks a token id from a
QR code, not an identity against a list. The organizer and the controller never see a b uyer’s name or email.
2. How the c ontract defends itself
2.1 Resource rules, not owner trust
Ticket minting, metadata updates and burning are restricted to the contract component itself. The organizer owns the event component but cannot mint or burn tickets directly — we set the resource’s owner rule to none, which removes th e owner bypass entirely.
This is not a theoretical hardening. It is finding №0, and before it was fixed anyone could mint themselves a free valid ticket, bypassing purchase completely. Defaults are a trap: an access rule you did not write is an ac cess rule set to “allow”.
2.2 The liability model: two notes, not one
The interesting design problem in ticketing is not taking money — it is not spending money you owe.
Sales revenue sits in the event’s vault, but the contract tracks two separate liability notes against it:
Note
Covers
Refund liability
vol untary refunds while the refund w indow is open
Cancellation reserve
what holders are owed if the event is cancelled
withdraw_salesreleases only balance − sum of both notes. Closing the refund window does not free the money — it moves it from the first note to the second, because closing the window does not cancel the obl igation that appears if the event is later cancelled.
Getting this wrong is subtle and expensive; see fin ding №19 in 3.1.
2.3 Badges as the permission system
Two badge types, both revocable. An organizer badge is minted by the platform to an organizer’s account. A controller badge is minted per event by its organizer. Redemption requires a proof of the controller badge for that event — presenting a badge from a di fferent event is refused by the engine, not b y our code.
2.4 Explicit failure over silent shortfall
If an organizer cancels an event whose obligations are not fully covered, the contract does not quietly do its best. Cancellation with a shortfall requires an explicit force flag and emits an event recording it. Under-coverage becomes a fact on t he ledger rather than a discrepancy someone notices later.
3. The hardening cycle: 20 findings, 3 Critical
We ran internal audit → independent review → live verification on testnet → re-audit → deployment. Twenty findings, of which three Critical and one High. All closed, each with a red reproduction on the vulnerable code and a green r egression on the fixed one. Thirty-six co ntract tests today.
The three Critical ones, by mechanism:
№0 — free minting.Ticket resource rules were left at their permissive default. Any account could mint a valid ticket without paying. Cl osed by component-scoped rules plus removing the owner bypass.
№1 — resale listing theft.Cancelling a resale listing did not verify that the caller was the seller. One call moved somebody else’s ticket into your acco unt. Closed by checking the signer against the recorded seller.
№12 — underflow in the refund path.With a high organizer fee, the penalty could exceed the credit being refunded, and the subtraction wrapped. In practice this was a denial o f service on the entire refund flow. Closed by cla mping to zero.
3.1 What was more instructive than the findings
Three bugs were in the fixes.Re-reviewing our own remediation diffs on the liability paths caught three errors introduced by the fixes themselves. If you run an audit cycle, budget for auditing the remediation as a separate pass. We would not have caught these by re-running the test s uite — the tests were written against the same wrong mental model.
Finding №19 was a legal sequence of legal operations.Nothing was individually broken: close the refund window, then cancel the event. Each step was permitted, each step was correct in isolation, and together they drained the vault of money that was owed to holders. This is the class of bug that per-function review does not find. It closed with the second liability note described in 2.2 — and it forced a second contract release, because templates on Ootle are immutable and the platform component pins the event template it will accept.
That last point is worth internalising if you are designing for Ootle: a change to your event template is a new platform deployment. Plan your migration story before you need one.
4. Engine limits worth knowing (the most useful section, we think)
These are not bugs. They are properties of the execution model that we could not find written down, and each one cost us a redesi gn.
4.1 Cross-component calls from inside `&mut self` are impossible
A method that takes a mutable reference to its own component holds a write lock on it. Calling into another component from inside that method deadlocks against the same lock when the callee calls back.
Pattern that works: invert the flow.Make the signer’s transaction the initiator, and have it call the two components in sequence, rather than having one component orchestrate the other. Several of our flows are shaped by this constraint rather than by product logic, and we think that is fine — but you should know it before you draw your ar chitecture.
4.2 Component access rules check the callee, not the caller
rule![component(X)]restricts which component the method belongs to, not which component is calling. There is no access-rule form that expresses “only component X may call me”. We looked hard for one.
Workaround:verify a concrete token. Pass a proof or check a specific non-fungible id that only the legitimate caller can hold. Checking a component a ddress is not enough on its own; checking po ssession of a specific token is.
4.3 A proof lives exactly one transaction
A proof created in a transaction cannot be reused in a later one — a second use returns “proof not found”. This is what makes event creation two transactions: the organizer’s proof authorises deployment in the first, and a fresh proof authorises registration with the platform in the second. There is no way to collapse this into one call while keeping the platform’s authorisation gate meaningful.
Our UI treats the pair as one action with a resume path: if the second transaction fails, the event exists but is unregistered and invisible to buyers, and the organizer gets a “finish publication” button that retries only the second step. If you build a t wo-transaction flow, build the resume path at the same time — you will need it.
5. walletd and self-custody: five ways a plausible answer is wrong
This is the section we would most l ike Tari developers to read, and we have written it up separately in more detail.
The setup: the user’s key is generated in their browser and never leaves it. The account exists on-chain. The application still needs wal letd to build transactions. And walletd indexes only accounts whose keys it holds.
#
Call
What happens for a self-custody account
1
accounts.get_balances
404, as if the account did not exist
2
nfts.list
same 404
3
detect_inputs
s ucceeds, with a stale input s et — burned tokens included, the live one missing
4
transac tions.get
reports “not finalized” for transactions the network has already committed
5
auth after a restart
previously issued, unexpired tokens fail with a generic signature error
Numbers 3 and 4 are the damaging ones, and they share a shape with all the oth ers: an API that reads like a question about the network, answered from a local store, without saying so.
Number 4 cost us real money in acceptance. Our purchase transactions were finalizing, but slower than our client timeout. We told the buyer “purchase failed”, asked walletd what happened, were told “not finalized” — and only found out from reconciliation an hour later that the contract’s sold counter had advanced past what we knew. Four tickets were paid for and ha d no record on our side. An application that had retried on that answer would have double-charged instead.
Number 5 is smaller but nastier operationally: restart the daemon and every client holding an unexpired token is dead until it restarts too. From outsid e, the site answers 200, the daemon is active, the socket is right — and not one money operation completes.
The conclusion we now hold as a rule:for self-custody, the indexer is the source of truth and walletd is a fast path. And separately, in any money system: “the wallet does not know” i s not “it did not happen.”
Two further consequences we built into the product, which ma y be useful to you:
· The application must name failure causes itself.ExecutionFailurecovers "no
rights", “no funds”, “signature is not from the owner” and “stale inputs” indistinguishably. W e now detect the key-mismatch case before attempting to sign, and say so in words, b ecause the engine will not.
· Every money operation is journalled at submit time, not at success or at
failure. The transaction id is written the moment the tooling prints it, so that a process killed mid-flight leaves a record that can be resolved against the indexer afterwards. We verified this by killing the application container with SIGKILL in the middle of a live purchase: the operation survived, and the restarted process resolved it against the indexer and materi alised the paid t icket thirteen secon ds later, withou t a human.
6. Custody model : three levels for four roles
Role
Custody
Why
Platform operator custodial signs platform-owner operations; key held by the deployment
Organizer
custodial (for the pilot)
losing a se lf-custody key makes an event permanently unmanageable — no policy changes, no cancellation, no payout
Controll er
self-custody only, enforced
redemption is signed by their key, so who redeemed what is provable
Buyer
either
custodial for convenience, self-custody for people who want it
The controller rule is the one we are most confident about. If the platform could sign a redemption, “the ticket was redeemed at the door” would be our word rather than a fact. The route refuses to create a custodial controller at all.
The organizer rule is the one we are least happy about. It is a pilot-scoped compromise: self-custody works, but key loss is unrecoverable, and we have already lost two test events that way. Making tha t survivable is a product problem — mandatory seed backup before the first significant operation — and it is at the top of our backlog.
One operational lesson from an incident of our own: never put a secret in a process argument list. A wallet keyring password passed on the command line is readable by anything on the machine, and it leaked into our working notes through a routine process listing. Rotation, for a daemon with no password-change command, means restoring the wallet from its seed phrase — with a planned outage window. Our acceptance cri teria are now written so that checks count matches rather than print them: a verification step that displays what it verifies is a leak.
7. The interface, and what a legacy migration exposed
Five phases, a desig n-toke n system, 25+ shared components, a public storefront with filters, thre e languages, and a light/dark theme with a per-user override.

Screenshot 3. “How it works” — the explanation page we show buyers
The part worth reporting: before migrating the legacy screens we wrote an inventory — every route, every wallet action, what each screen a ctually called. It caught a regression that looked like “the page is empty” and would otherwise have shipped. The build was green throughout.
A green build is not “it works”. Every thing that broke during the redesign we caught by looking at screens. A scree nshot pass across widths and themes is now a sta nding step.
Screenshot 4. catalogue on a phone
8. Residual risks, stated plainly
We are not going to pretend these are solved.
Risk
Status
Event does not happen and the organizer never cancels
holders cannot recover without th em; no arbitration or timeout exists. Mitigated for the pilot by only running refund-enabled events and not paying out revenue until after th e event
Organizer key loss is irr eversible
the event becomes unmanageable forever. Mitigated by custodial organizers for now
No escrow on the secondary mark et
resale money goes straight to the seller; the buyer carries the counterparty risk
Deadlines live in epochs, not clock time
epoch length drifts, so a date converts to an epoch with slack. Precision is h ours, not minutes
Self-custody inventory depends on one indexer
no fallback; see section 5 for why we cannot use the wallet for this
There is also one honest limitation in the purchase path today: it has no client-supplied idempotency key. On a slow network a buyer who presses “bu y” twice gets two ti ckets and two charges. Our withdrawal path has that key; the purchase path does not yet, and it is a pilot-blocking item on a deg raded network.
9. What is next
· A pilot event with a real organizer— a small venue, refund-enabled, so the
on-chain guarantee actually applies.
· Backlog, in priority order: durable self-custody (mandatory seed backup and
a “lost key” procedure), ownership transfer for platform and events, scheduled reschedule/cancel, debt recovery for events without refunds, and idempotent purchase.
· Th e walletd findingsin section 5. If any of them are already known, or
already fixed on a newer version, we would rather hear that here than repeat what is und erstood.
10. Questions we would like answered by people who know the engine better
1. Is there a support ed way to express “only component X may call this method”
that we missed (section 4.2)?
2. Is the intended integration path for self-custod y applications indeed
“indexer for reads, walletd only for signing and submission”? I f so, that is worth stating in the docs — it is not discovera ble from the API surface.
3. Is there any plan for reason codes onExecutionFailure? A coarse enum would
change what consumer applications can tell their users.
Live platform (testnet esmeralda):https://shadowtix.shop — the catalogue is public, the faucet is open, and the tokens are worth nothing.
If there is interest in specific parts — the liability model, the badge scheme, the two-tran saction creation flow — ask, and we will wr ite them up in detail here.
ShadowTix is an independent, community-built project. It is not created, operated, or endorsed by Tari Labs.
Happy to answer anything in this thread.