Difuzzion

P2P Seeding

Documentation on content hosting. Understand how Difuzzion's peer-to-peer network distributes, stores, and delivers content through your browser — and what happens when peers connect or disconnect.

What is a Peer?

A peer is any user connected to the Difuzzion network who is sharing content. Your browser acts as a peer as long as the Difuzzion tab is open. You automatically share every piece of content you have viewed or downloaded from your local storage.

Every 15 seconds your browser sends a heartbeat to the signaling server, reporting which content chunks you have available in your IndexedDB storage. This keeps the network aware of what you can offer to others.

How Content is Distributed

When you upload content, the file is split into 240 KB chunks. Each chunk is hashed with SHA-256 to guarantee integrity. These chunks are stored in your browser's IndexedDB and immediately become available to the network.

When another user wants to play or view your content, their browser:

  • Fetches the manifest — a metadata file listing all chunks and their hashes.
  • Requests the needed chunks from available peers via WebRTC data channels.
  • Stores received chunks in its own IndexedDB.
  • The Service Worker intercepts player requests and serves data from local storage.
  • Once downloaded, that user also becomes a seeder for the same content.
lightbulb

Pro Tip

The download process is completely transparent — the video/audio player works like any normal web player, but the data comes from other users instead of a central server.

Content Lifecycle

Content on Difuzzion follows a lifecycle driven by peer availability:

  • Active — At least one peer is seeding the content. The last_seeded field is NULL.
  • Grace period (0–3 min) — You close your browser; your peer goes "offline temporary." Your content registrations remain for 3 minutes.
  • Inactive — After 3 minutes with no peers, the content is marked with a last_seeded timestamp.
  • Purged (15 days inactive) — Content that has been inactive for 15 consecutive days is permanently deleted from the database.

Live Streaming

Go to Publish → Go Live, configure your title and category, and allow camera/microphone access. Your live stream is distributed in real time via P2P to viewers.

If your stream is inactive for 60 seconds (no data being sent), it is automatically cancelled. During a live broadcast, IP relay protection remains active for the entire duration of the stream.

IP Relay Protection

When you publish new content, you are inevitably the only peer who has it. An observer requesting the content immediately could deduce your IP as the creator. To prevent this, Difuzzion activates a relay mode:

  • Relay active (10 minutes) — From the moment the first user requests your content, all chunks are forwarded through the Difuzzion server. Your IP is never exposed to the requester.
  • Automatic transition — After 10 minutes, the system switches to direct P2P connections. By then, multiple peers already have your content, diluting any correlation to your IP.
  • Re-activation — If you edit an already-published piece of content, the relay protection restarts automatically.

This protection is fully transparent — you do not need to enable anything. It applies automatically when publishing, editing, or streaming live.

Storage & Limits

Difuzzion stores chunks in your browser's IndexedDB. The maximum upload size per file is 2 GB. If your local storage exceeds the browser's quota (typically 50–80% of available disk), the system automatically clears old cached chunks to free space.

Supported media formats include:

  • Video — MP4, WebM
  • Image — JPEG, PNG, WebP
  • Audio — MP3, AAC
  • Text — Plain text posts
  • Live — WebRTC stream

P2P Seeding

Documentation on content hosting. Understand how Difuzzion's peer-to-peer network distributes, stores, and delivers content through your browser — and what happens when peers connect or disconnect.

What is a Peer?

A peer is any user connected to the Difuzzion network who is sharing content. Your browser acts as a peer as long as the Difuzzion tab is open. You automatically share every piece of content you have viewed or downloaded from your local storage.

Every 15 seconds your browser sends a heartbeat to the signaling server, reporting which content chunks you have available in your IndexedDB storage. This keeps the network aware of what you can offer to others.

How Content is Distributed

When you upload content, the file is split into 240 KB chunks. Each chunk is hashed with SHA-256 to guarantee integrity. These chunks are stored in your browser's IndexedDB and immediately become available to the network.

When another user wants to play or view your content, their browser:

  • Fetches the manifest — a metadata file listing all chunks and their hashes.
  • Requests the needed chunks from available peers via WebRTC data channels.
  • Stores received chunks in its own IndexedDB.
  • The Service Worker intercepts player requests and serves data from local storage.
  • Once downloaded, that user also becomes a seeder for the same content.
lightbulb

Pro Tip

The download process is completely transparent — the video/audio player works like any normal web player, but the data comes from other users instead of a central server.

Content Lifecycle

Content on Difuzzion follows a lifecycle driven by peer availability:

  • Active — At least one peer is seeding the content. The last_seeded field is NULL.
  • Grace period (0–3 min) — You close your browser; your peer goes "offline temporary." Your content registrations remain for 3 minutes.
  • Inactive — After 3 minutes with no peers, the content is marked with a last_seeded timestamp.
  • Purged (15 days inactive) — Content that has been inactive for 15 consecutive days is permanently deleted from the database.

Live Streaming

Go to Publish → Go Live, configure your title and category, and allow camera/microphone access. Your live stream is distributed in real time via P2P to viewers.

If your stream is inactive for 60 seconds (no data being sent), it is automatically cancelled. During a live broadcast, IP relay protection remains active for the entire duration of the stream.

IP Relay Protection

When you publish new content, you are inevitably the only peer who has it. An observer requesting the content immediately could deduce your IP as the creator. To prevent this, Difuzzion activates a relay mode:

  • Relay active (10 minutes) — From the moment the first user requests your content, all chunks are forwarded through the Difuzzion server. Your IP is never exposed to the requester.
  • Automatic transition — After 10 minutes, the system switches to direct P2P connections. By then, multiple peers already have your content, diluting any correlation to your IP.
  • Re-activation — If you edit an already-published piece of content, the relay protection restarts automatically.

This protection is fully transparent — you do not need to enable anything. It applies automatically when publishing, editing, or streaming live.

Storage & Limits

Difuzzion stores chunks in your browser's IndexedDB. The maximum upload size per file is 2 GB. If your local storage exceeds the browser's quota (typically 50–80% of available disk), the system automatically clears old cached chunks to free space.

Supported media formats include:

  • Video — MP4, WebM
  • Image — JPEG, PNG, WebP
  • Audio — MP3, AAC
  • Text — Plain text posts
  • Live — WebRTC stream