Magic Wormhole


Magic Wormhole is a protocol that facilitates Peer-to-peer [file sharing|peer-to-peer file transfer] over the Internet. This makes it unlike other file transfer protocols, such as FTP or HTTP, as it does not require a central hosting server and is solely between two clients; however, it does require a rendezvous server to negotiate the connection.

Transferring a file

The sender uses a client to send the file. This generates a code consisting of a number and two or more words, which the receiver then enters into their wormhole client to receive the file. The receiver has only one chance to receive the file. If the code is entered incorrectly, the sender must generate a new code and send it again. Once the file is received, it can not be received again by someone else unless the sender sends it again by generating a new code.

Technical details

Magic Wormhole uses two servers, the mailbox server and the transit relay. The mailbox server allows the sender and receiver to find each others' IP addresses and agree on a code. The sender and receiver will then try to contact each other directly to send the file. If this is not possible, for example due to a firewall or NAT, they will use the relay server, which receives the file from the sender and transmits it to the receiver. Magic Wormhole uses encryption based on Password-authenticated key agreement for security. Due to the PAKE encryption, the sender and receiver do not need to trust the mailbox or relay servers. Magic Wormhole can also operate over Tor to hide the IP addresses of the sender and receiver from each other and from the mailbox and relay servers.

Implementations

The original implementation is written in Python. The protocol has also been implemented in Rust, Go, and Haskell.
Rymdport, formerly named wormhole-gui, is a free, cross-platform and open-source program used for transferring files, directories and plain text. It implements the magic-wormhole protocol in a compiled native Go wrapper. It supports Windows, macOS and Linux.