# Scratchpad

Scratchpad is the small app Base installs to prove that installing, signing
in and uninstalling work. It has one page: a line saying who you're signed
in as, and one note that everyone shares.

## Who can use it

Anyone the Base that installed it vouches for can read and change the note.
Scratchpad trusts one Base, the one named in `BASE_APP_ISSUER`, and checks
each sign-in against the keys in `BASE_APP_KEYS`. It has no roles: every
member of that Base sees the same note and can change it. (CARLOS app spec
1.7: Base says who someone is, and each app decides what they may do.)

A sign-in lasts 12 hours, so people stay signed in while Base is briefly
down, and someone removed from Base loses access within a day. **Sign out of
Scratchpad** ends it sooner. That signs you out of Scratchpad only: you stay
signed in to Base, and **Sign in again** brings you straight back.

Two people can edit the note at once. If someone else saved while you were
typing, your save is refused and your text stays on the page, so nothing is
lost. Save again to replace their version.

## Settings

Base writes all four when it installs the app:

- `BASE_APP_ORIGIN`: Scratchpad's own address, such as `https://acme-scratchpad.example.com`
- `BASE_APP_ISSUER`: Base's address
- `BASE_APP_CONSUMER_ID`: `scratchpad`
- `BASE_APP_KEYS`: Base's public keys, for checking sign-ins
