Hand in hand, peer-to-peer, nobody in the middle.
Go libraries for building peer-to-peer apps. Peers find each other, connect directly and keep a signed log, with no server in between.
v0.1 beta · Go 1.26+ · built on RFC 9162 and RFC 8032
Small libraries, in three layers.
Each one does one job and has its own docs. Use one, or use them all.
Data
Keys, encoding, a signed log, and the pieces that store, read and copy it.
Network
Finding peers by topic, inviting them into a group, talking to them over an encrypted channel, and sending live tracks of data or media.
Four things we will not trade away.
Every message goes through one machine that someone runs, pays for and can switch off.
Peers talk to each other directly. If one leaves, the others keep going.
Instead of a backend in the path
No server in the middle
Peers find each other and connect directly. No machine of ours carries your data, and with your own bootstrap node none of ours has to stay alive.
Instead of trusting whoever stores it
Every entry is signed
A log entry carries the signature of whoever wrote it. Anyone can check it, and nobody can change it quietly.
Instead of a log that never forgets
Deleting means something
A delete marker tells replicas to drop the data. It is best effort, and the docs say so plainly.
Instead of a relay that is always on
A relay only if you ask
When two peers cannot reach each other, a relay can help. It is off unless you turn it on.
No server in the path.
Find
Peers announce a topic and look it up in a distributed table. No directory server.
Connect
They open a direct, encrypted channel. A relay steps in only when there is no other way.
What you can build with it.
Six things the libraries do today, each with the pieces it needs and what to watch for.
Chat with no server
Two peers, one topic, a direct encrypted line.
Your devices, in sync
One signed log per device, pulled by the others.
A key-value store that travels
One writer, any number of checked readers.
Local first, sync later
Write offline, catch up when peers meet.
Peers behind home routers
Through the NAT when possible, your own relay when not.
Your own bootstrap node
The address new peers join through, on a machine you run.
Read it, run it, change it.
Every library is open source under the MIT or Apache-2.0 license (your choice) and builds on open standards. Nothing ties your app to us.
- LicenseMIT or Apache-2.0, in every repository.
- StandardsRFC 9162 for the log, RFC 8032 for signatures, QUIC and TLS 1.3 on the wire.
- Your serversRun your own bootstrap node and your own relay.
Join a topic in a few lines.
One function starts a swarm, bootstraps it from the nodes you pass in and joins a topic. Then it prints the start of the public key of every peer that connects.
- Line 04Start a swarm with your identity.
- Line 09Bootstrap from nodes you choose.
- Line 15Announce the topic and look up its peers.
- Line 19Read each new connection as an event.
- Go
func join(
ctx context.Context, id *koloid.Identity, nodes []netip.AddrPort,
) error {
sw, err := koloswarm.New(ctx, "127.0.0.1:0", id, nil)
if err != nil {
return err
}
defer sw.Close()
if err := sw.Bootstrap(ctx, nodes); err != nil {
return err
}
topic := koloswarm.Topic(sha256.Sum256([]byte("my first topic")))
opts := &koloswarm.JoinOptions{Announce: true, Lookup: true}
if err := sw.Join(ctx, topic, opts); err != nil {
return err
}
for {
ev, err := sw.Next(ctx)
if err != nil {
return err
}
if ev.Kind == koloswarm.Connected {
fmt.Printf("connected to %x\n", ev.Peer.PublicKey()[:8])
}
}
}
Version 0.1, beta and experimental. Honest about it.
The API can still change before 1.0. Every limit is written in the docs, and deleting is best effort, because a peer that already has your data keeps what it has.
The security model is documented. Read it before you rely on it.