libp2p WebRTC over QR

Two browsers connect directly as libp2p peers — no relay, no signaling server. The WebRTC offer and answer travel out-of-band as signed QR codes: one device scans the code off the other screen.

1 Start browser peer

Creates a libp2p node with a fresh key pair. Its Peer ID signs every payload you show.

Peer ID not started

2 Exchange QR payloads

Browser A: create an offer. Browser B: scan A's offer and show the generated answer. Browser A: scan B's answer. A browser never processes its own QR code.

For reliable scanning, turn up the other screen's brightness, keep the QR code flat, and let it fill about half of the camera view.

3 Send data over libp2p

Once the handshake completes, messages travel over a libp2p protocol stream on the WebRTC data channel.

Not connected