# PIP-0027 · Rotated addresses

An address replaced by rotation answers as revoked and says it was rotated. The answer never names the address that replaced it.

## Why

A payer that holds a saved PATH address learns that it does not receive. The payer needs one more fact: whether the payee replaced the address or closed it. A replaced address means the payee has a current one to give. A closed address may have none. [PATH ADDRESS](/docs/address) keeps a revoked address and the link to the address issued by rotation from it. This PIP fixes how that answer reads on the wire.

No signed object changes.

## The answer

An address that does not receive answers `410 path.address.revoked`, in the error envelope of [Errors](/docs/errors). `detail.rotated` says whether it was replaced:

```json
{
  "error": {
    "code": "path.address.revoked",
    "message": "This address has been revoked",
    "detail": { "rotated": true },
    "request_id": "req_8f21c4"
  }
}
```

| `detail.rotated` | When |
|---|---|
| `true` | A newer address of the same subject was issued by rotation from this address |
| `false` | The address was revoked, and no address was issued by rotation from it |

- `detail` holds `rotated` and no other member.
- The answer never carries the address that replaced it, nor a member, a subject or a time.
- The payer asks the payee for its current address.
- An address the operator did not issue answers `404 path.core.not_found`, without `detail.rotated`.

## Where it applies

Every call that reads or writes an address the operator issued:

| Call | |
|---|---|
| `GET /resolver/{key}` | RESOLVER |
| `GET /commitments/{key}` | Published commitment |
| `POST /payee-check` | Payee check ([PIP-0013](/pips/0013)) |
| `POST /instructions` for an address | Payment instructions ([PIP-0009](/pips/0009)) |
| `POST /requests` with `address_id` | A request bound to the standing intent of an address |
| `GET /path/{reference}` | The `path.address` object of an address |
| `POST /addresses/{id}/rotate` | Rotation of an address that is revoked |
| `PUT /addresses/{id}/standing-intent` | Standing intent |
| `PUT /addresses/{id}/display` | Display rules ([PIP-0016](/pips/0016)) |
| `POST /addresses/{id}/targets` | Receive targets |

The paths are those of the reference implementation; an operator publishes its own in its [discovery document](/docs/discovery).

## Interface

| Code | Status | `detail` | What the caller does |
|---|---|---|---|
| `path.address.revoked` | 410 | `{ "rotated": true }` | Ask the payee for its current address |
| `path.address.revoked` | 410 | `{ "rotated": false }` | Ask the payee whether it has another address |

No new code. The SDK reads the answer with `isRotatedAddress(error)`: `true` for a `PathApiError` with code `path.address.revoked` and `detail.rotated` equal to `true`.

## Conformance

Part of `PATH-ADDR.Format`. An operator that declares the profile carries `detail.rotated` on every `410 path.address.revoked`.

## Compatibility

Additive. `path.address.revoked` keeps its status and its meaning, and gains `detail`. A caller that reads only `code` sees no change. An operator that declares `PATH-ADDR.Format` adds `detail.rotated`.

## Implementation

The reference implementation keeps the link of each rotated address to the address that replaced it, and answers `detail.rotated: true` when such an address exists. `POST /addresses/{id}/rotate` answers the `id` of the new address ([Addresses](/api-reference/address/addresses)).