Code Monkey home page Code Monkey logo

streamium's Introduction

Streamium

Decentralized trustless video streaming using bitcoin payment channels

Concept

Streamium is a fully decentralized paid video streaming application. It leverages various prior technologies like bitcoin and WebRTC to achieve trustless pay-as-you-go video streaming with no intermediaries.

Content creators offer their streaming services in exchange for bitcoins using a payment channel with the client, streaming a series of cost-free transactions with no counterparty risk.

Installation

To run Streamium, just serve the root directory using any web server. For example:

cd streamium/
bower install
npm install
node server.js &
node ssl_peerjs.js &

and then access it from any WebRTC-supporting browser:

https://localhost:8443/

How does it work

1. Channel creation

The user broadcasting creates a channel by specifying a name to use (this will be a unique identifier for the video stream). She needs to provide a payment address where the funds will eventually be sent to and the rate at which she expects the stream consumers to pay. She will receive a link to share with potential consumers of the stream.

2. Joining a channel

For consumer users, the web application will join the channel by opening a peer to peer connection to the provider. The screen will show the rate the provider is charging, the provider's public key, and a funding address.

3. Funding process

The consumer web application will generate a private key and show an address on screen so the user can fund the channel. After a transaction that adds funds to this address is detected, the payment channel is established by asking the server to sign the refund transaction and broadcasting the commitment transaction.

4. Video streaming

When the server receives the commitment transaction and is ready to start broadcasting, the transmission of video to that user will start. The user will periodically transmit transactions signed by him to the server (like signing checks that will not be cashed) where each transaction gradually increments the amount paid to the server. When the user stops paying, or the connection is lost, the server will stop the transmission and broadcast the last payment received.

Technology stack

Static web application

Streamium is a static HTML web application and thus requires no servers to run.

AngularJS

AngularJS was used for client-side application code (and there's no server-side code!)

WebRTC

WebRTC is a browser to browser communications protocol used to share video streams between clients and service providers. It allows sharing of data and media without central servers. We use PeerJS to manage WebRTC connections.

Bitcoin payment channels

Bitcoin is a p2p currency used for trustless payments. Bitcoin payment channels are used to establish a secure pay-as-you-go mechanism with no need for a third party.

License

Code released under the MIT license.

Copyright 2015 Streamium developers

streamium's People

Contributors

adlai avatar alcuadrado avatar batalles avatar bitstein avatar dawsbot avatar demibrener avatar eordano avatar esneider avatar fortefranco avatar kvnn avatar maraoz avatar rodrigouroz avatar yemel avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.