# Prepare a Backup Proof

For a wallet whose signatures need its user's approval: the message a backup proof will sign and its digest, for the user to approve before the proof starts.

## Overview

- **When.** Before [Start a Backup Proof](https://docs.aureahub.com/docs/mpc-backup-proof-start.md), for a wallet with an approval key bound to it at its key generation ([Start DKG Ceremony](https://docs.aureahub.com/docs/mpc-dkg-start.md) › An Approval Key), where your tenant has the backup proof's approval. Elsewhere the route answers `404` `BACKUP_PROOF_PREPARE_OFF`: start the proof without it.
- **What it answers.** `message` — the exact text the proof will sign (Start a Backup Proof › The Message); `digest` — the 32 bytes the shares will sign, `0x` hex; `intent` — what is signed, `{ "v": 1, "kind": "backup_proof" }`; `expiresAt`; and `prepared`, the token to start the proof with. Nothing is written and no ceremony starts.
- **Then.** Check the message as at Start a Backup Proof — a backup proof of this wallet, its address and curve, not expired, `digest` its hash —, have the user approve `digest` (The Approval), and start the proof with `prepared` and `approval` before `expiresAt`.
- **Who.** The wallet's owner, with an access token whose role runs MPC ceremonies (`owner`, `tenantadmin`, `signer`, `user`).

## The Approval

The user's approval key signs a challenge made of the wallet's id and the digest:

```text
challenge = SHA-256( "aurea-mpc-approval/v1" ‖ 0x00 ‖ len(walletId) ‖ walletId ‖ digest )

walletId  the wallet's id as UTF-8 text; len(walletId) its length in bytes, 2 bytes big-endian
digest    the 32 bytes of digest
```

- A passkey as the approval key: `{ "alg": "webauthn-es256", "credentialId", "authenticatorData", "clientDataJSON", "signature" }`, every value base64url, from an assertion whose challenge is `challenge`.
- A P-256 key: `{ "alg": "p256-raw", "signature" }`, the signature of `challenge`, base64url.
- Aurea passes the approval on; the wallet's cosigner verifies it against the approval key bound to the wallet, and does not join a backup proof without a valid one.

## Endpoint

### `POST /v1/mpc/wallets/{walletId}/backup-proof/prepare`

Authentication: bearer token required.

Answers the message a backup proof of the wallet will sign, its digest and the token to start it with.

**Path parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `walletId` | string (uuid) | yes | The MPC wallet's id |

**Request body**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `wireVersion` | integer | no | The relay version, as at Start a Backup Proof: `2`, or `1` where your tenant may still use it. The body may be `{}`. |

**Responses**

`200` OK

```json
{
  "message": "Aurea Hub MPC backup proof\nSigning this proves that the backup share of this wallet is held. It moves no funds and authorizes no transaction.\n\nVersion: 1\nWallet: 7c1e9b24-3f5a-4d8e-9b6c-1a2f3e4d5c6b\n…",
  "digest": "0x4f1c2a9e8b7d6c5f3e2a1b0c9d8e7f6a5b4c3d2e1f0a9b8c7d6e5f4a3b2c1d0e",
  "intent": { "v": 1, "kind": "backup_proof" },
  "expiresAt": "2026-11-06T09:22:40.000Z",
  "prepared": "EXAMPLE…"
}
```

`404` Not on

```json
{
  "statusCode": 404,
  "error": "NotFoundError",
  "message": "…",
  "details": { "code": "BACKUP_PROOF_PREPARE_OFF" }
}
```

**Example request**

```bash
curl -X POST https://api.aureahub.com/v1/mpc/wallets/7c1e9b24-3f5a-4d8e-9b6c-1a2f3e4d5c6b/backup-proof/prepare \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "wireVersion": 2 }'
```

## Refusals

- `404` `BACKUP_PROOF_PREPARE_OFF`: the backup proof's approval is not on for your tenant — start the proof without it. `404` `MPC_WALLET_NOT_FOUND`: no such MPC wallet; `403` `MPC_WALLET_NOT_OWNED`: another user's.
- `409` `BACKUP_PROOF_TENANT_COSIGNER`: the wallet was made with your tenant's own co-signer (as at Start a Backup Proof); `409` `{ "error": "this tenant must use the version 2 MPC relay (send wireVersion: 2)" }`.
- `429` with `Retry-After`: too many backup proofs prepared — wait, then prepare again.

---

Web version: https://docs.aureahub.com/#mpc-backup-proof-prepare
