SupTV is a local-first, single-file web app (index.html) for discovering, playing, and now posting p2fk/IPFS video content.
- p2fk.io: https://p2fk.io
- SupTV repository: https://github.com/embiimob/SupTV
- Live demo: https://supTV.io
SupTV is software you run yourself, not a hosted streaming company.
SupTV currently has two main roles:
- Viewer mode
Searches p2fk data, builds queues, and streams playable media through IPFS gateways. - Poster mode (Compose)
Lets you create signed p2fk-compatible posts from the browser using a built-in testnet3 legacy wallet flow.
- Clone this repo.
- Open
index.htmlin a browser from your cloned repository directory. - Optional: use
?q=keywordto preload a query, e.g.index.html?q=mp4(or?q=@profileUrnfor profile-thread search). - Open ✎ Compose in the top bar to post.
At runtime SupTV:
- Loads trending search stats from
GetTrendingRootSearches. - Picks up to 20 unique keywords.
- Fetches keyword-channel messages + search results per keyword.
- Merges/dedupes by txid and builds a round-robin queue.
- Starts playback as soon as enough early results arrive (fast-start behavior).
- Falls back to default keyword (
mp4) if trending data is empty/unavailable.
SupTV displays p2fk trending output; it does not compute its own trend score model.
The new Compose flow is designed for p2fk-compatible posting with browser-side signing:
- Import/unlock wallet
- Uses built-in wallet mode only (
🔑 Built-in (testnet3 legacy)). - Accepts testnet3 legacy WIF private keys.
- Derives a legacy testnet3 sender address.
- Uses built-in wallet mode only (
- Create post content
- Enter message text (hashtags supported).
- Add an IPFS video attachment as an IPFS URN, gateway link, or CID-bearing URL.
- SupTV validates attachment reachability and canonicalizes to
IPFS:<cid>/<filename.ext>.
- Build sendmany payload
- Converts post body into DiscoBall/p2fk sendmany-compatible recipient outputs.
- Signs the required payload hash in-browser.
- Build and broadcast BTC tx (testnet3)
- Pulls confirmed UTXOs.
- Estimates fee rate.
- Builds/signs legacy P2PKH tx.
- Broadcasts raw hex.
SupTV’s built-in wallet behavior is intentionally constrained:
- Network: testnet3 only (
USE_P2FK_MAINNET = falseby default) - Address type: legacy P2PKH
- Key type: WIF private key import/unlock
- Change model: two deterministic change addresses are derived from the same root WIF
- Routing rule: when a derived change address is the source of selected UTXOs, change is sent to the opposite derived address
- Consolidation support: change UTXOs can be consolidated back to main address from Compose controls
This keeps the posting flow recoverable from a single root WIF while separating change paths.
| Endpoint | Purpose in SupTV |
|---|---|
GET /GetProfileByURN/<urn>?mainnet=false |
Resolves @profile searches to profile metadata and creator addresses. |
GET /GetTrendingRootSearches?qty=<n> |
Fetches trending search terms + stats used for trending UI and queue seed keywords. |
GET /GetPublicAddressByKeyword/<keyword>?mainnet=false |
Resolves keyword-channel address for that keyword. |
GET /GetPublicMessagesByAddress/<address>?skip=<n>&qty=<n>&mainnet=false |
Pulls public channel messages for keyword/address timelines. |
GET /GetKnownRootsBySearchString?searchString=<term>&skip=<n>&qty=<n>&mainnet=false&showSystemFiles=false |
Main searchable roots/messages query used by manual search and trending keyword expansion. |
MEMPOOL_TESTNET_API default: https://mempool.space/testnet/api
| Endpoint | Purpose in SupTV |
|---|---|
GET /address/<addr> |
Reads confirmed/unconfirmed balance stats for composer wallet panels. |
GET /address/<addr>/utxo |
Fetches spendable UTXOs for main + derived change addresses. |
GET /v1/fees/recommended |
Gets fee estimates (falls back to default fee rate if unavailable). |
POST /tx (body=raw tx hex) |
Broadcasts signed legacy transaction for post send or consolidation. |
| Behavior | Purpose in SupTV |
|---|---|
HEAD request to candidate gateway URL |
Validates that an attachment URL/URN resolves and is reachable before adding to post. |
In index.html, adjust:
P2FK_BASE_URL(default:https://p2fk.io)USE_P2FK_MAINNET(default:false, intended for testnet3 flow)MEMPOOL_TESTNET_API(default:https://mempool.space/testnet/api)TRENDING_STATS_LIMIT(default:100)TRENDING_SEARCH_QTY(default:200)STANDARD_SEARCH_QTY(default:200)IPFS_GATEWAY_URLS(gateway list used for media resolution/verification)
- Treat the built-in wallet as a convenience feature for testnet3 posting workflow, not a production custody solution.
- Use your own trusted API/gateway endpoints if you need stronger privacy/censorship resistance.
- Public gateways and public APIs can see request metadata; self-hosting reduces third-party visibility.