Storehouse: keeping videos online, paid by the people who care.
Anyone can keep a copy of a video and serve it. Anyone who cares about it can pay them to. The payer decides who gets paid, a public program on gno.land keeps the books, and every byte is checked, so nobody has to trust anybody. sugar.video is the first site built on it.
A whitepaper in plain words. The technical plan is HOSTING.md in sugar.video's code.
The problem
Videos disappear. Sites delete them, accounts get closed, links stop working. sugar.video itself deletes its oldest videos whenever its disk fills up, because keeping them costs money and nobody pays for it.
The usual answer is one big company that keeps everything and decides what stays. That company can change its mind, and so can whoever leans on it. Storehouse is a different answer: many small keepers, paid directly by the people who care about each video.
Who is who
- Hosts keep copies of files and send them to whoever asks. A host can be a rented server, or a computer at home with an address on the internet. Anyone can become one, and each host chooses what it keeps.
- Payers are anyone who cares about some files: the person who made a video, a fan, a club, or sugar.video itself. A payer says how much to pay, for how long, and to whom.
- Measurers check that hosts really serve what they say they keep, by asking for pieces the way a viewer does. Anyone can be one. Their reports count only for payers who choose them, and a payer can pay them a share.
- Viewers watch for free. They pay only if they want something faster than free.
A name you can check
Every file gets a name made from its own contents. The file is cut into small blocks, each block gets a fingerprint (a short number that changes completely if a single byte changes), and the fingerprints are combined in pairs, again and again, until one fingerprint is left. That last one is the file's name.
So you can take pieces of a video from anyone, even strangers, and check each piece against the name before you use it. A host that sends a wrong piece is caught on that piece and simply skipped. This is the same way BitTorrent names files (version 2), so the same file has the same name there too.
A video on sugar.video is a small bundle with a name of its own: the video, each voice, the captions and the picture shown before it plays.
How paying works
A payer makes a pledge: "keep this bundle, and pay this much a week to keep it." The pledge also says who gets paid:
- On these servers. Name the hosts, and they share the money by how much of each week they were keeping it, so a host that joins on Thursday gets part of that week's share. This is the simplest way, and it rests on trust, because you know who runs those servers: "I care about these files; keep them on my servers, paid from this wallet."
- Whoever does the work. Name one, three or five measurers. Each week they report which hosts served the bundle, and the money goes to the hosts most of them vouch for: evenly, or by how fast each one served it, or by how long each has kept it, or, for a pledge that covers many videos, by how much each video is needed, using a number some other program on gno.land publishes (how often a video is watched, say), so a host that keeps the videos people want earns more. A host has to be vouched for by most of the measurers, so one lying measurer can't pay or starve a host by itself. The payer can give the measurers a share of each week's money, paid to the ones who reported, and says how many hosts at most are paid each week.
Each pledge has two addresses, like two piggy banks. Money anyone puts in the first is given: it can only ever go to hosts and measurers, so a fan topping up a pledge knows it reaches the people keeping the video. Money in the second is the payer's own deposit: the payer can take back whatever isn't needed for the weeks still owed. Anyone can put money in from anywhere: a wallet, an exchange, another program, a friend.
Once a week, anyone can settle a pledge: the program takes that week's money out of it and credits it to the hosts (and the measurers' share to them), who collect it whenever they like. A week no host qualified for isn't refunded to the payer: its money stays owed to hosts and is paid out in the weeks after.
A payer can promise to keep paying until a certain week, but only with money already in the pledge, and that money then stays there until those weeks are paid. Hosts can see all of this before they agree to keep anything.
The program takes no cut, there is no new coin and no company in the middle; each transaction pays only gno.land's own small charge for the work it does, a fraction of a cent. The program never decides who deserves money. It only follows the payer's pledge and keeps the books in public, in GNOT.
Watching: free and steady, or paid and fast
Free. Every host gives every viewer a quick start, then a steady stream, up to a couple of gigabytes a day. The player takes different pieces from several hosts at the same time, so the streams add up, the way a torrent pulls from many people at once. The more hosts keep a video, the better it plays.
Fast. If you want a big download right now, you ask hosts what they charge for that many gigabytes, pick the cheapest, and pay it once with a small payment on gno.land (x402, a standard way for a web server to ask for payment). You get a ticket that lets you download that much at full speed. That part is still being tested on gno.land's test networks.
What stops cheating
- A host sends the wrong video. It's caught on the first piece and passed over. Nobody has to trust a host.
- A host won't serve viewers. Measurers check by asking for pieces exactly the way viewers do, so a host that refuses viewers fails its checks.
- A host pretends to keep a copy but fetches it from another host when it's checked. A measurer can't see that. Checks count one copy per network, but renting many cheap servers gets around it, so a pledge decided by measurers buys a video that keeps playing, not proof of so many separate copies. A payer who wants separate copies names hosts run by different people. And sugar.video stops serving a kept video a week before it deletes it, so its hosts can't lean on sugar.video's own copy.
- A measurer lies. It only affects payers who chose it. With three or five, a host needs most of them, so one liar can't pay or starve a host by itself; it can nudge how much a host gets, most of all when hosts are paid by how fast they served. Every report is public, and hosts keep only pledges whose measurers they trust.
- A measurer goes quiet. Its weeks aren't refunded: the money stays owed to hosts, so naming a measurer that never reports gets nobody free hosting.
- A payer runs off with the money. A payer can take back only their own deposit, and only what isn't owed for weeks still to pay or promised. Given money is never theirs to take back.
- Junk. Everything written on gno.land costs its writer a small deposit, though only cents, and hosts and measurers give every request a deadline and check the cheap things first, so junk can't stall them.
- Bad videos. Hosts choose what they keep and sites choose what they show. The program on gno.land holds fingerprints and money, never the videos themselves.
sugar.video, built on it
A sugar.video link is private: only people with the link can watch. So nothing goes on the network unless someone presses Keep this video online on its page, which says plainly that keeping it makes it public.
Then sugar.video describes the video's files, serves them as a host, and lists the bundle where other hosts can find it. Hosts that follow sugar.video keep their own copies. When sugar.video needs the room and deletes its own copy (a week after its other files), the page doesn't say "deleted" any more: it plays the video from the hosts that keep it, checking every piece in your browser.
Anyone can help keep sugar.video's kept videos online with one command: storehouse host -follow https://sugar.video/net/keep. Anyone can fetch one, checked piece by piece: storehouse get c:<its name> -hosts https://sugar.video/net.
Why gno.land
The rules are a public program anyone can read, that no one can quietly change for one payer, and the money and promises are kept by the chain, not by a company's say-so. Payments are in GNOT, and a payer can let a small program top up a pledge from their wallet with a key that can only spend a capped amount, so the main key stays safe.
Where it is now
- Built and tested: the program on gno.land (tested, and run end to end on a local test chain with weeks a minute long: two hosts, a payer, a measurer, both kinds of pledge, given money and a deposit, a promise, weeks settled, hosts and the measurer paid and collecting); the
storehouseprogram for hosts, measurers, payers and downloads; and sugar.video's side: keeping a video, serving it to hosts, and playing it from them in the browser with every piece checked. - Checked twice: once against gno.land's security guides, rule by rule (nothing broken; a few loose ends tied), and once for the money: where every coin can go and what each player gains by cheating. The money checks found holes, now fixed and described above: a fan's money could go back to the payer, a quiet measurer could get a payer free hosting, and a handful of junk could stall the checking.
- Next: the first hosts that follow sugar.video, which is when the "Keep this video online" button appears on its pages; putting the program on gno.land's main network and funding the first pledge for sugar.video's kept videos; home computers as hosts; paying from the page with the Adena wallet.
- Later: fast paid downloads on the main network, viewers sharing pieces with each other in the browser, and BitTorrent clients joining in.