ChainShare Documentation

Everything you need to paste → share in seconds, plus wallet/token-gate behavior, tips, and API notes.

What is ChainShare?

ChainShare is a lightweight sharing tool for text, Markdown, and code. Paste your content, choose an expiration, click Create Share, and you get a short URL + QR. In production, access can be gated by holding a minimum amount of your project’s token (Solana).

Quick Start

  1. Open the site and (optionally) connect your Solana wallet.
  2. Select a format: Plain Text, Markdown, or Code.
  3. Pick an expiration: 1 day, 1 week, 1 month, or 3 months.
  4. Paste your content and press Ctrl/⌘ + Enter or click Create Share.
  5. Copy the short URL or scan the QR to share anywhere.

Supported Formats

  • Plain Text — best for notes, messages, logs.
  • Markdown — headings, lists, links, code blocks, emphasis, etc. Live preview toggle is available.
  • Code — preserves indentation and spacing for snippets, configs, or console output.

Expiration & Deletion

Every share has a TTL. Options: 1 day, 1 week, 1 month,3 months. When the TTL elapses, the share becomes unavailable.

Note: ChainShare is a sharing utility, not a long-term storage system. Don’t use it for archival or critical data.

Wallet & Token Gate

  • Dev mode: token gate is disabled and everything is free. You’ll see a yellow badge “Token gate disabled (dev mode)”.
  • Production: you can require a minimum balance of your token to view or create shares. The header shows badges for access state.
  • Supported wallets: via the Solana Wallet Adapter UI (Phantom, Solflare, etc.).
  • Tips: a creator can include a Solana Pay link (“Tip the creator”) on the share page.

Editor Tips & Shortcuts

  • Ctrl/⌘ + Enter — create share.
  • Action bar: Wrap toggle, Font size, Import file,Clear, Download, and Auto-detect format.
  • Markdown preview: toggle on/off for side-by-side editing.
  • Autosave: drafts persist in your browser (localStorage).

After creating a share you’ll get a short URL and a QR code PNG for quick handoff during presentations or on another device. Use the copy button next to the link for one-click copying.

API (experimental)

A minimal JSON endpoint powers sharing. The surface area may evolve, but this is the current shape:

POST /api/share
Content-Type: application/json

{
  "content": "string",
  "format": "text" | "markdown" | "code",
  "expiresIn": 86400 | 604800 | 2592000 | 7776000,
  "creatorPubkey": "string | null"
}

→ 200 OK
{ "id": "7nE7yf" } // use /s/:id to view

There’s no public read API by design; viewing happens on /s/[id] which renders safely with formatting.

Dev/Deploy notes

  • Dev: everything runs free (Vercel preview + free-tier storage). Token gate is disabled.
  • Prod: set your token mint and minimum balance via env; enable token checks in the gate. Point NEXT_PUBLIC_SITE_URL at your domain for accurate share URLs and OG images.

FAQ

Q: Do viewers need a wallet?
A: In dev, no. In production, it’s configurable. You can allow public viewing or require wallet + token balance.

Q: Can I delete a share early?
A: Not from the UI today. Use shorter TTLs for sensitive content.

Q: What about abuse?
A: Each share page includes guidance to report inappropriate content; links can be taken down according to policy.