agora-org / agora

File server that accepts Lightning Network payments for downloads
Creative Commons Zero v1.0 Universal
184 stars 26 forks source link

Display file hash in listing #302

Open yzernik opened 2 years ago

yzernik commented 2 years ago

You could display the file hash next to the file name in the listing.

Then a downloader/buyer will know that they are downloading the exact file that they want.

The seller could still cheat and show a fake file hash in the listing, but it would still be a little useful, I think.

yzernik commented 2 years ago

An alternative way to sell files trustlessly:

1) Allow anyone to download the encrypted file without payment, and provide the hash of the encrypted file + the adaptor signature of the encryption key. 2) The lightning payment can then be used to obtain the preimage scalar of the adaptor signature. 3) After the payment, the buyer can use the preimage scalar to decrypt the file.

This will only work if lightning channels are using PTLCs instead of HTLCs. Not possible with HTLCs because it's impossible to generate multiple invoices with the same preimage.