---
# System prepended metadata

title: 'Draft: JSON-RPC Cashu WebSocket Spec'

---

# Draft: JSON-RPC Cashu WebSocket Spec

## Example: check_proof method

### Wallet Request

Request made by wallet to initiate the subscription

```json
{
    "jsonrpc": "2.0",
    "method": "check_proof",
    "params":{
        "ids": ["<quote_id>"]
    },
    "id": 1
}
```

### Mint Response

Mint can accept the request and respond with a result containing the subId for this subscription

```json
{
    "jsonrpc": "2.0",
    "result": {
        "subId": 12345
    },
    "id": 1
}
```

or decline the request and respond with an error

```json
{
    "jsonrpc": "2.0",
    "error": {
        "code": -32601,
        "message": "Unsupported method"
    },
    "id": 1
}
```

### Updates (Mint -> Wallet)

Whenever state relevant to a subscription changes the mint notifies the wallet using a notification that references `subId`

```json
{
    "jsonrpc": "2.0",
    "method": "check_proof",
    "params": {
        "subId": 12345,
        "Y": "<hex_str>",
        "state": "<str_enum[STATE]>",
        "witness": "<str|null>"
    }
}
```
