# org.passingreads.book.stashBookKey

> Published by [passingreads.org](https://lexicon.garden/identity/did:plc:oeipalbxet5jghoqe6b6ctu6)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:oeipalbxet5jghoqe6b6ctu6/org.passingreads.book.stashBookKey)
- [Documentation](https://lexicon.garden/lexicon/did:plc:oeipalbxet5jghoqe6b6ctu6/org.passingreads.book.stashBookKey/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:oeipalbxet5jghoqe6b6ctu6/org.passingreads.book.stashBookKey/examples)

## Definitions

### `org.passingreads.book.stashBookKey`

**Type**: `procedure`

Stash a book's private key on the appview so the user can interact with the book (drop it, leave a note) from any device without re-scanning the QR. Stashed keys are wiped automatically when a drop event is ingested for that book.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `bookId` | `string` | Yes | The book's short ID (as encoded in its QR code). |
| `privateKey` | `string` | Yes | Multibase-encoded Ed25519 private key for the book. The appview verifies the key derives to the given bookId. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `stashedAt` | `string` (datetime) | Yes |  |

#### Errors

- **BookKeyMismatch**: The supplied privateKey does not derive to the supplied bookId.
- **ProfileNotFound**: The authenticated DID has no PassingReads profile indexed by the appview.

## Raw Schema

```json
{
  "id": "org.passingreads.book.stashBookKey",
  "defs": {
    "main": {
      "type": "procedure",
      "input": {
        "schema": {
          "type": "object",
          "required": [
            "bookId",
            "privateKey"
          ],
          "properties": {
            "bookId": {
              "type": "string",
              "description": "The book's short ID (as encoded in its QR code)."
            },
            "privateKey": {
              "type": "string",
              "description": "Multibase-encoded Ed25519 private key for the book. The appview verifies the key derives to the given bookId."
            }
          }
        },
        "encoding": "application/json"
      },
      "errors": [
        {
          "name": "BookKeyMismatch",
          "description": "The supplied privateKey does not derive to the supplied bookId."
        },
        {
          "name": "ProfileNotFound",
          "description": "The authenticated DID has no PassingReads profile indexed by the appview."
        }
      ],
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "stashedAt"
          ],
          "properties": {
            "stashedAt": {
              "type": "string",
              "format": "datetime"
            }
          }
        },
        "encoding": "application/json"
      },
      "description": "Stash a book's private key on the appview so the user can interact with the book (drop it, leave a note) from any device without re-scanning the QR. Stashed keys are wiped automatically when a drop event is ingested for that book."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
