58 comments

[ 3.4 ms ] story [ 102 ms ] thread
Agora is a simple web file server that charges for downloads. It uses the Lightning Network for payments. The Lightning Network is a layer on top of Bitcoin that enables fast payments with very low fees. It settles to the Bitcoin network, so there's no separate token or currency.

Agora is released under a maximally permissive license and written in Rust. Currently it integrates with LND for Lightning Payments, so you'll need to also have an LND instance running if you want to charge for downloads.

And if you're interested in using Agora to sell some files, please try it out and let us know what you think! We have lots of ideas for features that we'd like to add, but are much more interested in what users need.

what's the advantage of this over existing systems?
There might be others, but the existing system that comes to mind is Gumroad, a service that allows creators to sell digital content.

Compared to Gumroad, Agora is not subject to censorship and can be self-hosted.

Losing funds on lightning network can be "advantage"? https://bitcoin.stackexchange.com/questions/91211/how-can-so...
The possibility of losing funds exists, but bugs are something you would expect with any in-development technology. And, existing payment services are not without risk. Getting your account frozen and funds taken is pretty common with PayPal, Square, and other payment providers, which is not possible with the Lightning Network.
> The possibility of losing funds exists, but bugs are something you would expect with any in-development technology.

Bugs exist, sure... but bugs that have the potential to cause direct revenue loss, and that cause the core purpose of the product to fail? That isn't a bug, that is a deal-killer.

How do you prevent users from selling illegal content? Do you really want to be anywhere near that?
We don't host Agora instances, aside from our test instances, so we cannot prevent users from selling illegal content. Any useful technology has the potential for abuse, and Agora is no different.
Out of curiosity, did you think about the use case for authorities to deal with people selling forbidden images? I'm sure you already know which kind I'm thinking of.
The vast majority of people looking for that are just... regular people. Awful people, yes, but no smarter than your average bear.

There are hundreds of thousands of those images being transmitted fully-encrypted on WhatsApp, a fully-legal multi-billion dollar platform, every year. And that's just what users self-report![1] Why would any crook bother with Agora when they're already using fully-encrypted platforms like WhatsApp? What would be their thought process in switching? It's not like Bitcoin is particularly difficult to track, anyway.

Agora seems completely stupid and pointless, but let's not pretend that they're doing something disastrously morally harmful. More than likely, it's just a platform that will die out in a few months. Best-case scenario, it serves as a honeypot for people with Coinbase accounts that want to break the law. It's actually easier to track than people transmitting these sorts of things over centralized, encrypted platforms.

[1] A tweet by Will Cathcart, who's the corporate head of WhatsApp at Facebook. https://twitter.com/wcathcart/status/1423701475595755524

My point is that that use case will very easily attract attention from authorities if it will make it easier to make money with those images.
This will be an issue for anyone who hosts it. Is there a plan for your users?
Can you explain why it will be an issue for anyone who hosts it? The host determines what content is available. Agora does not yet support user uploads.
My mistake - I thought this was a “filebin”
I think this is actually the case.
Cool project. Let's say i want to switch the currency from BTC to BAT. How can i do that?
Currently, it only integrates with the Lightning Network via LND. You would have to modify it to support BAT. However, BAT would probably not be a good choice. BAT transactions are slow when compared to Lightning Network payments. Also, since BAT is a token on Ethereum, the fees would likely be prohibitive for small, or even medium size payments.
Htlc.me message when i tried to buy your file : Send Payment Failed

Payment failed to send. This can happen due to temporary network connectivity issues or an unexpected server error.

Thanks for trying it out! Is the failure persistent or does it work when you retry it?
New error message : Payment Problem

You already paid that invoice! Ask them for a new one?

I still cant pass the paywall.

Are you using the agora.download or test.agora.download? If you're using test.agora.download, are you paying with htlc.me? Can you provide the invoice ID? (It's the hexadecimal string after `/invoice/`.)
I'm using the agora.download. test.agora.download is working fine.
If you're using htlc.me, that's probably the issue. htlc.me is a testnet wallet, so it can only pay testnet invoices, and agora.download is on mainnet.
I cant send the payment to agora.download, but i can send it to test.agora.download . What's happening?
Just saw this now, but agora.download is on mainnnet, and test.agora.download is on testnet, so if you're using a testnet wallet, it won't be able to pay the mainnet invoices from agora.download.
So like Gumroad but with crypto payments?
Very much so! Plus it's open source and anyone can run an instance.
(comment deleted)
This brazen simplicity is what makes it look like the next Dropbox.
"Received Payment

A welcome gift! Thanks for trying HTLC.me!

0.00313370 tBTC ($140.06 tUSD)"

What is the difference between USD and tUSD?

HTLC.me is a testnet Lightning wallet, so the balances are in tBTC, testnet bitcoin. tUSD isn't a real thing, it just means that if your balance was in BTC and not tBTC, you would have that much USD.
Let's say i want to test it by using real BTC. How can i do it? The real lightning wallet.
The most convenient Lightning Wallet is probably Wallet of Satoshi, which you can find on the Apple or Android app stores. Once you download it, you can fund it with an on-chain transaction. Once you have funds in the wallet, you should be able to pay for invoices at agora.download.
Have you tested it by using real BTC?

I just read from lnd's documentation (here : https://github.com/lightningnetwork/lnd/blob/master/docs/saf...) that "As of this writing , lnd is still in beta and it is considered #reckless to put any life altering amounts of BTC into the network.

Are you sure that agora is really safe?

We have tested it using real BTC, so far so good! LND is definitely still in beta, and the Lightning Network itself is still in its infancy, so it's a good idea not to have too much funds in an LND wallet.

We're try to be very careful when developing Agora, and all features are covered by unit and integration tests. However, bugs are always a possibility.

Also, when we want to self-host our own Agora instance. Should we run our own LND instance, or can we just connect it to any pre-existing LND instance? Do you have any recommendation, which LND instance that is "good" and "trusted"?
If you connected an Agora instance to an LND instance, you would have to trust the person who ran that instance, since they would be in control of funds from payments, so I think the best idea is to run your own LND instance.
I think i should learn more about LND first. I've downloaded the LND's docker image. Then i tried to run the example commands, but it still dont work.

"Unable to find image 'myrepository/lnd:latest' locally docker: Error response from daemon: pull access denied for myrepository/lnd, repository does not exist or may require 'docker login': denied: requested access to the resource is denied."

I'm also pretty new to Docker though. So maybe i should learn about Docker first before learning about LND.

Can you tell us how to run our own LND instance and how to connect it to Agora? I think, a step-by-step tutorial would be a great help to us as an Agora user who want to self-host it.

It's definitely challenging to set up an LND instance. I'll try to find a good one and link to it from our readme!
If you're trying to set up an lnd instance take a look at raspiblitz it bootstraps the process for you and can be attached to a raspberry pi 4
So,if we want to use Wallet of Satoshi as a preferred lightning wallet for our Agora instance, we should connect our Agora instance to Wallet of Satoshi's LND gRPC server.

Where i can find Wallet of Satoshi's LND gRPC server host and port?

Ahh, not quite. I thought you were asking about a wallet for making payments, i.e. for buying content from Agora.

In order to process payments for your Agora instance, you would need to connect it to an LND instance that you ran yourself.

Fantastic effort - great to see decentralised file downloads with the ability to accept payments. It's a good step towards freeing independent commerce from the increasingly-censorious establishment tech players.

There is certainly potential for negatives, like people self-hosting to sell pirated and other illegal content. However we're at this point because the establishment services have been engaging in worsening behaviour over the past few years.

Good luck and looking forward to seeing this develop.

Thank you for the kind words!
That's potentially very big, but it needs some plumbing. Can you use a Visa card to refill a "lightning network account" or whatever you call it? Can the seller get proceeds to a bank account in $s?
It's actually pretty easy to get into and out of Bitcoin. river.com, is a US-based service that allows buying and selling bitcoin with USD, making USD transfers to and from a linked bank account, and making and receiving Lightning Network payments.

So you could set up an LND instance, get inbound liquidity with a service like Bitrefill*, and then withdraw any funds via the Lightning Network to a River account, sell the proceeds for USD, and transfer them to your bank account.

I use River as an example because it's my favorite, but there are many other services that you could also use.

* It's slightly subtle aspect of the Lightning Network, but in order to receive funds, you need inbound liquidity, i.e. a channel with your Lightning Network node with funds on your counterparty's side of the channel. This can be accomplished buy buying inbound liquidity from a service like Bitrefill: https://www.bitrefill.com/buy/lightning-channel/

For those of us who aren't totally up on crypto stuff, liquidity in this sense is basically buffering the money until the final Bitcoin transaction settles? So if you buy, say, 1,000,000 sats from Bitrefill, that means you can only have 1,000,000 sats worth of transactions "in the pipeline", so to speak?

If so, what happens if you do have more than that amount in outstanding transactions? The transactions fail? They hang around and complete after the pipeline empties out?

What if I just want to assume that the customer is good for the money and queue it up myself for settlement once I have the liquidity to spare. Does Agora let me do that?

I apologize if these are dumb questions.

These are definitely not dumb questions!

Liquidity management is one of the most complicated aspects of the Lightning Network, and certainly one of the most counter-intuitive.

The basic primitive that makes up the Lightning Network is a "channel". A channel is between two nodes, has a fixed capacity, is opened by making a on-chain Bitcoin transaction, and is closed by making an on-chain Bitcoin transaction.

While the channel is open, the two parties to the channel can make payments between themselves, but do not have to publish a Bitcoin transaction for each one of these payments. They only have to publish a Bitcoin transaction when they want to close the channel, which nets-out the intermediate transactions made since it was opened.

As a concrete example, let's say Alice and Bob open a channel, with Alice contributing 1 BTC when the channel is opened, and Bob contributing 0 BTC. Initially, their balances on the channel are:

    Alice: 1 BTC
    Bob: 0 BTC
In this state, Alice can send a 0.1 BTC payment to bob, and the channel balances will be:

    Alice: 0.9 BTC
    Bob: 0.1 BTC
Alice and Bob can send each other money, but only up to the amount that they have in the channel. So at this point, Alice can send Bob up to 0.9 BTC, and Bob can send Alice up to 0.1 BTC.

However, at the very beginning, when Bob's balance was 0 BTC, he could not have sent money to Alice. Due to a lack of inbound liquidity, which is, quite simply, money on the other side of a channel, which can be sent to you.

This is an aspect of the Lightning Network that is very different from other payment systems, and from on-chain Bitcoin payments. You must arrange to have sufficient inbound liquidity to receive payments.

You ask a good question: What if I just want to assume that the customer is good for the money and queue it up myself for settlement once I have the liquidity to spare?

Let's imagine that we were in the initial state, Alice had 1 BTC in the channel, Bob 0 BTC, and Alice let Bob make a payment to her of 1 BTC. The new balance would be:

    Alice: 2 BTC
    Bob: -1 BTC
However! When a Lightning Network channel is closed, you divide up the funds from the funding transaction between the parties to the channel. The channel was funded with an on-chain Bitcoin transaction of 1 BTC, so there would be no way to pay out Alice 2 BTC from that initial transaction. Since both parties to a payment channel can close the channel at any time, Alice would be trusting Bob to keep the channel open until he no longer had a negative balance, and avoiding the need for trust is the whole purpose of the Lightning Network in the first place, otherwise we could just trade unenforceable IOUs back and forth.
This could be a self-hosted onlyfans if I understand correctly?
NANO payments might be an interesting addition to this project
finally, an implementation for error 402: Payment Required !