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:
- PHASE Protocol contract
Default ID CDXZ2…FDRGP (check env if you redeployed).
- PHASERLIQ (Stellar Expert)
Default ID CDOAX…RLFD — testnet SAC (check env if you use another token).
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):
- Stellar — Developer documentation
Main hub: networks, transactions, Horizon, and tooling.
- Soroban — Smart contracts
Smart contracts on Stellar: Rust, WASM, testing workflow.
- Stellar Asset Contract (tokens)
How Stellar represents assets and tokens on Soroban.
- Freighter — Developer guide
Embedding Freighter in web apps.
- Freighter (product site)
Install the extension.
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.
Quick links:
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:
- PHASERLIQ (Stellar Expert)
Repository default ID; verify env if you changed TOKEN_CONTRACT_ID.
- PHASE Protocol contract
Core protocol; verify env if you redeployed.
- Stellar Expert — Testnet
Search accounts, contracts, and transactions.
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).
More links and reading
Hand-picked external documentation, explorer, and standards. All open in a new tab.
- developers.stellar.org
Official Stellar developer documentation.
- Soroban — Smart contracts getting started
First steps writing contracts on Stellar.
- Stellar Expert (testnet)
Block explorer; Chamber TOKEN_EXPERT links usually point here.
- x402 on Stellar (official docs)
Canonical x402 guide for Stellar: compatible wallets, facilitator options, and integration references.
- x402-stellar (npm)
Official package to integrate x402 payment flows on Stellar-enabled apps and APIs.
- Declare your node (Tier 1 / SEP-0020 validator declaration)
Validator declaration context and why `stellar.toml` metadata matters for discoverability.
- SEP-0020 (validator self-verification)
Active SEP for linking validator operator identity and metadata via Stellar accounts and `stellar.toml`.
- SEP-0050 (NFT / collectibles on Soroban)
Draft proposal for NFT/collectible interfaces in Stellar Soroban.
- IPFS
Background on ipfs:// when forge or metadata uses IPFS gateways.
PHASE · Documentation lives inside the app.