07 — PIPs · PIP-0022
Idempotent writes
Every write that changes a state accepts Path-Idempotency-Key. The key is scoped to the member that signs the request. The same key and the same request return the original answer, byte for byte; the same key with another request is a conflict.
- Number
- PIP-0022
- Status
- implemented
- Type
- Core
- Author
- PATH
- Date
- 2026-11-20
- Source
- On the register
Why
A member retries a write when it does not know whether the first call landed: a timeout, a connection reset, a process restart. A request, a receipt, a consume or a revocation sent twice can produce two signed statements, and a signed statement is not withdrawn. Every operator retries across a network boundary, so the rule is part of the protocol rather than of one operator.
The key
POST /api/path/v1/receipts HTTP/1.1
Path-Version: 2026-10-04.genesis
Path-Idempotency-Key: settle-7f3a91c2
Path-Key-Id: member_2026_01
Path-Timestamp: 2026-11-20T10:00:00.000Z
Path-Signature: 3fa8c1…
Content-Type: application/jsonPath-Idempotency-Keyis 1 to 255 characters of printable ASCII (0x21to0x7E). Any other value is refused400 path.core.malformed_request.- The key is chosen by the caller. A random value or the caller's own operation identifier both work.
- The scope is
(member, key), where the member is the one the request signature authenticates. Two members using the same key never see each other's answers. - A key sent without a member credential is refused
400 path.core.malformed_request.
The fingerprint
The operator records a fingerprint with the key:
SHA-256( METHOD "\n" ROUTE_PATH "\n" PATH_VERSION "\n" canonical(body) )| Part | Value |
|---|---|
| `METHOD` | The HTTP method, upper case |
| `ROUTE_PATH` | The request path as sent, without the query and without the operator's mount prefix |
| `PATH_VERSION` | The dated API version that serves the request, resolved from `Path-Version` |
| `canonical(body)` | The canonical JSON of the parsed body (RFC 8785, as for signatures) |
Two bodies that differ only in key order or whitespace are the same request. The same key on another route, under another API version or with another body is another request.
Answers
| The key | The request | Answer |
|---|---|---|
| Not recorded | — | The write runs. Its answer is recorded |
| Recorded, first request answered | Same fingerprint | The recorded status and body, byte for byte, with `Path-Idempotent-Replay: true` |
| Recorded | Other fingerprint | `409 path.core.idempotency_conflict` |
| Recorded, first request running | Same fingerprint | `409 path.core.idempotency_in_progress`, with `Retry-After` in seconds |
- A replayed body is the recorded body. A signed object in it is not signed again: its
signed_atandsignatureare those of the first answer. - An answer with a status below 500 is recorded, an error included. To retry after correcting the cause of a
4xx, send a new key. - A
5xxanswer is not recorded. The key may be sent again. - The operator keeps a record at least 24 hours after the first answer. After that, the key may be accepted as new.
- Only
Path-Idempotent-Replaytells a replay from a first answer. A first answer does not carry it.
Writes covered
| Area | Writes |
|---|---|
| Request | `POST /requests`, `POST /requests/{reference}/revoke`, `POST /requests/{reference}/paid` |
| Checkout | `POST /checkout/sessions`, `POST /checkout/sessions/{reference}/attempt`, `POST /checkout/sessions/{reference}/revoke`, `POST /checkout/sessions/{reference}/complete` |
| Instructions | `POST /instructions`, `POST /instructions/{reference}/revoke` |
| Settlement | `POST /receipts`, `POST /receipts/{reference}/transitions` |
| Connect | `POST /connect/connections`, `POST /connect/connections/{reference}/consume`, `POST /connect/connections/{reference}/revoke`, `POST /connect/connections/{reference}/delegations`, `POST /connect/delegations/{reference}/consume`, `POST /connect/delegations/{reference}/revoke` |
| Risk | `POST /risk/signals`, `POST /risk/signals/{reference}/withdraw`, `POST /risk/signals/{reference}/contest`, `POST /risk/signals/{reference}/decide` |
The amendment of 2026-11-20 adds the identity and address writes. The paths are those of the reference implementation; an operator publishes its own in its discovery document. An operator MAY accept the key on other writes, under the same rules.
POST /instructions for a request is called without a credential. A caller that sends the key on it signs the request.
Interface
| Header | Direction | |
|---|---|---|
| `Path-Idempotency-Key` | Sent | 1 to 255 printable ASCII characters, on a write above |
| `Path-Idempotent-Replay` | Returned | `true` on a replayed answer, absent otherwise |
| `Retry-After` | Returned | With `path.core.idempotency_in_progress` |
| Code | Status | Meaning | What the caller does |
|---|---|---|---|
| `path.core.idempotency_conflict` | 409 | The key was used with another request | Send a new key for the new request |
| `path.core.idempotency_in_progress` | 409 | The first request with this key has not answered | Wait `Retry-After` seconds, then send the same request again |
Conformance
Profile PATH-CORE.Idempotency: the operator honours this PIP on every write of the table above that it serves.
Compatibility
- A request creation that reuses a key with another body answers
409 path.core.idempotency_conflict. - A key sent without a member credential answers
400 path.core.malformed_request. - A replayed answer carries
Path-Idempotent-Replay: true.
No signed object changes. A caller that sends no key sees no change.
The amendment of 2026-11-20 extends the writes covered. Its compatibility is stated with it.
Amendment — 2026-11-20
The writes of PATH ID and PATH ADDRESS take Path-Idempotency-Key, under the rules above. The table of writes covered gains two areas:
| Area | Writes |
|---|---|
| PATH ID | `POST /subjects`, `PUT /subjects/{id}/payee-record`, `POST /identifiers`, `POST /identifiers/{id}/release`, `POST /identifiers/{id}/transfer`, `POST /subjects/{id}/withdraw`, `POST /attestations`, `POST /attestations/{reference}/revoke`, `POST /ownership-bindings`, `POST /ownership-bindings/{reference}/revoke` |
| PATH ADDRESS | `POST /addresses`, `POST /addresses/{id}/rotate`, `POST /addresses/{id}/revoke`, `PUT /addresses/{id}/standing-intent`, `PUT /addresses/{id}/display`, `POST /addresses/{id}/targets`, `POST /addresses/{id}/targets/{targetId}/revoke` |
PATH-CORE.Idempotencycovers these writes.- These writes act on the subjects and addresses an operator holds for its own member. The key is scoped to the member that signs the request, as on every other write.
- An alias claimed through
POST /identifiers(PIP-0017) follows the same rules: a replay returns the first answer, a409 path.id.alias_unavailableincluded.
Compatibility: a write of these routes that reuses a key with another body answers 409 path.core.idempotency_conflict. A caller that sends no key sees no change. An operator that declares PATH-CORE.Idempotency honours the key on these writes. No signed object changes.
Implementation
The reference implementation records keys under (member, key) with the fingerprint, then the status and the bytes of the answer, for 24 hours. It declares PATH-CORE.Idempotency in its discovery document, and honours the key on every write of both tables.