> ## Documentation Index
> Fetch the complete documentation index at: https://docs.microset.io/llms.txt
> Use this file to discover all available pages before exploring further.

# User Flow

> Step-by-step wallet connection and transaction flows, as the user experiences them.

<Info>
  This page documents exactly what a user sees and signs. Reviewers can use it to
  reproduce the flow and confirm there are no hidden steps.
</Info>

## Wallet connection & sign-in flow

Microset uses [Privy](https://www.privy.io/) configured **Solana-only**
(`walletChainType: 'solana-only'`) with external wallets (Phantom, Solflare,
Backpack, and other Wallet-Standard wallets). Embedded-wallet creation is disabled.

<Steps>
  <Step title="User opens the app">
    The user opens the official app at [https://app.microset.io](https://app.microset.io).
  </Step>

  <Step title="User connects a Solana wallet">
    Privy prompts the user to connect an existing Solana wallet. No funds move at
    this step.
  </Step>

  <Step title="User signs a sign-in message">
    To authenticate with the backend, the wallet is asked to sign a human-readable
    message prefixed `Microsets:wallet-auth:`. This is an off-chain
    `signMessage` request — it authorizes nothing on-chain and moves no funds. The
    backend verifies the signature and issues a session JWT.
  </Step>

  <Step title="(Optional) Quick-prediction session">
    To avoid re-prompting on every prediction, the user can sign once to create an
    on-chain quick-prediction session funded with a spend cap they choose. Predictions are then
    placed from that capped escrow. The user can withdraw unused funds or revoke
    the session at any time.
  </Step>
</Steps>

## Getting test SOL

While Microset runs on Solana **devnet**, you can fund your wallet with free
devnet SOL to make predictions and pay transaction fees.

<Card title="Solana Faucet" icon="droplet" href="https://faucet.solana.com/">
  Request devnet SOL at faucet.solana.com — paste your wallet address and choose
  the devnet network.
</Card>

## Prediction / claim transaction flow

<Steps>
  <Step title="User selects a market and outcome">
    The user chooses a market and an outcome in the UI and enters a stake amount.
  </Step>

  <Step title="App builds a Solana transaction">
    The app constructs the `place_bet` instruction (or `place_bet_with_delegate`
    for a quick-prediction session) using the program IDL. Parameters match the displayed
    action.
  </Step>

  <Step title="Wallet shows the transaction">
    The Solana wallet displays the instruction and accounts for review.
  </Step>

  <Step title="User signs and the app submits">
    After the user signs, the app broadcasts the transaction to the configured RPC.
    Nothing executes without the signature.
  </Step>

  <Step title="Settlement">
    The expected state change occurs on-chain and is visible on a Solana explorer.
    See [Transaction Safety](/security/transaction-safety).
  </Step>
</Steps>

## What the user sees and signs

| Stage      | What the user sees               | What the user signs                      |
| ---------- | -------------------------------- | ---------------------------------------- |
| Connect    | Privy wallet-connect prompt      | Nothing                                  |
| Sign-in    | `Microsets:wallet-auth:` message | One off-chain message (no fund movement) |
| Prediction | Market + outcome + stake         | One on-chain transaction (`place_bet`)   |
| Claim      | Resolved market + payout         | One on-chain transaction (`claim`)       |

## Expected result after signing

After a prediction, the user's SOL moves into the market vault and their stake on the
chosen outcome is recorded. After `claim` on a resolved market, the winner's
proportional share of the pool (minus the protocol fee) is transferred from the
vault to their wallet; a voided market refunds the full stake. No additional or
background transactions are triggered.
