<?xml version="1.0" encoding="utf-8"?>
<!-- name="GENERATOR" content="github.com/mmarkdown/mmark Mmark Markdown Processor - mmark.miek.nl" -->
<rfc version="3" ipr="trust200902" docName="draft-hopley-x402-cancellation-receipt-01" submissionType="IETF" category="info" xml:lang="en" xmlns:xi="http://www.w3.org/2001/XInclude" indexInclude="true">

<front>
<title abbrev="x402-cancellation-receipt">Categorical Mandate Cancellation Receipt Format for Agentic-Payment Flows</title><seriesInfo value="draft-hopley-x402-cancellation-receipt-01" stream="IETF" status="informational" name="Internet-Draft"></seriesInfo>
<author initials="C." surname="Hopley" fullname="Christopher Hopley"><organization>AlgoVoi</organization><address><postal><street></street>
</postal><email>chopmob@gmail.com</email>
</address></author><date year="2026" month="May" day="30"></date>
<area>Independent Submission</area>
<workgroup>Independent Submission</workgroup>
<keyword>x402</keyword>
<keyword>agentic payments</keyword>
<keyword>mandate</keyword>
<keyword>cancellation</keyword>
<keyword>recurring payments</keyword>
<keyword>JCS</keyword>
<keyword>RFC 8785</keyword>
<keyword>audit chain</keyword>
<keyword>categorical receipt</keyword>
<keyword>PSD2</keyword>
<keyword>MiCA</keyword>

<abstract>
<t>This document specifies a categorical mandate cancellation receipt
format for agentic-payment flows. The format records that a
recurring-payment mandate or other standing payer-to-payee
authorisation has been cancelled, by whom, for what reason, and with
what effective date.</t>
<t>The receipt format uses a closed four-element enumeration of
categorical outcomes (USER_REQUESTED, MERCHANT_REQUESTED,
COMPLIANCE_TERMINATED, EXPIRED). The four-state enumeration preserves
the regulatorily-load-bearing distinction between
payer-initiated revocation, payee-initiated termination,
operator/compliance-forced termination, and time-based expiry. A
collapse to a three-state or binary representation loses operational
distinctions that drive PSD2 (Directive 2015/2366) Article 64
refund-window obligations, Article 72 contractual-termination
record-keeping, and POCA/AML evidence-chain linkage on
compliance-forced terminations.</t>
<t>The format records two distinct timestamps -- when the cancellation
was observed (<tt>cancellation_timestamp_ms</tt>) and when it takes legal
effect (<tt>effective_from_ms</tt>) -- to support PSD2 Article 64(3)(a)
direct-debit revocation timing, where the effective time is typically
end-of-business-day prior to the next scheduled execution.</t>
<t>The format composes with the AlgoVoi-authored compliance receipt
(draft-hopley-x402-compliance-receipt), settlement attestation
(draft-hopley-x402-settlement-attestation), and refund receipt
(draft-hopley-x402-refund-receipt) formats under the same
canonicalisation discipline (draft-hopley-x402-canonicalisation-jcs).
A verifier walking the audit chain confirms the full mandate
lifecycle from admission through recurring execution to cancellation,
and (where owed) onward to refund of revoked settled debits, under
one byte-deterministic canonicalisation pin.</t>
</abstract>

</front>
<middle>
<section anchor="sect-1-introduction"><name>Introduction</name>

<section anchor="sect-1-1-motivation"><name>Motivation</name>
<t>Agentic-payment flows generate categorical receipts across the
mandate lifecycle. Where the compliance receipt format
(draft-hopley-x402-compliance-receipt) admits a mandate and the
settlement attestation format (draft-hopley-x402-settlement-attestation)
records recurring executions, mandate termination is the corresponding
end-state. Termination is not a degenerate refund; it is its own
state transition with its own regulatory consequences.</t>
<t>The operational and regulatory distinctions are load-bearing across
four genuinely-different states:</t>

<ul spacing="compact">
<li>A payer-initiated revocation
(PSD2 (Directive 2015/2366) Article 64, UK Consumer Rights Act
2015 consumer-revocation provisions) MAY trigger refund obligations
on debits already settled prior to the revocation effective date.</li>
<li>A payee-initiated termination (PSD2 Article 72 + contractual
terms) records the end of a recurring billing arrangement but
does NOT trigger consumer-revocation refund-window obligations on
already-settled debits.</li>
<li>A compliance-forced termination (sanctions hit on payer, KYC
failure, AML alert, court order, regulator directive) triggers
POCA s.330 and AML 5+6 audit-chain evidence linkage back to the
originating compliance event. The recorded receipt is the
evidentiary anchor.</li>
<li>A time-based expiry (mandate reached its agreed end-date or
maximum-execution count) records that the mandate's own terms
terminated it. No party-initiated regulatory action is required
beyond standard record-keeping.</li>
</ul>
<t>A receipt format that collapses these to a three-state enumeration
(e.g. PARTY_REQUESTED + AUTO_TERMINATED) loses the payer-vs-payee
distinction that drives the PSD2 Article 64 refund-window obligation.
A collapse to two-state (CANCELLED / EXPIRED) loses both that
distinction and the compliance-forced flag that anchors the
AML/POCA evidence chain.</t>
<t>This document specifies a cancellation receipt format that preserves
the four-state categorical outcome at the canonical-bytes level and
records the two timestamps (event recording time and legal effective
time) independently.</t>
</section>

<section anchor="sect-1-2-scope"><name>Scope</name>
<t>This document specifies:</t>

<ul spacing="compact">
<li>The canonical JSON shape of the cancellation receipt (Section 3).</li>
<li>The reference to the canonicalisation rule applicable to the
receipt (Section 4 -- normative reference to
draft-hopley-x402-canonicalisation-jcs, not redefined inline).</li>
<li>The audit chain composition under which cancellation receipts
compose with compliance receipts, settlement attestations, and
refund receipts (Section 5).</li>
<li>The year-N auditability properties the format pins (Section 6).</li>
<li>Composition patterns across the AlgoVoi receipt-format suite
(Section 7).</li>
<li>Worked examples covering all four cancellation_reason outcomes
(Appendix A).</li>
</ul>
<t>This document does NOT specify:</t>

<ul spacing="compact">
<li>The mandate format itself. The cancellation receipt references
the mandate via a content-addressed <tt>mandate_ref</tt> of the form
<tt>sha256:&lt;hex&gt;</tt>. The mandate record MAY be a compliance receipt,
an Agent Payment Protocol (AP2) mandate object, a Merchant
Payment Protocol (MPP) subscription record, or any
operator-specific mandate format.</li>
<li>The refund flow triggered by a USER_REQUESTED cancellation.
Refund obligations and their categorical receipt format are
specified in draft-hopley-x402-refund-receipt. This document
records only that the cancellation occurred and notes (per
<tt>cancellation_reason</tt>) whether a refund obligation may apply.</li>
<li>The compliance event that drives a COMPLIANCE_TERMINATED outcome.
That event is recorded in a separate compliance receipt
(draft-hopley-x402-compliance-receipt) and linked via the audit
chain.</li>
</ul>
</section>

<section anchor="sect-1-3-relationship-to-other-internet-drafts"><name>Relationship to other Internet-Drafts</name>
<t>This document normatively references:</t>

<ul spacing="compact">
<li>draft-hopley-x402-canonicalisation-jcs -- the JCS canonicalisation
discipline pinned in Section 4.</li>
</ul>
<t>This document is complementary to:</t>

<ul spacing="compact">
<li>draft-hopley-x402-compliance-receipt -- admission-time compliance
screening receipts. A cancellation receipt's <tt>mandate_ref</tt> MAY
equal the <tt>content_hash</tt> of the compliance receipt that admitted
the mandate.</li>
<li>draft-hopley-x402-settlement-attestation -- per-execution
settlement attestations during the mandate's life.</li>
<li>draft-hopley-x402-refund-receipt -- post-cancellation refund
receipts. A refund receipt's <tt>original_payment_ref</tt> MAY reference
a settlement attestation that became refundable as a result of a
USER_REQUESTED cancellation recorded under this document.</li>
</ul>
</section>
</section>

<section anchor="sect-2-conventions-and-definitions"><name>Conventions and Definitions</name>

<section anchor="sect-2-1-notation"><name>Notation</name>
<t>The key words &quot;MUST&quot;, &quot;MUST NOT&quot;, &quot;REQUIRED&quot;, &quot;SHALL&quot;, &quot;SHALL NOT&quot;,
&quot;SHOULD&quot;, &quot;SHOULD NOT&quot;, &quot;RECOMMENDED&quot;, &quot;NOT RECOMMENDED&quot;, &quot;MAY&quot;, and
&quot;OPTIONAL&quot; in this document are to be interpreted as described in
BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all
capitals, as shown here.</t>
</section>

<section anchor="sect-2-2-definitions"><name>Definitions</name>
<t><strong>cancellation receipt</strong>: a JSON object of the shape specified in
Section 3, canonicalised under the discipline of
draft-hopley-x402-canonicalisation-jcs.</t>
<t><strong>content_hash</strong>: SHA-256, lowercase hex, of the JCS-canonical bytes
of the cancellation receipt object.</t>
<t><strong>mandate_ref</strong>: a string of the form <tt>sha256:&lt;lowercase-hex-64&gt;</tt>
identifying the mandate record being cancelled by content hash. The
mandate record itself is out of scope of this document.</t>
<t><strong>cancellation_reason</strong>: a string-valued field carrying one of four
closed enumeration values. See Section 3.1.</t>
<t><strong>canon_version</strong>: an in-band string identifying the canonicalisation
discipline. Fixed value <tt>jcs-rfc8785-v1</tt> for this version.</t>
</section>
</section>

<section anchor="sect-3-receipt-format-specification"><name>Receipt Format Specification</name>
<t>A cancellation receipt is a JSON object with the following seven
fields. All fields are REQUIRED. The receipt is canonicalised under
draft-hopley-x402-canonicalisation-jcs per Section 4. Field names are
sorted lexicographically by JCS during canonicalisation; the object
itself uses arbitrary authoring order.</t>

<section anchor="sect-3-1-cancellation-reason"><name>cancellation_reason</name>
<t>A string-valued field. The value MUST be one of:</t>

<ul spacing="compact">
<li><tt>USER_REQUESTED</tt> -- the payer revoked the mandate. PSD2 Article 64
applies. UK Consumer Rights Act 2015 consumer-revocation
provisions apply. Triggers payer-side refund-window calculations
for direct debits already settled prior to the effective date.</li>
<li><tt>MERCHANT_REQUESTED</tt> -- the payee terminated the recurring
billing arrangement. PSD2 Article 72 and contractual terms apply.
Does NOT trigger consumer-revocation refund-window obligations
on already-settled debits.</li>
<li><tt>COMPLIANCE_TERMINATED</tt> -- the operator (gateway, facilitator,
bank, regulator) forced termination from a post-mandate
compliance trigger: sanctions hit on payer, KYC failure, AML
alert, court order, regulator directive. Triggers POCA s.330 and
AML 5+6 audit-chain linkage back to the originating compliance
event.</li>
<li><tt>EXPIRED</tt> -- the mandate reached its agreed end-date or
maximum-execution count. No party-initiated decision; the
mandate's own terms terminated it. Standard record-keeping only.</li>
</ul>
<t>The four-element enumeration is closed. Implementations MUST reject
any other value at validation time before canonicalisation. Free-form
&quot;reason&quot; strings, dispute codes, or operator-internal classification
labels are not acceptable substitutes for the categorical outcome.</t>
<t>The regulatory distinction is load-bearing. The four-value
enumeration is one wider than the three-value enums in sibling
formats because the regulatorily-load-bearing distinctions in
mandate termination are genuinely four-state:
payer vs payee vs operator vs time.</t>
</section>

<section anchor="sect-3-2-cancellation-provider-did"><name>cancellation_provider_did</name>
<t>A string-valued DID URI identifying the entity issuing the
cancellation receipt (gateway, facilitator, payer-bank, operator).</t>
</section>

<section anchor="sect-3-3-cancellation-timestamp-ms"><name>cancellation_timestamp_ms</name>
<t>An integer-valued field carrying the epoch-millisecond timestamp at
which the cancellation event was observed and recorded by the
issuing provider, in UTC.</t>
<t>This field MUST be an integer. RFC 3339 string forms (e.g.
<tt>&quot;2026-05-30T12:00:00Z&quot;</tt>) MUST be rejected at the validation layer
before canonicalisation. This is Substrate Rule 2, normatively
specified in draft-hopley-x402-canonicalisation-jcs Section 4.1.</t>
</section>

<section anchor="sect-3-4-effective-from-ms"><name>effective_from_ms</name>
<t>An integer-valued field carrying the epoch-millisecond timestamp at
which the cancellation takes legal effect, in UTC.</t>
<t><tt>effective_from_ms</tt> MUST be greater than or equal to
<tt>cancellation_timestamp_ms</tt>. Implementations MUST reject receipts
where the effective time precedes the recording time, both at
validation time and at verification time.</t>
<t>For most cancellations the two timestamps are equal. The independent
encoding supports PSD2 Article 64(3)(a) direct-debit revocation
timing, where the agreed effective time is typically the end of the
working day before the next scheduled execution -- distinct from the
moment the revocation was recorded.</t>
<t>For COMPLIANCE_TERMINATED outcomes the effective time MAY be
immediate (equal to the recording time) or scheduled
(regulator-directed future effective date).</t>
<t>Substrate Rule 2 applies: integer-only, RFC 3339 string forms
rejected.</t>
</section>

<section anchor="sect-3-5-jurisdiction-flags"><name>jurisdiction_flags</name>
<t>An ordered array of string-valued ISO-3166-1 alpha-2 country codes
or alpha-3 region codes identifying the applicable regulatory
frameworks for the cancellation event.</t>
<t>Authoring convention: primary jurisdiction first (where the
operating entity is licensed), secondary jurisdictions in order of
regulatory precedence.</t>
<t>Array element ORDER is SIGNIFICANT and load-bearing per
draft-hopley-x402-canonicalisation-jcs Section 4.3.</t>
</section>

<section anchor="sect-3-6-mandate-ref"><name>mandate_ref</name>
<t>A string-valued field of the form <tt>sha256:&lt;lowercase-hex-64&gt;</tt>. The
hex digest is SHA-256 of the JCS-canonical bytes of the mandate
record being cancelled.</t>
<t>When the mandate was admitted under a compliance receipt (per
draft-hopley-x402-compliance-receipt), the <tt>mandate_ref</tt> MAY equal
the <tt>content_hash</tt> of that compliance receipt. This is the
conventional choice and enables the audit-chain composition
described in Section 5.</t>
<t>When the original mandate record is an operator-specific format
(AP2 mandate object, MPP subscription record, custom recurring
authorisation), the <tt>mandate_ref</tt> is the SHA-256 of that record's
JCS-canonical bytes.</t>
<t>Implementations MUST NOT strip the <tt>sha256:</tt> prefix during
canonicalisation or verification.</t>
</section>

<section anchor="sect-3-7-canon-version"><name>canon_version</name>
<t>A string-valued in-band canonicalisation rule pin. For this version
of the receipt format the value MUST be <tt>jcs-rfc8785-v1</tt>.</t>
</section>
</section>

<section anchor="sect-4-canonicalisation"><name>Canonicalisation</name>
<t>The cancellation receipt MUST be canonicalised under the discipline
pinned by draft-hopley-x402-canonicalisation-jcs and identified by
the URN:</t>

<artwork><![CDATA[urn:x402:canonicalisation:jcs-rfc8785-v1
]]></artwork>
<t>The full normative specification of the discipline (JCS RFC 8785
plus the schema-normalisation requirements including Substrate
Rule 2) is in that document. This document does not redefine the
discipline inline.</t>
</section>

<section anchor="sect-5-audit-chain-composition"><name>Audit Chain Composition</name>
<t>A cancellation receipt MAY participate in an audit chain alongside
compliance receipts, settlement attestations, refund receipts, and
other receipt classes that pin the same canonicalisation discipline.</t>

<section anchor="sect-5-1-chain-row-shape"><name>Chain Row Shape</name>
<t>The audit chain row shape used by this document is identical to
that specified in draft-hopley-x402-compliance-receipt Section 5.1
and reused by the settlement attestation
(draft-hopley-x402-settlement-attestation) and refund receipt
(draft-hopley-x402-refund-receipt) formats. The row shape is:</t>

<sourcecode type="json"><![CDATA[{
  "row_number": 1,
  "content_hash": "<hex64>",
  "prev_hash": "<hex64>",
  "row_content_hash": "<hex64>"
}
]]></sourcecode>
<t>Row 1's <tt>prev_hash</tt> MUST be 64 zero hex characters. Row N's
<tt>prev_hash</tt> MUST equal row N-1's <tt>row_content_hash</tt>.</t>
</section>

<section anchor="sect-5-2-linkage-verification"><name>Linkage Verification</name>
<t>Per draft-hopley-x402-compliance-receipt Section 5.2: a verifier
reading a chain segment recomputes each row's <tt>row_content_hash</tt>
from its first three fields and confirms forward linkage via
<tt>prev_hash</tt>. Any mismatch indicates tampering or chain integrity
loss.</t>
</section>

<section anchor="sect-5-3-composition-with-compliance-receipts"><name>Composition with Compliance Receipts</name>
<t>When a cancellation receipt references a compliance receipt via
<tt>mandate_ref</tt>, the audit-chain composition is:</t>

<artwork><![CDATA[chain row N      chain row N+1
+------------+   +---------------+
| compliance |-->| cancellation  |
| receipt    |   | receipt       |
| (ALLOW)    |   | (USER_REQ)    |
+------------+   +---------------+
]]></artwork>
<t>Row N anchors the compliance receipt admitting the mandate. Row N+1
anchors the cancellation receipt. The cancellation receipt's
<tt>mandate_ref</tt> equals row N's <tt>content_hash</tt>. Chain linkage via
<tt>prev_hash</tt> confirms ordering.</t>
</section>

<section anchor="sect-5-4-composition-with-settlement-attestations"><name>Composition with Settlement Attestations</name>
<t>For mandates with intervening recurring executions, settlement
attestations occupy rows between the compliance receipt and the
cancellation receipt:</t>

<artwork><![CDATA[chain row N      chain row N+1     chain row N+2    chain row N+3
+------------+   +-------------+   +-------------+  +---------------+
| compliance |-->| settlement  |-->| settlement  |->| cancellation  |
| receipt    |   | attestation |   | attestation |  | receipt       |
| (ALLOW)    |   | (SETTLED)   |   | (SETTLED)   |  | (USER_REQ)    |
+------------+   +-------------+   +-------------+  +---------------+
       row N           row N+1           row N+2          row N+3
]]></artwork>
<t>A verifier walking the chain confirms the full mandate lifecycle
under one canonicalisation pin.</t>
</section>

<section anchor="sect-5-5-composition-with-refund-receipts"><name>Composition with Refund Receipts</name>
<t>When a USER_REQUESTED cancellation triggers a refund obligation
under PSD2 Article 64 (refund of a recently-settled debit that
predated the cancellation but post-dated the effective revocation
window), a refund receipt MAY follow:</t>

<artwork><![CDATA[chain row N+3        chain row N+4
+---------------+    +------------+
| cancellation  |--->| refund     |
| receipt       |    | receipt    |
| (USER_REQ)    |    | (FULL)     |
+---------------+    +------------+
]]></artwork>
<t>The refund receipt's <tt>original_payment_ref</tt> references the
settlement attestation being refunded (not the cancellation
receipt). The cancellation receipt is the chain-evidence anchor
that establishes why the refund is owed.</t>
</section>
</section>

<section anchor="sect-6-year-n-auditability-properties"><name>Year-N Auditability Properties</name>
<t>The same six properties pinned by
draft-hopley-x402-canonicalisation-jcs Section 5 apply to the
cancellation receipt:</t>

<ol spacing="compact">
<li>Self-describing canonicalisation pin via <tt>canon_version</tt>.</li>
<li>No external rule registry required.</li>
<li>Cross-implementation verifiability (8-implementation matrix per
the discipline I-D).</li>
<li>Tamper detection via per-row <tt>content_hash</tt> and chain <tt>prev_hash</tt>
linkage.</li>
<li>Regulatory distinction preserved via closed enumeration.</li>
</ol>
<t>Plus one cancellation-specific property:</t>

<ol spacing="compact" start="6">
<li><strong>Mandate-cancellation evidence chain.</strong> A verifier reading a
retained cancellation receipt years after emission can determine
(a) which mandate was cancelled (via <tt>mandate_ref</tt>), (b) who
cancelled it (via the combination of <tt>cancellation_reason</tt> and
<tt>cancellation_provider_did</tt>), (c) when the cancellation was
recorded (<tt>cancellation_timestamp_ms</tt>), and (d) when it became
effective (<tt>effective_from_ms</tt>), without dependence on the
issuing operator's continued operation.</li>
</ol>
</section>

<section anchor="sect-7-composition-with-other-x402-substrate"><name>Composition with Other x402 Substrate</name>

<section anchor="sect-7-1-compliance-receipt-linkage"><name>Compliance Receipt Linkage</name>
<t>See Section 5.3. The conventional <tt>mandate_ref</tt> target for a
mandate admitted under a compliance receipt is the <tt>content_hash</tt>
of that compliance receipt.</t>
</section>

<section anchor="sect-7-2-settlement-attestation-linkage"><name>Settlement Attestation Linkage</name>
<t>See Section 5.4. Settlement attestations recording recurring
executions occupy chain rows between the admission and the
cancellation. The cancellation receipt does not reference
individual settlement attestations directly; chain linkage via
<tt>prev_hash</tt> establishes ordering.</t>
</section>

<section anchor="sect-7-3-refund-receipt-linkage"><name>Refund Receipt Linkage</name>
<t>See Section 5.5. A USER_REQUESTED cancellation MAY be followed in
the chain by a refund receipt if PSD2 Article 64 refund obligations
attach to a recently-settled debit.</t>
</section>

<section anchor="sect-7-4-non-goals"><name>Non-Goals</name>
<t>This document does not encode:</t>

<ul spacing="compact">
<li>The mandate's terms (frequency, cap, expiry condition). Those
belong in the mandate record itself.</li>
<li>The refund obligation determination. PSD2 Article 64 refund-window
applicability is verifier-side judgement against retained
settlement attestations.</li>
<li>The compliance event driving a COMPLIANCE_TERMINATED outcome.
That belongs in a separate compliance receipt linked via the
audit chain.</li>
</ul>
</section>
</section>

<section anchor="sect-8-iana-considerations"><name>IANA Considerations</name>

<section anchor="sect-8-1-urn-namespace-registration"><name>URN Namespace Registration</name>
<t>This document references the URN
<tt>urn:x402:canonicalisation:jcs-rfc8785-v1</tt> registered by
draft-hopley-x402-canonicalisation-jcs Section 10.1. No additional
URN namespace registration is required by this document.</t>
</section>

<section anchor="sect-8-2-receipt-format-identifier"><name>Receipt Format Identifier</name>
<t>This document defines the receipt format identifier:</t>

<artwork><![CDATA[urn:x402:receipt:cancellation-receipt-v1
]]></artwork>
<t>This identifier MAY be used by composite-trust-query implementations
to refer to cancellation receipts as a class. Registration with
IANA is requested under the <tt>x402</tt> URN namespace.</t>
</section>
</section>

<section anchor="sect-9-security-considerations"><name>Security Considerations</name>

<section anchor="sect-9-1-receipt-tampering"><name>Receipt Tampering</name>
<t>A cancellation receipt's <tt>content_hash</tt> is the SHA-256 of its
JCS-canonical bytes. Tampering with any field produces a different
hash; the tampered receipt fails verification against any
audit-chain row referencing the original <tt>content_hash</tt>.</t>
</section>

<section anchor="sect-9-2-backdated-cancellation"><name>Backdated Cancellation</name>
<t>The two-timestamp design (<tt>cancellation_timestamp_ms</tt> recording
event time, <tt>effective_from_ms</tt> recording legal effective time)
admits a class of attack where a malicious operator emits a
receipt at time T with <tt>effective_from_ms</tt> set to a past
timestamp T' &lt; T, to retroactively void a debit that has already
settled.</t>
<t>Mitigation is verifier-side: a verifier MUST cross-check the
<tt>cancellation_timestamp_ms</tt> against operator-emission-time
evidence (TLS log, audit-chain <tt>prev_hash</tt> of the row recording
this receipt, external timestamping service) before accepting a
claimed effective time in the past.</t>
<t>The <tt>effective_from_ms &gt;= cancellation_timestamp_ms</tt> invariant
required by Section 3.4 prevents the simpler attack of stamping
the recording time in the past, but does not by itself prevent
all backdating attacks.</t>
</section>

<section anchor="sect-9-3-reason-spoofing"><name>Reason Spoofing</name>
<t>A malicious operator could emit a MERCHANT_REQUESTED receipt for
what was actually a USER_REQUESTED cancellation, to avoid the
PSD2 Article 64 refund-window obligation. Detection requires
out-of-band evidence (payer complaint, payer-side log, regulator
inspection). The <tt>cancellation_provider_did</tt> identifies the
attesting party, supporting accountability.</t>
</section>

<section anchor="sect-9-4-compliance-terminated-receipt-disclosure"><name>Compliance-Terminated Receipt Disclosure</name>
<t>A COMPLIANCE_TERMINATED receipt records that a compliance trigger
fired against the payer. Such a receipt MAY contain
indirectly-disclosing information: the existence of the
cancellation under that reason, combined with public sanctions
listing dates, MAY reveal that the payer was placed on a
sanctions list.</t>
<t>Implementations SHOULD restrict access to COMPLIANCE_TERMINATED
receipts to parties with a legitimate audit interest (regulator,
auditor, court order). Public disclosure of such receipts is NOT
in scope of this document.</t>
</section>

<section anchor="sect-9-5-operator-continuity-loss"><name>Operator Continuity Loss</name>
<t>If the original attesting operator becomes unavailable, the audit
chain and its cancellation receipts MUST remain independently
verifiable from retained bytes plus the reference implementations
cited in draft-hopley-x402-canonicalisation-jcs Section 7.</t>
</section>
</section>

</middle>
<back>
<section anchor="sect-10-references"><name>References</name>

<section anchor="sect-10-1-normative-references"><name>Normative References</name>

<ul spacing="compact">
<li>[RFC2119] Bradner, S., &quot;Key words for use in RFCs to Indicate
Requirement Levels&quot;, BCP 14, RFC 2119, DOI 10.17487/RFC2119,
March 1997.</li>
<li>[RFC8174] Leiba, B., &quot;Ambiguity of Uppercase vs Lowercase in RFC
2119 Key Words&quot;, BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017.</li>
<li>[RFC8259] Bray, T., Ed., &quot;The JavaScript Object Notation (JSON)
Data Interchange Format&quot;, STD 90, RFC 8259, DOI 10.17487/RFC8259,
December 2017.</li>
<li>[RFC8785] Rundgren, A., Jordan, B., and S. Erdtman, &quot;JSON
Canonicalization Scheme (JCS)&quot;, RFC 8785, DOI 10.17487/RFC8785,
June 2020.</li>
<li>draft-hopley-x402-canonicalisation-jcs
Hopley, C., &quot;JCS Canonicalisation Discipline for Agentic-Payment
Receipts&quot;, draft-hopley-x402-canonicalisation-jcs-v1, May 2026.</li>
</ul>
</section>

<section anchor="sect-10-2-informative-references"><name>Informative References</name>

<ul spacing="compact">
<li>draft-hopley-x402-compliance-receipt
Hopley, C., &quot;Categorical Compliance Screening Receipt Format for
Agentic-Payment Flows&quot;, draft-hopley-x402-compliance-receipt-00,
May 2026.</li>
<li>draft-hopley-x402-settlement-attestation
Hopley, C., &quot;Categorical Settlement Attestation Format for
Agentic-Payment Flows&quot;, draft-hopley-x402-settlement-attestation-00,
May 2026.</li>
<li>draft-hopley-x402-refund-receipt
Hopley, C., &quot;Categorical Refund Receipt Format for
Agentic-Payment Flows&quot;, draft-hopley-x402-refund-receipt-00,
May 2026.</li>
<li>[AlgoVoi-Substrate-Authorship]
AlgoVoi, &quot;Substrate Authorship and Provenance&quot;,
<eref target="https://docs.algovoi.co.uk/substrate-authorship-provenance"> target="https://docs.algovoi.co.uk/substrate-authorship-provenance"</eref></li>
<li>EU Payment Services Directive 2 (PSD2, Directive 2015/2366),
Articles 64, 72, 89.</li>
<li>EU Markets in Crypto-Assets Regulation (MiCA, Regulation (EU)
2023/1114), Article 80.</li>
<li>EU Anti-Money Laundering Regulation (AMLR, Regulation (EU)
2024/1624), Article 56.</li>
<li>EU Anti-Money Laundering Directive 5 (Directive (EU) 2018/843).</li>
<li>EU Anti-Money Laundering Directive 6 (Directive (EU) 2018/1673).</li>
<li>UK Proceeds of Crime Act 2002, section 330.</li>
<li>UK Consumer Rights Act 2015.</li>
</ul>
</section>
</section>

<section anchor="appendix-a-examples-informative"><name>Appendix A. Examples (Informative)</name>

<section anchor="a-1-user-requested-revocation-under-psd2-article-64"><name>A.1. USER_REQUESTED revocation under PSD2 Article 64</name>

<sourcecode type="json"><![CDATA[{
  "canon_version": "jcs-rfc8785-v1",
  "cancellation_provider_did": "did:web:api.algovoi.co.uk",
  "cancellation_reason": "USER_REQUESTED",
  "cancellation_timestamp_ms": 1716494400000,
  "effective_from_ms": 1716537600000,
  "jurisdiction_flags": ["UK", "EU"],
  "mandate_ref": "sha256:0dd5d0b76c9b9281fdeb2509ad38ab132b16a17385ca01d976ff9e6e12563a0f"
}
]]></sourcecode>
<t>Records a payer-initiated revocation under PSD2 Article 64 with
effective time set to end-of-business-day prior to the next
scheduled execution per Article 64(3)(a). If a debit already
settled within the recoverable window prior to the effective date,
a refund receipt MAY follow.</t>
</section>

<section anchor="a-2-merchant-requested-termination-under-psd2-article-72"><name>A.2. MERCHANT_REQUESTED termination under PSD2 Article 72</name>

<sourcecode type="json"><![CDATA[{
  "canon_version": "jcs-rfc8785-v1",
  "cancellation_provider_did": "did:web:api.algovoi.co.uk",
  "cancellation_reason": "MERCHANT_REQUESTED",
  "cancellation_timestamp_ms": 1716494400000,
  "effective_from_ms": 1716537600000,
  "jurisdiction_flags": ["UK", "EU"],
  "mandate_ref": "sha256:0dd5d0b76c9b9281fdeb2509ad38ab132b16a17385ca01d976ff9e6e12563a0f"
}
]]></sourcecode>
<t>Records payee-initiated termination of the recurring billing
arrangement. Does not trigger the Article 64 refund-window
obligation on already-settled debits.</t>
</section>

<section anchor="a-3-compliance-terminated-under-sanctions-hit"><name>A.3. COMPLIANCE_TERMINATED under sanctions hit</name>

<sourcecode type="json"><![CDATA[{
  "canon_version": "jcs-rfc8785-v1",
  "cancellation_provider_did": "did:web:api.algovoi.co.uk",
  "cancellation_reason": "COMPLIANCE_TERMINATED",
  "cancellation_timestamp_ms": 1716494400000,
  "effective_from_ms": 1716494400000,
  "jurisdiction_flags": ["UK", "EU"],
  "mandate_ref": "sha256:0dd5d0b76c9b9281fdeb2509ad38ab132b16a17385ca01d976ff9e6e12563a0f"
}
]]></sourcecode>
<t>Records immediate operator-forced termination. Effective time
equals recording time. Anchors POCA s.330 and AML 5+6 audit-chain
linkage back to the originating compliance receipt (a separate
record).</t>
</section>

<section anchor="a-4-expired-at-agreed-mandate-end-date"><name>A.4. EXPIRED at agreed mandate end-date</name>

<sourcecode type="json"><![CDATA[{
  "canon_version": "jcs-rfc8785-v1",
  "cancellation_provider_did": "did:web:api.algovoi.co.uk",
  "cancellation_reason": "EXPIRED",
  "cancellation_timestamp_ms": 1716494400000,
  "effective_from_ms": 1716494400000,
  "jurisdiction_flags": ["UK", "EU"],
  "mandate_ref": "sha256:0dd5d0b76c9b9281fdeb2509ad38ab132b16a17385ca01d976ff9e6e12563a0f"
}
]]></sourcecode>
<t>Records time-based expiry of the mandate. Standard record-keeping
only; no further regulatory action attaches.</t>
</section>
</section>

<section anchor="appendix-b-reference-implementations-informative"><name>Appendix B. Reference Implementations (Informative)</name>
<t>The following open-source implementations conform to this format:</t>

<ul>
<li><t>algovoi-cancellation-receipt (Python) on PyPI:
<eref target="https://pypi.org/project/algovoi-cancellation-receipt/"> target="https://pypi.org/project/algovoi-cancellation-receipt/"</eref>
Provides <tt>build_cancellation_receipt()</tt>. Depends on
algovoi-substrate for the JCS canonicalisation primitive.
Apache 2.0 licensed.</t>
</li>
<li><t>@algovoi/cancellation-receipt (TypeScript) on npm:
<eref target="https://www.npmjs.com/package/@algovoi/cancellation-receipt"> target="https://www.npmjs.com/package/@algovoi/cancellation-receipt"</eref>
Byte-for-byte parity with the Python sibling. Depends on
@algovoi/substrate for the JCS canonicalisation primitive.
Apache 2.0 licensed.</t>
</li>
</ul>
<t>Conformance vectors:</t>

<artwork><![CDATA[https://github.com/chopmob-cloud/algovoi-jcs-conformance-vectors/tree/main/vectors/cancellation_receipt_v1
]]></artwork>
<t>8 byte-level reference vectors + 7 pair invariants + 3 chain
invariants pinning the closed four-element enumeration,
jurisdiction-array-order, canon_version pin,
effective-time-greater-equal-recording-time invariant, and
audit-chain linkage properties.</t>
</section>

<section anchor="known-adopters-informative"><name>Known Adopters (Informative)</name>
<t>The following downstream parties have published artefacts that
anchor to the cancellation receipt format specified by this
document, or to the canonicalisation discipline shared with this
format. Inclusion in this list is informational and reflects
public adoption only; it does not imply endorsement or normative
authority from the listed party.</t>
<table>
<thead>
<tr>
<th>Adopter</th>
<th>Surface</th>
<th>Anchor</th>
</tr>
</thead>

<tbody>
<tr>
<td>AlgoVoi (<tt>api.algovoi.co.uk</tt>)</td>
<td>Production mandate-lifecycle issuer</td>
<td>All AlgoVoi-emitted cancellation receipts under <tt>canon_version: jcs-rfc8785-v1</tt></td>
</tr>
</tbody>
</table><t>Adopters publishing vector sets or receipt-format extensions that
anchor to this format are encouraged to publish them in
adopter-controlled repositories with <tt>canon_version</tt> recorded
in-band, so each adopter's authorship is unambiguous and their
artefact is independently citable.</t>
<t>This appendix is maintained as a record of observed adoption at the
time of revision; absence from this list is not normative.</t>
</section>

<section anchor="acknowledgments"><name>Acknowledgments</name>
<t>This document, the receipt format it specifies, and the
conformance vectors derived from it are AlgoVoi work under
AlgoVoi authorship. Substrate authorship history is catalogued at
<eref target="https://docs.algovoi.co.uk/substrate-authorship-provenance"> target="https://docs.algovoi.co.uk/substrate-authorship-provenance"</eref>.</t>
<t>The canonicalisation discipline pinned by Section 4 is normatively
specified in draft-hopley-x402-canonicalisation-jcs under the same
authorship.</t>
<t>This document closes the lifecycle gap between the admission-time
compliance receipt (draft-hopley-x402-compliance-receipt),
per-execution settlement attestation
(draft-hopley-x402-settlement-attestation), and post-cancellation
refund receipt (draft-hopley-x402-refund-receipt) formats. The
four formats share the same canonicalisation pin, audit-chain row
shape, and integer-millisecond timestamp encoding, so that a
verifier walking the full mandate lifecycle requires only one
implementation of the canonicalisation discipline.</t>
<t>The author acknowledges Anders Rundgren as the editor of RFC 8785,
the JSON Canonicalization Scheme on which the discipline builds.</t>
</section>
</back>

</rfc>
