Guide

Solana Pay QR micropayments

In-browser wallet connect does not work everywhere — especially inside mobile Twitter or Discord in-app browsers. Solana Pay lets users scan a QR or tap a solana: link, pay from their wallet app, and return with an on-chain receipt. Garden Dice is a live micropayment demo.

Try Solana Pay live — open a challenge page, scan the QR from your phone, tap “I've paid — detect & roll”.

Why QR beats “connect wallet” on mobile

Wallet browser extensions work on desktop Chrome. On a phone, users often open your site inside an embedded browser that cannot inject Phantom or Solflare. Solana Pay sidesteps that: the payment happens in the wallet app the user already trusts, then your page verifies the transaction signature on mainnet.

For pay-per-use apps (rolls, tips, unlocks), this flow is often faster than forcing a wallet connect dance that fails half the time on mobile.

What a Solana Pay transfer URL looks like

A transfer request is a URL using the solana: protocol with the recipient pubkey and query parameters:

solana:8sohhHrVBXtmFZGr3nR61MAzWWznNqMKamVrQYkYkAox?amount=0.005&label=Garden+Dice&message=Roll+payment

Wallets render this as a deeplink or QR code. After the user approves, they get a transaction signature you can verify with any public RPC.

Verify payment on-chain (no backend required)

Garden Dice verifies payments client-side:

  1. Fetch the parsed transaction via connection.getParsedTransaction(signature) on mainnet.
  2. Find the treasury account in the transaction’s account keys and compare postBalance − preBalance to the expected lamports.
  3. Reject replays — store used signatures in localStorage so the same payment cannot roll twice.
  4. Deliver the roll only after verification passes — same commit-reveal flow as wallet connect.

This pattern works for static sites: no server, no API keys, just public RPC + transparent treasury address.

Try it on Garden Dice

Open the beat roll of 4 challenge — the Solana Pay tab shows a QR. Scan with Phantom or Solflare on your phone, pay 0.001 SOL, then tap I've paid — detect & roll.

Prefer desktop? Switch to the Wallet tab on the same page. Both paths land on the same provably fair roll — see the commit-reveal guide for fairness details.

Further reading