# Start Signing Ceremony

Open a threshold-signing session against an MPC wallet — for either the normal DEVICE+AUREA flow or BACKUP-based recovery.

## Overview

Signing an MPC transaction is a two-step process. First, the caller posts the message hash and committee to this endpoint, which creates a relay session and triggers the AUREA cosigner. Second, the device party joins the session and runs the ceremony loop. The final signature is recovered from the relay via `GET /relay/session/{id}/results`.

## Committees

The MPC scheme is 2-of-3. Pick the committee based on which shares are available:

- `["DEVICE","AUREA"]` — the normal path. The user has their device share; Aurea contributes its cosigner share.
- `["BACKUP","AUREA"]` — recovery path. The user has lost their device but unlocked their backup share (passkey / recovery code).

The `["DEVICE","BACKUP"]` committee is reserved for the self-custody / exit path and does **not** touch the Aurea cosigner — it runs entirely off-Aurea (see Cornerstone exit).

### `POST /v1/mpc/wallets/{walletId}/sign/start`

Authentication: bearer token required.

Creates a sign session, triggers the relevant AUREA cosigner, returns the sessionId.

**Path parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `walletId` | string | yes | MPC wallet id (from Register MPC Wallet) |

**Request body**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `committee` | string[] | yes | Array of share monikers — e.g. ['DEVICE','AUREA'] or ['BACKUP','AUREA'] |
| `msgHashHex` | string | yes | Keccak-256 hash (or curve-appropriate hash) of the message to sign, hex-encoded without 0x prefix |

**Responses**

`200` OK

```json
{
  "sessionId": "ses_01J…",
  "committee": ["DEVICE", "AUREA"]
}
```

`403` Forbidden

```json
{ "error": "wallet not owned by user" }
```

## Implementation

```javascript
// Sign an EVM transaction hash with DEVICE + AUREA
const txHash = '…'; // hex, no 0x prefix (e.g. keccak256 of the RLP-encoded tx)

const { sessionId } = await fetch(
  `https://api.aureahub.com/v1/mpc/wallets/${walletId}/sign/start`,
  {
    method: 'POST',
    headers: { Authorization: `Bearer ${hubJwt}`, 'Content-Type': 'application/json' },
    body: JSON.stringify({ committee: ['DEVICE', 'AUREA'], msgHashHex: txHash })
  }
).then(r => r.json());

// Then: join the session as DEVICE, run the sign loop with the engine, recover
// the signature via GET /v1/mpc/relay/session/{sessionId}/results
```

---

Web version: https://docs.aureahub.com/#mpc-sign-start
