Brainstorming Invitation - Apps using Sia
-
In case you're wondering why we don't already stream downloads, it's because pieces can arrive out-of-order. In theory it wouldn't be too hard to sacrifice some download speed in order to achieve streamable files (many BitTorrent clients support this), but it's a low priority for the time being.
-
Yea, I need to keep the HTTP connection alive for a very long time because it takes a while before the file gets written to disk after the download request is made. Then I listen for changes to the file and every time some new bytes appear I stream them over HTTP. When the size of the file matches the size reported by the Sia API I close the connection to the client.
EDIT: But a way to stream the file directly from Sia would really make things a lot easier. Would it be possible to write my own download client the connects directly to the hosts? That way I won't have to run a full wallet and save a ton of memory.... I just remembered that I could probably also turn everything except for the renter off in
siadif it's just for downloading
-
You currently don't need siad at all if you just want to download. (You will, once downloads require payment, though.) The code in renter/download.go is all you need. You have to decode the .sia file, connect to its hosts, send download requests, and recover the responses using the erasure code.
-
You currently don't need siad at all if you just want to download. (You will, once downloads require payment, though.)
All you need is any method to pay the host. If the host supports payments over the Bitcoin network, or over the lightning network, or over some other hub (or even paypal or something), then you don't need to be dialed into the Sia network to pay for downloads. The host doesn't really care where the money is coming from, as long as the host recognizes it as legitimate, secure money.
-
Would it be possible to pay using ordinary Siacoins, yet without having a full wallet (i.e. the entire blockchain downloaded)?
-
Yes, but you'd need to be careful about double-spends and synchronization. You could pay the host using just a signature and an existing file contract (that you imported, perhaps from the '.sia' that you are using to download the file), but after you make those payments you need to somehow synchronize back to the master wallet.
It's feasible for some situations, but not for others. It's not clear to me right now how that's going to pan out.
-
I'm thinking more about having a full renter (that can both upload and download files) that doesn't need a full wallet.
Basically, my (naive?) thinking is: if you're a host, you definitely need to know the entire blockchain, to ensure that your renters aren't cheating and double-spending on you.
But if you're just a renter, then as long as you can make sure you don't double-spend and upset your hosts by cheating them, shouldn't you be able to pay without having the entire chain? You only need to ensure you have money to spend in the first place.
-
It's a bit trickier than that, you do need to make sure that the final file contract revision makes it onto the blockchain. That said, there might be something that we could do to make a renter that's almost got full capabilities (minus making the original file contracts) which doesn't need a wallet or the blockchain to provide security guarantees on the host. But, that's something we'd be looking at further in the future.
-
@Taek said:
All you need is any method to pay the host. If the host supports payments over the Bitcoin network, or over the lightning network, or over some other hub (or even paypal or something), then you don't need to be dialed into the Sia network to pay for downloads. The host doesn't really care where the money is coming from, as long as the host recognizes it as legitimate, secure money.
I assume you're talking hypothetically, or is this something that you're planning to support? i.e. possibility to extend Sia hosts with 3rd party payment plugins?
Also, I don't understand how leechers will negotiate download payments with hosts: on a host-by-host basis, or through the blockchain in some way?
-
@Taek said:
It's a bit trickier than that, you do need to make sure that the final file contract revision makes it onto the blockchain. That said, there might be something that we could do to make a renter that's almost got full capabilities (minus making the original file contracts) which doesn't need a wallet or the blockchain to provide security guarantees on the host. But, that's something we'd be looking at further in the future.
What about a Sia Lite Wallet, which negotiates with a trusted full-node running the blockchain?
-
I assume you're talking hypothetically, or is this something that you're planning to support? i.e. possibility to extend Sia hosts with 3rd party payment plugins?
It depends on how the ecosystem evolves. We aren't planning on supporting it until it becomes necessary, but ultimately I do think that Sia would be a much better CDN if clients had a builtin way to pay websites and hosts for bandwidth costs and page views. But, having the user pay on a per-pageview or per-download basis is radically different than anything that currently exists. The Brave webbrowser might be a good place to start exploring this though. If there is broad support on the web for micropayments, we'll absolutely make it so that our hosts can integrate with this micropayment system. Bitcoin, Ethereum, or some bank-chain payment process, we want to make the Sia experience as smooth as possible.
What about a Sia Lite Wallet, which negotiates with a trusted full-node running the blockchain?
That's another thing we'd consider doing. Again, depends on what direction the ecosystem evolves in.