PHASE Documentation

PHASE (P H A S E P R O T O C O L) is a cyber-brutalist web app for on-chain collections, market, forge, and fusion chamber on Soroban testnet with PHASERLIQ and x402-style settlement. Covers brand assets, default contracts, and detailed flows.

What this project is

PHASE ties together a marketing landing, a market for community collections, a forge where creators set name, PHASERLIQ price, and artwork, and a fusion chamber where users connect Freighter, pay the collection price, and the Soroban contract updates phase state and can mint a SEP-20-style utility NFT tied to that phase.

The payment UX follows a settlement-style flow: you hold PHASERLIQ on-chain, then sign the transaction the protocol builds. Everything runs on testnet—this is not financial advice or an investment product.

Current x402 status in this repository: `app/api/x402` is a compatibility/demo endpoint (402 challenge + local verifier). For production use, connect a real x402 facilitator as documented in the official guide.

Main routes in this app:

  • Home (landing)

    Hero, protocol signals, modules, and wallet connect entry points.

  • Market

    Collection catalog, PHASERLIQ prices, and links into the chamber per collection.

  • Forge

    Create a collection: name, price, image (URL, file, or canvas) and deploy via wallet.

  • Fusion chamber

    Wallet monitor, mint price, settlement, and artifact / phase visualization.

  • Documentation

    This page.

Brand assets and static files

Files live under the public/ folder in the repo and are served from the site root. In production, social previews resolve absolute URLs via metadataBase and NEXT_PUBLIC_SITE_URL in app/layout.tsx (Open Graph and Twitter).

Public paths (replace origin with your deployed domain, e.g. https://your-domain.com):

  • /og-phase.png

    Open Graph / Twitter Card image. Suggested alt: PHASE hooded figure / liquid energy on Stellar.

  • /icon-sphere.png

    Favicon and Apple touch icon — stippled reactor / artifact sphere.

  • /phaser-liq-token.png

    PHASERLIQ token icon in the UI and in `stellar.toml` (CURRENCIES) for explorers.

  • /.well-known/stellar.toml

    SEP-0001 project metadata; a dynamic route may also serve stellar.toml when configured.

On-chain contracts (testnet)

Network: Soroban testnet. Passphrase: Test SDF Network ; September 2015. Soroban RPC: https://soroban-testnet.stellar.org. Horizon: https://horizon-testnet.stellar.org. Default IDs are defined in lib/phase-protocol.ts; override with NEXT_PUBLIC_PHASE_PROTOCOL_ID, NEXT_PUBLIC_TOKEN_CONTRACT_ID (and server-side equivalents without the prefix).

  • PHASE Protocol (core): collections, initiate_phase, SEP-20-aligned utility NFT metadata, on-chain x402 settlement per deployment.
  • PHASERLIQ (Soroban token): testnet liquidity token, 7 decimals, typically named “Phase Liquidity Token”, symbol PHASERLIQ; used for mint pricing and phase transfers.

Stellar Expert (testnet) — default repository reference IDs:

How it works (detailed)

Forge (/forge): creator connects Freighter, sets collection name, PHASERLIQ price, and artwork (https or ipfs URL, sealed file upload when the server allows, or studio canvas). The app builds and signs create_collection; you receive a collection_id to share.

Market (/dashboard): surfaces collection metadata and prices from the contract / app APIs; each card links to /chamber?collection=ID. Collection 0 is the protocol default pool.

Chamber (/chamber): wallet monitor, PHASERLIQ balance, collection x402 mint price, and phase state (has_phased, utility NFT). Users may request genesis supply when contract policy allows, run settlement (x402 flow + Soroban transaction), and view the artifact with ownership checks when the UI resolves on-chain state.

x402 API (demo / compatibility): routes under app/api/x402 — 402 challenge, supported, verify, settle. Intended for local testing and alignment with Agentic Payments docs; production should use a real x402 facilitator.

Testnet rewards: GET/POST /api/faucet — genesis, daily recharge, and quests; requires ADMIN_SECRET_KEY on the server to sign mints. Operator notes: docs/PHASER_LIQ_REWARDS_TERMINAL_DOC.md.

Classic asset (optional): CLASSIC_LIQ_* and NEXT_PUBLIC_CLASSIC_* let Freighter show a classic trustline asset alongside the Soroban PHASERLIQ contract.

Concepts and moving parts

  • Collection: on-chain record with name, creator/treasury, PHASERLIQ mint price, and image URI for metadata.
  • Protocol pool (collection 0): baseline mint path; other collections are created from the Forge.
  • PHASERLIQ: testnet liquidity token used for quoted prices and contract payments.
  • Artifact / utility NFT: after settlement, the contract can reflect solid state and metadata (https or ipfs://).
  • Project x402 API: `/api/x402` (challenge), `/api/x402/supported`, `/api/x402/verify`, `/api/x402/settle` for local compatibility/testing.

Technical stack

  • Frontend: Next.js (App Router), React, Tailwind; tactical UI on Forge/Chamber/Market.
  • Contract: PHASE Protocol on Soroban testnet; contract IDs and passphrase come from environment variables.
  • Wallet: Freighter browser extension for signing; the app uses the official Freighter API.
  • Optional server-side image upload: when enabled, Paint/Upload in Forge can publish the sealed file.

Stellar ecosystem references (open in a new tab):

Step-by-step flows

Creator: install Freighter → open Forge → connect wallet → define collection and art → deploy. You get a collection ID; share /chamber?collection=ID so others mint there.

Participant: open Market or follow a link → Chamber with the right collection → connect on the same network (testnet) → check PHASERLIQ balance; use faucet/rewards in the UI if shown → run settlement when balance covers the price.

PHASERLIQ and explorers

Amounts are shown in PHASERLIQ; the client converts to stroops and calls the token contract. Symbol PHASERLIQ, 7 decimals, typical on-chain name “Phase Liquidity Token”. In the Chamber, TOKEN_EXPERT links to the PHASERLIQ asset on Stellar Expert.

Default testnet contracts and explorer:

Previews and trust

Market thumbnails and copy are informational. The source of truth is contract state and what you see in the Chamber with your connected address (balance, phase, ownership checks when the UI shows them).

PHASE · Documentation lives inside the app.