Problem description

World Wide Web is a dynamic thing. Sooner or later a content published by a user can become unavailable. The content can dissapear just in a few minutes after being published (for example, it can be blocked by the hoster of the content), or it can happen after the lapse of many years.

As a result there can be a situation when a new user wants to obtain some content, which is no longer available, and there is another user which still has this content and is ready to share it. But these two users know nothing about each other. The only thing, which connects these two users is the broken link.

Alternate is a network, which connects these two users via the broken link.

The idea

The alternate network is a DHT-table, which stores key-value pairs. The hash of the original link (which is no longer available) is used as the key. And the alternative link to the same content is used as the value.

The scheme of the alternative link is not determined by the Alternate protocol. Therefore the alternative link can be, for example, an https- or a magnet-link.

Basically Alternate is a P2P alternative for the Web Archive.

Default bootstrap node

In order to connect to the network, you need a bootstrap node. You can specify your bootstrap node using the "-b" parameter of the alternate program. The default bootstrap node is running on, port 3112. It has the following IDs:

  • Node ID b3816f9e4a69c43197f95f3053cb8cd19ad99b0b
  • Public key ID: 3f56ef6010fb9f3f3425a5e987fcaca8583c4747

Typical use case

Let's assume there was a link to some file in the Web. In our example it is a customized driver set. Let's name it "Link #1":

The archive had been available in the network for quite a long time, so few users had downloaded it and saved it locally:

Some time has passed and the archive became unavailable:

Error 404

One of the users (let's name it "User #1") learned that the archive had gone from the network and decided to share his copy of the archive. Therefore he prepared an alternative link to that archive. Let's name it "Link #2":

In order to associate the new alternative link (Link #2, which is yet unknown in the Web) with the original link (Link #1, which became broken, but is widespread in the Web), the User #1 publishes in the Alternate network information, that the Link #2 points to the same content as the Link #1. To do that, the User #1 must connect to the network and execute the following command in the Alternate CLI:

Node cf7a559ee6848254937a6ef33ed19c9bcaadb747 running on port 49728
Public key ID is b6f2070cdb355d7d069d8fd10de67f6f447c9e44
 (type 'h' or 'help' for a list of possible commands)

>> p
Put: success (took 4.195s)

The "Put: success" message means, that the information has spread in the network.

In order to make the published alternative link persistent, User #1 must keep its Alternate node constantly running like a BitTorrent node. Otherwise the alternative link will disappear from the network in relatively short period of time (about 1 hour).

After that any other user facing with the broken Link #1, will be able to find the alternative Link #2 published by User #1. In order to find alternative links, the user should connect to the network and execute the following command in the Alternate CLI:

Node 8de86789664affd3683b1640fcad9c4ca42ff5c3 running on port 45198
Public key ID is 85fc7396ece0177b1a9c0655dcb03ffb7b11d76d
 (type 'h' or 'help' for a list of possible commands)

>> g
Get: found URL (after 0.553498s) signed by b6f2070cdb355d7d069d8fd10de67f6f447c9e44
Get: completed (took 0.554107s)

The command will list all known alternative links. So the output may contain few extra alternative links beside the Link #2, published by other users.


When the alternate program starts up for the first time, it will generate a key pair for the user and store it in a file. After that, the program will read the key pair from the file on every startup.

The key pair is used for signing publications of alternative links. When the user posts a new alternative link, its node will automatically sign the publication by the user's private key.

When a node receives an alternative link from the network, it will automatically check its signature. And the ID of the publisher's public key will be listed along with the link itself in the 'get' command output.

Public key ID of the default bootstrap node is listed in the Default bootstrap node section.

The Alternate network does not support establishment or management of trust relationships between usespread into the networkrs. Trust relationships must be established via third-party means.


The only available version of the alternate program is a proof-of-concept. It's available here: alternate-0.1.tar.bz2.

To fetch the latest source code from the git repository, run the following command:

git clone git://

alternate is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3.

How to build

alternate program depends on the OpenDHT library. You need to install the library and its header files before building the program.

Steps to build the alternate program:

cd ${ALTERNATE_SRC_ROOT}  # Navigate to the directory containing the sources
autoreconf -if            # Generate configuration files
./configure               # Configure and create Makefiles
make                      # Compile the binary executable

The compiled executable will be located here: ${ALTERNATE_ROOT}/src/alternate.


  • There is the Web Archive. Why do we need anything else?
    Web Archive is a centralized resource. It can be not available because of various reasons.