How Streamplace Works: Signing and Segmentation
Step 1: Generate a Stream Key
The first thing you do to stream on Streamplace is generate a stream keypair. These keys are secp256k1 keys, the same kind of keys used in Ethereum and ATProto. The public key gets posted publicly to your PDS as a place.stream.key record. The private key is used to authorize your broadcast; it gets pasted into your streaming software like OBS. (If you're streaming from an app or website, this all happens internally.)
Step 2: Stream
So we can model a livestream as somebody throwing a one-second video file in your face every second. In fact, for certain livestreaming protocols such as HLS and DASH, that's exactly what's happening behind the scenes: your computer is downloading a one-second video file every second and playing them back-to-back-to-back.
So that's what we do. As your stream comes in, we slice it up into one-second MP4 files. Later on, when the stream is played back, those MP4 files are stitched back together into a contigious WebRTC stream for you to watch.
Step 3: Sign
Each of our freshly-sliced one-second MP4 files is signed using the private key generated in step 1. This signature is embedded within the file itself, making it both secure and easy to work with. Change a single bit of the file and it'll be rejected by the verifier as invalid.
Step 4: Broadcast
Let's gooooooo! Now that your video is signed, it can be sent all over the world. Other Streamplace nodes can choose to syndicate your livestream, rebroadcasting your data.
Discussion in the ATmosphere