# MPC Config

Discover whether MPC (threshold-signature) wallets are enabled for the tenant and whether the current user already has an MPC wallet provisioned.

## Overview

Aurea's **MPC wallets** are non-custodial 2-of-3 threshold-signature wallets. The three shares are held by the user's **device**, by Aurea's HSM-backed **cosigner**, and by a user-controlled **backup** (recoverable via passkey or recovery code). Aurea alone can never move funds — every signature requires two cooperating shares.

Call this endpoint at app startup to decide whether to offer the MPC onboarding flow. It returns two booleans plus, if a wallet exists, its address and chain so you can skip the DKG step and jump straight to the wallet UI.

> 💡 MPC enrolment is tenant-gated. If `mpcEnabled` is `false`, the DKG, register, and sign endpoints will reject calls with `403`.

### `GET /v1/mpc/config`

Authentication: bearer token required.

Returns the MPC feature flag for the tenant and the current user's MPC wallet, if any.

**Responses**

`200` OK

```json
{
  "mpcEnabled": true,
  "userHasWallet": true,
  "wallet": {
    "walletId": "mpc-wallet-uuid",
    "address": "0xAbCd...",
    "chain": "base",
    "curve": "secp256k1",
    "isTestnet": false
  }
}
```

`200` No Wallet

```json
{
  "mpcEnabled": true,
  "userHasWallet": false,
  "wallet": null
}
```

## Implementation

```javascript
// Decide whether to show MPC onboarding or jump to the wallet
async function loadMpcState(token) {
  const r = await fetch('https://api.aureahub.com/v1/mpc/config', {
    headers: { Authorization: `Bearer ${token}` }
  });
  const cfg = await r.json();

  if (!cfg.mpcEnabled) return { mode: 'unavailable' };
  if (!cfg.userHasWallet) return { mode: 'onboard' };       // run DKG
  return { mode: 'ready', wallet: cfg.wallet };              // existing wallet
}
```

---

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