> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lumenwipe.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Registry expiry

> Re-verify and restamp the exchange or contract registry before its validUntil date, or recover exchange closes and conversions after it.

Two registries carry a `lastVerified` and a `validUntil` date, and both fail closed once `validUntil` has passed (the date counts until 23:59:59 UTC):

| Registry | Past `validUntil` |
| - | - |
| `apps/api/src/config/exchange-registry.json` | A close into a listed exchange is refused with `503 registry_expired`, because a wrong memo rule credits nobody. Closes into any other destination are unaffected. The API logs a warning at boot from 30 days before. |
| `apps/api/src/config/contract-registry.json` | Soroban token conversion through Soroswap finds no allowed contract, and DeFi detection's direct-read fallback no longer reports a clean sweep as confirmed. The hash comparison monitor keeps running. |

Expiry is a date on a file, so it is the one incident that can always be prevented. The fix is a reviewed pull request, never a configuration change: there is no switch that skips the check.

## Blast radius

* **Exchange registry**: every exchange close, on both networks, until the restamped registry deploys. No funds are at risk; users can close into a wallet they control meanwhile.
* **Contract registry**: token conversion and the confirmed state of DeFi detection. Exits that the registry already verified keep their hash check.

## Steps

1. **Check the days left**:

   ```bash theme={null}
   curl -s "$API/health/deep" | jq '.details.exchange_registry'
   jq -r '.validUntil' apps/api/src/config/exchange-registry.json apps/api/src/config/contract-registry.json
   ```

   Expected: `daysRemaining` positive, and both dates in the future. Start step 2 at 30 days left, when the boot warning appears.

2. **Re-verify every entry against its source**, never against another registry:
   * Exchange registry: each deposit address, memo requirement and memo type against the exchange's own deposit documentation, by [CONTRIBUTING, Contributing to registries](https://github.com/LumenWipe/lumenwipe/blob/main/CONTRIBUTING.md#9-contributing-to-registries).
   * Contract registry: each entry's code hash re-read from the ledger, by `apps/api/src/lib/contract-registry/README.md` ("Refreshing it"):

     ```bash theme={null}
     stellar contract fetch --id <contract address> --network <net> | sha256sum
     ```

     Expected: the entry's `wasmHash`. A different hash is an upgrade: follow `S7.Tampering.1.M.1` in the [monitoring plan](https://docs.lumenwipe.com/monitoring-plan.md#5-what-happens-when-an-alert-fires) for that entry before restamping anything.

3. **Restamp**: set `lastVerified` to today and `validUntil` to 90 days later, as the current files do, and change any entry that moved. Run the registry tests:

   ```bash theme={null}
   cd apps/api && bun test tests/unit/contract-registry.test.ts && bun run test
   ```

   Expected: all pass.

4. **Sign the exchange registry** (skip it when only the contract registry changed). The exchange registry carries a maintainer signature, and CI fails when the registry changed without a fresh one. A maintainer holding a registry signing key pipes the secret seed into the first command below on standard input and commits the data files; nothing is passed as an argument and nothing is written anywhere else:

   ```bash theme={null}
   bun packages/verify/scripts/sign-registry.ts   # secret seed on standard input
   bun run --filter '@lumenwipe/verify' vectors
   bun packages/verify/scripts/sign-registry.ts --check
   ```

   Expected: `Signed sequence N`, the vectors rewritten, and `The exchange registry signature is current.` An unsigned or stale signature does not block closes: clients treat the registry as unsigned, so it can still tighten rules, but a newly listed exchange that needs the relay account stays refused until the signed copy is current.

5. **Open the pull request** with what you checked for every entry, and merge it after review. The merge deploys the API.

## Confirm the fix

```bash theme={null}
curl -s "$API/health/deep" | jq '.details.exchange_registry.daysRemaining'
curl -s "$API/v1/config/exchange-registry" | jq -r '.validUntil'
```

Expected: the new number of days, and the new `validUntil`. A close into a listed exchange then plans without `registry_expired`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.