gittorrent GitHub
v0.1 · peer-to-peer · hackupc 2026
gittorrent logo: a peer-to-peer network node in forest green

gittorrent

Git collaboration without the forge. Clone, push, and pull directly between machines over Hyperswarm, with multi-writer consensus from Autobase. No GitHub, no server to pay for, no single host to lose.

Download Source on GitHub
$ npm i -g gittorrent
MIT licensed Hyperswarm + Autobase ed25519 identity works offline
01 — Premise

The forge was always the point of failure.

Git is already distributed. Every clone is a complete copy. What GitHub and GitLab actually sell you is coordination — peer discovery, availability, and knowing what main points to right now. gittorrent provides those three things without a server.

F-01 · Discovery
HyperDHT finds peers, not a hostname.

Every repo is a topic on the Hyperswarm DHT. Any node that joins the topic can be cloned from. No bootstrap server you have to keep alive.

routed via UDP hole-punching
F-02 · Consensus
Autobase linearises concurrent writers.

Two teammates pushing at the same time? Causal-DAG ordering, no leader election, no split-brain. Offline-first — appends queue locally and propagate on reconnect.

no central sequencer
F-03 · Identity
Your public key is your username.

One ed25519 keypair per user. Every ref update is signed and verified by the apply function before it ever hits the view. Invite by pubkey, revoke by pubkey.

sealed-box secret sharing
02 — Topology

A swarm, not a server.

→ 01

Init a local repo

gittorrent init mints a new keypair and spins up an Autobase on top of your working tree. You get back a gittorrent:// URL.

→ 02

Discover peers

Peers locate each other by the repo's public key on the DHT. LAN mDNS is the fallback when DHT is unreachable.

→ 03

Push, pull, clone

A tiny git-remote-pear helper makes gittorrent://… URLs work with vanilla git. No patched binaries. No forks.

→ 04

Share secrets safely

Add a .env; it's encrypted under a shared key that's sealed for every writer's pubkey. Revoke access and rotate — previous holders never see the new ciphertext.

     dev-a.local                    dev-b.local
        │                               │
        │  git push origin main         │
        │  ────────▶ Autobase              │
        │            (multi-writer)     │
        │               │               │
        │               ▼               │
        │         HyperDHT                │
        │       peer discovery          │
        │               │               │
        └───────────────┼───────────────┘
                        │
             direct encrypted link
              (UDP hole-punching)

  # objects → content-addressed Hyperbee
  # refs    → Autobase linearisation
  # auth    → ed25519 signatures on every op
03 — Reference

Commands, end to end.

Every subcommand supports --help. JSON output is available via --json for anything that returns structured data.

Command
What it does
gittorrent init
Mint a new repo keypair and attach an Autobase to the working tree.
gittorrent whoami
Print your ed25519 public key — hand it to someone who wants to invite you.
gittorrent invite <pubkey>
Grant write access. Add --indexer to let them also sign history.
gittorrent revoke <pubkey>
Remove a writer from the ACL. Pair with secrets rotate.
gittorrent status
Inspect peers, signed length, pending ops, writers.
gittorrent seed -d
Serve the repo in the background as a daemon so teammates can pull any time.
gittorrent secrets add/get/rotate
Manage encrypted files — .env, API keys, cert bundles.
git clone gittorrent://<key>
Clone with vanilla git, through the remote helper.
04 — Secrets

Stop WhatsApp-ing .env files.

Sealed for every writer. Rotated on revoke.

First secrets add generates a random 256-bit symmetric key. The key is sealed to each writer's ed25519 pubkey via a sealed box. Files are encrypted with that key and stored in a Hyperbee alongside the repo.

Invite someone and the key is resealed for them automatically. Revoke and rotate, and everything is re-encrypted under a fresh key — the revoked writer never sees new ciphertext.

No KMS. No password manager. No CI console setting nobody remembers how to access.

# share the whole .env with your team
$ gittorrent secrets add .env

# grab it on another machine
$ gittorrent secrets get .env --output .env

# rotate after someone leaves
$ gittorrent revoke <pubkey>
$ gittorrent secrets rotate
ok re-encrypted 3 files for 4 writers
05 — Install

Run it where you already work.

One binary. No daemon required (but gittorrent seed -d is one flag away). Works alongside your existing git workflow.

06 — Questions

Honest answers.

Is this BitTorrent for git?

Spiritually, yes — content-addressed blocks replicated across a swarm. Mechanically, no. gittorrent uses Hyperswarm for discovery + transport and Autobase for mutable-ref consensus. BitTorrent alone doesn't solve "what does main point to right now?" — that's the hard part.

Does it replace GitHub?

It replaces the hosting part. It deliberately doesn't replace issues, PRs, code review, or CI. Use whichever review workflow you already like on top — patches, a bridge, or your own tooling.

What happens if everyone goes offline?

Nothing dramatic. Commits still happen locally, Autobase queues your ops, and the swarm reconverges when any two writers come back online. No quorum is required to keep working.

Is it Byzantine-fault-tolerant?

No. The writer set is an explicit ACL of cooperating humans. A malicious writer you invited can author misleading history — the same trust model as any small team git forge. Revoke aggressively.

Do I need Node?

The dev workflow uses Node 20+. Production binaries are bundled with Bare, a lightweight JS runtime from the Holepunch / Pear ecosystem.

Can I self-host a relay?

Yes — DHT bootstrap nodes are configurable via GITTORRENT_BOOTSTRAP_NODES. The sample HyperDHT relay config lives in the repo if you want one node that's always reachable.