Skip to content

thebrandonlucas/video-lsat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Video Lsat

Watch or upload videos for bitcoin!

This project aims to demonstrate the use of Bitcoin Lightning micropayments to allow direct creator-to-consumer marketplaces for video content, as an alternative to ad, subscription, and sponsorship models. No KYC required.

There are three actors involved:

  • An uploader
  • A viewer
  • A host

All an uploader needs is an invoice macaroon and a video file. They then choose a price to view the video and hit "upload". The video and invoice macaroon are then uploaded to the host's site. When the viewer attempts to watch the video, the host uses the uploader's invoice macaroon to generate an invoice. When they do, an LSAT is saved to their browser as proof of payment so that they don't have to pay for the video on subsequent visits. The host does NOT have access to the uploader's or viewer's funds at any point, nor is it ever necessary for either party to reveal personally identifiable information. Your funds and your identity are in your control. And, with the rise of nostr, it may soon be possible to decentralize the video hosting process as well.

Architecture

It uses Bitcoin's Lightning Network for micropayments and LSATs for proof of payment. All payments currently use Bolt-11 invoices.

Uploaders require a lightning node that can receive payments and a macaroon with only invoice permissions to make requests. This app does not control your funds or save any information about you other than your invoice macaroon (if you are an uploader), the video itself, and information about the video.

Roadmap

  • Bolt-11 invoices generated from uploader invoice macaroons
  • Create demo site
  • Save LSATs to localStorage to remember payments on subsequent visits
  • Download/upload LSATs ability
  • About page with tutorial
  • Optional creator/user accounts using LNURL-Auth
  • LNURL-Pay/Lightning Address support
  • Thumbnail upload option (with default if none uploaded)
  • Tip/like button
  • Pay to comment
  • Dockerize the project for easy running
  • Give content creators choice between accepting keysend (value 4 value) or invoices as payment

Housekeeping

  • Add husky for pre-commit checks (Typescript, Prettier, ESLint)

Run Project

Rename .env.example to .env and set the environment variables in both packages/api and packages/ui. These must be set first for the project to work. You'll need to create an AWS S3 Bucket with s3:PutObject and s3:GetObject permissions and a Postgres DB

Then, run the migration in packages/api/src/db/migrations/0_videos.pgsql to setup the table

Finally, start the servers and you should be good to go!

# runs api on localhost:8000 by default
# runs ui on localhost:5173
yarn dev