Add the LogicSRC OpenSwarm specification family (paid, encrypted p2p media) - #142
Merged
Conversation
BitTorrent distributes bytes better than any CDN and has never been a product: nobody is paid to seed, and nothing in it is private. Every Profullstack media property answers that with a central HTTP proxy and a pass system bolted on, and pays for every byte it serves. OpenSwarm is an add-on to BitTorrent, carried as BEP 10 extension messages, that fixes both. The swarm carries AES-256-CTR ciphertext whose integrity is pinned by two SHA-256 merkle roots in a signed manifest, so a tracker or DHT node learns an infohash and a size. A leecher buys a pass over x402 in USDC (the same exchange x402-gateway runs for crawl passes, settled by CoinPay), a seeder serves inside a bounded credit window, and the leecher signs a cumulative voucher for every verified batch. Whoever seeds gets paid. Vanilla clients remain valid members and browsers remain first-class peers. Adding a file mints a key pair for it, derived from one publisher seed by default so there is one thing to back up: the public half is the file's identity and its BEP 46 key, the private half signs the manifest and authorises grants and payout changes, and a separate content key encrypts the bytes and is sealed to paying peers. The family: a core (records, keys, hashing, transports, discovery, events), ipfile, ippay, ipdb (a signed hash-chained catalogue with heads on the DHT), ipaudio, ipvideo, iplive (paid relays with backpressure) and ipname (Moshpit pins and DNS TXT). Plus the c0mpute.com integration with seven workload types and thirteen use cases, a proposed ip CLI, conformance profiles, a security model and an FAQ. Registered on the site the way OpenCreds is: nav entry, docs registry, sitemap, a /openswarm landing page, PRD 0005, and the MCP prd_next_id expectation moved to 0006. Specs only. No code, no schemas, no reference implementation. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YafYxayh7Gqe5MWNNQMev2
ThreatCrush Security Scan21 finding(s) HIGH/CRITICAL: 3 | MEDIUM: 9 | LOW: 9
Snippets are redacted; ThreatCrush never prints matched credential material. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OpenSwarm: paid, encrypted, peer-to-peer distribution as an add-on to BitTorrent
Draft specification family under
docs/openswarm/, registered on logicsrc.com the way OpenCreds is. Specs only. No code, no schemas, no reference implementation. TheipCLI is a proposal, not a binary.Working name was "IPMedia". The family is called OpenSwarm because the swarm is the one object every member shares, "media" undersells
ipfileandipdb, "IP media" reads as IPTV, and the LogicSRC convention is Open + noun. The protocols keep theirip*names. Easy to rename if you prefer IPMedia.What it is
ipfileis BitTorrent with three additions carried as BEP 10 extension messages, so vanilla clients, trackers, the DHT and WebTorrent in a browser all still work:cipherRootverified by the torrent itself,plainRootverified after decryption) pinned by a signed manifest. A tracker learns an infohash and a size.X-PAYMENTproof, verify and settle: the exact exchangex402-gatewayruns for crawl passes). A seeder serves inside a bounded credit window (4 MiB default); after verifying each batch the leecher signs a cumulative voucher; the seeder redeems the latest one at a hub, which splits it publisher / seeder / hub. Nobody pays for unverified bytes, nobody serves more than one window unpaid, replays pay zero, and over-cap spending is bounded per seeder.fileId), so the seed plus any manifest recovers every file key and content key. The public half is the file's identity and its BEP 46 mutable-item key; the private half signs manifests and authorises grants and payout changes; a separate random content key encrypts the bytes and is sealed (X25519 sealed box) to paying peers.--standalone-keymints an unrelated pair for files that change hands. Rotation and seed loss are specified.Everything else reuses
ipfile:ipaudioandipvideorenditions areipfiles;iplivesegments use the same cipher, grants, credit window and vouchers with relays as payees;ipdbsegments are freeipfiles. Reuse is stated as the default posture in the overview.Documents
docs/openswarm.mddocs/openswarm/spec.mddocs/openswarm/ipfile.mdhelloand payment messages, paid session, vanilla coexistence, pricing, publish and fetch proceduresdocs/openswarm/ippay.mddocs/openswarm/ipdb.mddocs/openswarm/ipaudio.mddocs/openswarm/ipvideo.mddocs/openswarm/iplive.mdipliveextension withwindowbackpressure, roles and relay economics, low-latency parts, recording toipvideodocs/openswarm/ipname.mdopenswarmregistry pin kind, DNS TXT, clearnet-first,ip://URLdocs/openswarm/c0mpute.mdJobOffershapes, thirteen use cases with CLI flows, proposed node changesdocs/openswarm/cli.mdipcommand tree, exit codes, output, environmentdocs/openswarm/conformance.mddocs/openswarm/security.mddocs/openswarm/faq.mdprd/0005-add-logicsrc-openswarm-spec.mdSite registration (mirrors #140):
apps/logicsrc-web/src/app/openswarm/page.tsx, nav entry insite-shell.tsx,openswarminDOC_SLUGS, sitemap route, PRD index row,prd_next_idexpectation moved to0006inpackages/logicsrc-mcp/src/standards.test.ts. I did not runnpm installor a build in the worktree; the page is a structural copy of the OpenCreds page using the sameuihelpers.What maps to existing code vs what is speculative
Exists and is reused unchanged
X-PAYMENTproof, CoinPay/api/x402/verify+/settle, USDC on Base/Polygon/Ethereum (x402-gateway,x402-client, CoinPay SDK)autoblog)base64(SHA-256(SPKI))(moshpit-transport,moshpit-proxy)/api/moshpit/pins,POST .../pins), clearnet-firstdecideResolutionmedia-streamer)JobOffer/JobBid/JobAccept/JobReceipt), role tags, blake3 store, RS 10/14, ffmpeg transcode, gateway, live-stream DIP 0019, storage pricingSpeculative (all new, nothing implemented)
ipfile,ipdb,ipliveextension messages and the paid session rulesopenswarmpin kind in the Moshpit registry (one-line registry change)--openswarmworker flagipCLIChecks
grep -rn "—\|–"over every added file returns nothing; no curly quotes.pricing,policy,keys,hello,credit,voucher,grantmean one thing everywhere).Open questions
ip*either way.ippayhas the hub hold balances and pay out. That is a different position from CoinPay's direct-to-merchant x402 rail. Is CoinPay the hub, or does the hub pay seeders per voucher directly with two-output payments?ipfileexamples use $0.01/GiB served and c0mpute storage is $0.008/GB-month + $0.005/GB egress. Shouldipfile.pinbe priced from the c0mpute rate automatically?kind: "openswarm"tomoshpit_name_pinsis a one-line change on the registry; until thenipnameworks over DNS TXT only.@logicsrc/schemasJSON Schemas and the fixture suite before any implementation, as OpenCreds did in one PR?🤖 Generated with Claude Code
https://claude.ai/code/session_01YafYxayh7Gqe5MWNNQMev2