# How do you prove your app didn't do something?

**URL:** <https://forum.canton.network/t/how-do-you-prove-your-app-didnt-do-something/9114>\
**Category:** App Development\
**Created:** [September 8, 2026, 9:07am UTC](https://forum.canton.network/t/how-do-you-prove-your-app-didnt-do-something/9114 "2026-09-08T09:07:59Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![orumedominic](https://avatars.discourse-cdn.com/v4/letter/o/3da27b/32.png) [@orumedominic](https://forum.canton.network/u/orumedominic)\
**Post date:** [September 8, 2026, 9:07am UTC](https://forum.canton.network/t/how-do-you-prove-your-app-didnt-do-something/9114/1 "2026-09-08T09:07:59Z")

</div>

Not what it did.  
Logs cover that. What it tried and was stopped from doing.

I hit this building a spend-limited agent wallet. The refusals turned out to  
matter more than the payments, and I could not find a good way to hand  
someone proof that a refusal actually happened.

What I ended up with: every attempt, allowed or refused, becomes one  
hash-chained receipt saying what was tried and which rule decided it.

The limits are assertMsg fences in the Daml, so the refusal is the ledger’s, not  
my app saying so about itself. You can check a chain here with nothing  
installed: [Check a payment record | KYA Rails](https://dominicrume.github.io/cantor8_kya_rails/)

But I might be solving something nobody else has.

Has anyone ever asked you to prove your app didn’t do something?  
What did you show them?

---

<div class="post-metadata">

**Author:** ![Federico\_Rodriguez](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/federico_rodriguez/32/7339_2.png) [@Federico\_Rodriguez](https://forum.canton.network/u/Federico_Rodriguez)\
**Post date:** [September 11, 2026, 12:40pm UTC](https://forum.canton.network/t/how-do-you-prove-your-app-didnt-do-something/9114/2 "2026-09-11T12:40:05Z")

</div>

Hey @orumedominic , Is my understanding correct that the hash-chained receipts are produced by the application based on the response it gets from the participant/validator?

If so, one limitation is that you are still trusting the application to create the receipts and include every attempt. The hash chain makes existing receipts tamper-evident, but it doesn’t prove that a receipt wasn’t omitted or that its contents accurately represent the participant’s response.

An alternative worth considering would be to make the refusal itself a valid Canton transaction. For example, wrap the operation in a choice that checks the policy and either performs the action or creates a `RejectedAttempt` audit record. The transaction commits in both cases, but the underlying action only happens when allowed.

That would make the refusal part of the Canton ledger rather than evidence produced by the application. The trade-off is that rejection becomes explicitly modeled in Daml rather than using a failed transaction.

---

<div class="post-metadata">

**Author:** ![orumedominic](https://avatars.discourse-cdn.com/v4/letter/o/3da27b/32.png) [@orumedominic](https://forum.canton.network/u/orumedominic)\
**Post date:** [September 13, 2026, 12:06pm UTC](https://forum.canton.network/t/how-do-you-prove-your-app-didnt-do-something/9114/4 "2026-09-13T12:06:42Z")

</div>

Yes, that is right. And the omission gap was the real problem.

I built what you described.

A choice called TryCharge checks the policy. If it passes, it pays. If it  
fails, it creates a ChargeRefused contract and pays nothing. Both paths  
commit. That is your RejectedAttempt under another name.

> <https://github.com/dominicrume/cantor8_kya_rails/blob/7b9eeb2d5b9c7ee7850524d4bd3f82229d48498a/step-1-mandate/daml/KyaMandate.daml>

You called the trade-off right too. Rejection is modelled in Daml now.  
That cost a second copy of the rules. They drifted once. I changed one  
comparison. Every test stayed green. The two paths then disagreed about a  
charge landing exactly on the cap. There is a test for that now.

Your caveat still stands. An attempt nobody submits still leaves  
nothing. This only fixes refusals that reached the ledger.

That was better review than most code gets. Thank you.

---

<div class="post-metadata">

**Author:** ![orumedominic](https://avatars.discourse-cdn.com/v4/letter/o/3da27b/32.png) [@orumedominic](https://forum.canton.network/u/orumedominic)\
**Post date:** [October 18, 2026, 8:49am UTC](https://forum.canton.network/t/how-do-you-prove-your-app-didnt-do-something/9114/5 "2026-10-18T08:49:42Z")

</div>

Federico, an update, since your point was the one that mattered.

You said a chain of receipts written by my app cannot prove I left one out.  
Right, and no hash fixes it, because I choose what to hash.

So I stopped hashing and started counting.

One contract per owner and actor. Every attempt consumes it and puts it back  
with the count up by one. The auditor observes that contract, so they read the  
count off the ledger instead of off what I hand them.

Fifty attempts, refusals at 3, 7 and 19. I show them two records. They know one  
is missing and which position it was.

The work and the count commit in the same transaction, so skipping the count  
means skipping the work. That is the part you described, reached from the other  
side.

Two things I could not do. Daml 3 removed contract keys, so I cannot stop  
someone opening a second journal. The auditor sees both, which is detection and  
not prevention. And nothing forces an app to use the journal at all.

Still no credential, so all of it is Daml Script until it runs on DevNet.

Thank you for the review.

---

<div class="post-metadata">

**Author:** ![PREDGE](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/predge/32/7907_2.png) [@PREDGE](https://forum.canton.network/u/PREDGE)\
**Post date:** [October 21, 2026, 1:37pm UTC](https://forum.canton.network/t/how-do-you-prove-your-app-didnt-do-something/9114/6 "2026-10-21T13:37:29Z")

</div>

On the two gaps in your last post. Second journal: if the auditor is a signatory on the journal, not only an observer, nobody can create another one without the auditor’s authority, since a create needs every signatory. That moves it from detection to prevention without contract keys. Nothing forcing the app to use it: put the counter on the mandate itself. If TryCharge is a consuming choice on the contract that holds the spend authority and recreates it with count + 1, there is no way to pay that skips the count. The cost is contention, every attempt for one owner and actor serialises on that one contract.

---

<div class="post-metadata">

**Author:** ![orumedominic](https://avatars.discourse-cdn.com/v4/letter/o/3da27b/32.png) [@orumedominic](https://forum.canton.network/u/orumedominic)\
**Post date:** [October 22, 2026, 10:36pm UTC](https://forum.canton.network/t/how-do-you-prove-your-app-didnt-do-something/9114/7 "2026-10-22T22:36:06Z")

</div>

Both built.

Auditor on the signatory line: the second journal is now impossible. Free at  
runtime, since a choice that recreates the journal already carries its  
signatories’ authority.

Contention: Sharded it. The test holds the original contract ID and uses it  
twice. One journal refuses the second.  
Two shards allow both.

All four properties survive.  
The new failure mode is a hidden shard, so the set declares how many.

What would you break next?

---

<div class="post-metadata">

**Author:** ![orumedominic](https://avatars.discourse-cdn.com/v4/letter/o/3da27b/32.png) [@orumedominic](https://forum.canton.network/u/orumedominic)\
**Post date:** [October 26, 2026, 11:09pm UTC](https://forum.canton.network/t/how-do-you-prove-your-app-didnt-do-something/9114/8 "2026-10-26T23:09:51Z")

</div>

PREDGE, I marked your reply as the solution. It was the fix and the thread should say so.

I read the receipt spec properly this week.

One thing you may want in section 2. RFC 8785 orders keys by UTF-16 code units. Python’s `json.dumps(sort_keys=True, separators=(",", ":"))` orders by code point and escapes non-ASCII by default. They disagree:

```haskell
python : U+FF3A then U+1F600
JCS : U+1F600 then U+FF3A
python : {"x402.resource":"https://a/\u00e9"}
JCS : {"x402.resource":"https://a/é"}

```

Your v1 keys are all ASCII so the ordering is safe today. But `issuer.id` and `x402.resource` are values, and an internationalised origin or a path with an accent will change the canonical bytes. One sentence saying “JCS is not Python’s sorted-keys dump” would save the first Python implementer a day.

Two questions, if you have the time.

What went wrong that made you add the dispute window? A receipt that is provisional until a window closes is a different object, and nobody else on Canton is doing it.

And you have sandbox runs in `docs/runs`. I have never stood one up. Was it worth what it cost you?

You offered a walkthrough on #925. I would take it.

---

<div class="post-metadata">

**Author:** ![orumedominic](https://avatars.discourse-cdn.com/v4/letter/o/3da27b/32.png) [@orumedominic](https://forum.canton.network/u/orumedominic)\
**Post date:** [October 29, 2026, 11:24pm UTC](https://forum.canton.network/t/how-do-you-prove-your-app-didnt-do-something/9114/9 "2026-10-29T23:24:49Z")

</div>

Federico, PREDGE, this went somewhere, and you should both see it.

It is now a CIP draft, and the two of you are in it by name.

Federico, your 11 September reply is the reason it exists. You said a hash chain over receipts cannot prove an omission, however well it is chained, and that a refusal should be a committed Canton transaction instead. I was defending the chain at the time. You were right, and I was not. That argument is the motivation section now.

PREDGE, your 21 October reply is what makes it hold. The auditor is on the signatory line, not the observer line, so a second journal cannot be created rather than merely spotted. I built it, and the test is called testASecondJournalIsPrevented. The boundary you implied is there too, as testWithNoAuditorASecondJournalIsStillPossible, because without an auditor it really does degrade to detection, and the draft says so.

Draft:

> <https://github.com/dominicrume/cantor8_kya_rails/blob/c54d4a7c6fd4ee331b909264f45ee8b643e429f5/docs/cip/cip-rume-refused-actions.md>

One thing I found while writing it up that neither of us knew. Dev Fund proposal #866, OS Ledger, independently arrived at the same auditor-co-signatory mechanism for its period attestations. Two proposals reaching it without talking to each other is the best evidence it is the right shape.

Both packages are published and rebuild byte for byte from source. 165 scripts pass. Nothing has run on DevNet, I hold no credential, and the draft says that too.

If either of you thinks this is wrong, I would rather hear it now than after it goes to CIP-discuss.

---

<div class="post-metadata">

**Author:** ![leonidr](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/leonidr/32/7856_2.png) [@leonidr](https://forum.canton.network/u/leonidr)\
**Post date:** [October 30, 2026, 1:40am UTC](https://forum.canton.network/t/how-do-you-prove-your-app-didnt-do-something/9114/10 "2026-10-30T01:40:16Z")

</div>

Daml runs more than once. The submitting participant interprets the full transaction. Each confirming participant then re-interprets the views it hosts (the model-conformance check) and sends a local verdict to the mediator.

If the submitter’s interpretation fails (a failed assert, fetch or exercise), the transaction never reaches confirmation, and the submitter gets the error from the Ledger API.

The confirmation step protects a stakeholder automatically. If its participant hosts the party with confirmation permission and finds a view that does not conform, the participant rejects it, and the mediator rejects the transaction. Nothing is committed. A non-submitting stakeholder gets no Ledger API event for this. Its participant only logs the rejection. Canton has two kinds of reject codes (`canton/community/base/src/main/scala/com/digitalasset/canton/protocol/LocalRejectError.scala:26-41`):

- `LocalRejectErrorCode`: usually not hostile. Examples: `LOCAL_VERDICT_LOCKED_CONTRACTS`, `LOCAL_VERDICT_INACTIVE_CONTRACTS`, `LOCAL_VERDICT_LEDGER_TIME_OUT_OF_BOUND`, `LOCAL_VERDICT_TIMEOUT`.
- `MalformedErrorCode` (an `AlarmErrorCode`, logged as a security alert): hostile or faulty. Examples: `LOCAL_VERDICT_MALFORMED_REQUEST`, `LOCAL_VERDICT_MALFORMED_PAYLOAD`, `LOCAL_VERDICT_FAILED_MODEL_CONFORMANCE_CHECK`, `LOCAL_VERDICT_BAD_ROOT_HASH_MESSAGES`, `LOCAL_VERDICT_CREATES_EXISTING_CONTRACTS`, `LOCAL_VERDICT_ACTIVATES_EXISTING_CONTRACTS`. An honest submitter cannot cause these, because its own interpretation would fail first. They point to a modified node or a tampered external-party transaction.

To detect such attempts, alert on these codes in the participant logs. If an application needs this data through an API, that is a reasonable request: discuss the use case, and consider a CIP to expose it.

The mediator also stores the verdicts, with the views blinded (no payloads). Splice Scan reads the mediator’s verdict stream and publishes accepted and rejected verdicts on `/v0/events`, with the submitting participant, the parties and the confirmers, but without the reject reason.

---

<div class="post-metadata">

**Author:** ![orumedominic](https://avatars.discourse-cdn.com/v4/letter/o/3da27b/32.png) [@orumedominic](https://forum.canton.network/u/orumedominic)\
**Post date:** [November 4, 2026, 10:11am UTC](https://forum.canton.network/t/how-do-you-prove-your-app-didnt-do-something/9114/12 "2026-11-04T10:11:30Z")

</div>

The use case, and your first three paragraphs move where it sits.

An agent holds a spending mandate. Its principal has to answer one question to  
an auditor: did it ever try to exceed it?

That refusal is an assertion in our own choice body, so it is your second  
paragraph and not your third. It fails in the submitter’s interpretation. No  
messages are sent, no view is non-conforming, no mediator verdict exists and  
Scan has nothing to publish.

The only record is at the submitting participant,  
which is the actor. Your log-alerting advice covers the confirmation-stage  
class, and I had been treating the two as one thing.

So the API you offered to consider would not reach this one. The information  
never leaves the submitter.

That is an argument against how I framed it and,  
I think, for making the refusal a successful transaction instead, so that it  
goes through confirmation like any other and is simply visible.

Thus this question. Is there a protocol-level way for a refusal decided in the  
submitter’s interpretation to leave an artefact beyond that participant, or is  
turning it into an accepted transaction the only route?

---

<div class="post-metadata">

**Author:** ![leonidr](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/leonidr/32/7856_2.png) [@leonidr](https://forum.canton.network/u/leonidr)\
**Post date:** [November 9, 2026, 12:12am UTC](https://forum.canton.network/t/how-do-you-prove-your-app-didnt-do-something/9114/13 "2026-11-09T00:12:17Z")

</div>

If you want your proof to live on the ledger, you have to `create`. But that is a big _if_, as it comes with costs.

---

<div class="post-metadata">

**Author:** ![orumedominic](https://avatars.discourse-cdn.com/v4/letter/o/3da27b/32.png) [@orumedominic](https://forum.canton.network/u/orumedominic)\
**Post date:** [November 9, 2026, 4:08am UTC](https://forum.canton.network/t/how-do-you-prove-your-app-didnt-do-something/9114/14 "2026-11-09T04:08:11Z")

</div>

That is the right objection, and it has a number rather than an answer.

There are two mechanisms now. Simon Meier made the same point on cip-discuss on 30 October and pointed at the EventLog in CIP-0112, so the second one is a non-consuming choice. Twenty refusals through both: recording leaves twenty contracts, signalling leaves none, and the auditor reads back the same count and the same positions from either. That is testTheCostOfBothMechanisms.

The cost of the cheap one, since you did not ask and should have it. Once the events are pruned, a signalled refusal and a refusal whose reason was withheld are the same thing on the ledger, and the party who can prune is the party being audited. That is testASignalledRefusalLooksWithheldOnceEventsAreGone.

So your big if buys survival of pruning, and nothing else. Worth it for evidence, not for telemetry.

---

<div class="post-metadata">

**Author:** ![tonozzibeverley953](https://avatars.discourse-cdn.com/v4/letter/t/5daacb/32.png) [@tonozzibeverley953](https://forum.canton.network/u/tonozzibeverley953)\
**Post date:** [November 11, 2026, 7:11pm UTC](https://forum.canton.network/t/how-do-you-prove-your-app-didnt-do-something/9114/15 "2026-11-11T19:11:53Z")

</div>

Then the deciding factor is retention control, not contract count. If the auditor has no say over pruning on the participant holding the non-consuming signal, that path can never be evidence—only telemetry—even if the read-back matches today. The contract record only earns its cost when it sits under a retention policy the audited party cannot unilaterally change. Does the auditor’s participant have any pruning veto, or is that outside the current model?

---

<div class="post-metadata">

**Author:** ![PREDGE](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/predge/32/7907_2.png) [@PREDGE](https://forum.canton.network/u/PREDGE)\
**Post date:** [November 13, 2026, 1:06pm UTC](https://forum.canton.network/t/how-do-you-prove-your-app-didnt-do-something/9114/16 "2026-11-13T13:06:29Z")

</div>

I don’t think the auditor needs a veto over someone else’s pruning. Pruning is per participant: each node prunes only what it stores for the parties it hosts. So the question becomes whether the auditor’s own participant ever receives the record.

For the non-consuming path that depends on who is an informee. A non-consuming exercise goes to signatories, actors and choice observers, not to plain contract observers. If the auditor is a choice observer on the refusal choice, every refusal event lands on the auditor’s participant, and the audited party’s pruning can’t touch that copy. Retention is then the auditor’s own policy, which is what makes it evidence rather than telemetry.

The remaining gap is completeness: the auditor holds every event it was shown, but can’t prove nothing was hidden from it. A counter on the mandate contract, bumped by each refusal, closes that, since a missing number shows up on read-back.

---

<div class="post-metadata">

**Author:** ![orumedominic](https://avatars.discourse-cdn.com/v4/letter/o/3da27b/32.png) [@orumedominic](https://forum.canton.network/u/orumedominic)\
**Post date:** [November 13, 2026, 9:12pm UTC](https://forum.canton.network/t/how-do-you-prove-your-app-didnt-do-something/9114/17 "2026-11-13T21:12:57Z")

</div>

You were right, and I ran it against a real ledger rather than arguing about it.

Three attacks on the journal, with a control that refuses to report if an honest run shows a gap: honest disclosure, no gap.

Collude to archive a disclosed record, gap at position 3, detected.  
Collude to invent a refusal that never happened, gap at position 4, detected.  
Record by the cheap mechanism with nothing created, gaps at 1, 2 and 3.

The counter is what does it, exactly as you said.  
The count sits on a contract the auditor signs, so the operator cannot move it alone.

Your informee point holds too, measured the same way: a choice observer receives a non-consuming exercise, a plain contract observer does not.

What I still cannot answer is the pruning question above. One participant hosts every party on a sandbox. LocalNet next.

```haskell
python3 tools/can_the_auditor_tell.py

```

---

<div class="post-metadata">

**Author:** ![PREDGE](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/predge/32/7907_2.png) [@PREDGE](https://forum.canton.network/u/PREDGE)\
**Post date:** [November 17, 2026, 5:19pm UTC](https://forum.canton.network/t/how-do-you-prove-your-app-didnt-do-something/9114/18 "2026-11-17T17:19:07Z")

</div>

Good result. On pruning, the sandbox can’t show it, because one participant prunes for everyone. On LocalNet I’d host the auditor on its own participant (app-user vs. sv is enough), then:

1. 20 refusals through the choice-observer path;
2. prune the operator’s participant past those offsets;
3. read back from the auditor’s participant.

If the auditor is the choice observer, the count and positions should survive step 2 unchanged. The same run with the auditor as a plain contract observer should come back empty, which also gives the CIP a test for the informee rule.

On your two earlier questions, which I never answered:

- **Dispute window.** Our verdicts settle real payments, and an evidence-based verdict can be wrong, or new evidence can arrive after it. A provisional window lets either side challenge before money moves; after it closes, the receipt is final. Funds can’t come back once paid, so the window sits before the payout, not after.
- **Sandbox runs.** Worth it for exactly what you just did: a test that fails on a real attack beats an argument. LocalNet took us about half a day the first time. Happy to do the walkthrough; pick a slot: [Calendly](http://calendly.com/hello-predge/30min)
