activitypub

ActivityPub library in Nim

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version 0.1.2
License MIT
CI Status Failing
Downloads 0
Last Indexed 2026-09-05 07:27

Authors

  • OpenPeeps

Installation

nimble install activitypub
choosenim install activitypub
git clone https://github.com/openpeeps/activitypub-nim

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
activitypub - - - - - - -

Dependencies

Package Version Optional
nim >= 2.0.0 No
checksums >= 0.2.2 No
openparser >= 0.1.9 No
nimcypher >= 0.1.1 No
powpow >= 0.1.9 No
mimedb >= 0.1.1 No

Source

Repository https://github.com/openpeeps/activitypub-nim
Homepage https://github.com/openpeeps/activitypub-nim
Registry Source nimble_official

README

ActivityPub implementation in Nim

nimble install activitypub

API reference
Github Actions Github Actions

Features

  • Full ActivityPub core, activity, and actor data types (JSON-LD serialization/deserialization)
  • WebFinger client (webfinger, buildJrd)
  • HTTP Signatures (Ed25519 and RSA SHA-256)
  • Ed25519 and RSA keypair generation, PEM export/import
  • Federation engine: deliver activities to remote inboxes, fetch remote actors
  • Client-to-Server (C2S) API: postToOutbox, getOutbox, getFollowers, getFollowing
  • Inbox dispatcher with type-based routing and HTTP Signature verification
  • Activity builders: buildFollow, buildAccept, buildReject, buildUndo, buildCreate, buildDelete, buildNote, buildCollectionPage, buildOrderedCollection, buildCollection
  • Collection pagination: fetchCollection, fetchCollectionPage, fetchAllItems
  • Built-in HTTP server (powered by pkg/powpow) with:
  • Routes for WebFinger
  • Actor profiles, inbox, outbox, followers, and following

Requirements

requires "nim >= 2.0.0"
requires "openparser >= 0.1.6"
requires "checksums >= 0.2.2"
requires "nimcypher >= 0.1.0"  # pure-Nim Monocypher port
requires "powpow > 0.1.4"
requires "ormin#head"

Roadmap

  • Persistent storage backends (SQLite, PostgreSQL) using pkg/ormin
  • C2S client-to-server endpoints (POST /users/{id}/outbox, GET /users/{id}/following)
  • Activity forwarding and shared inbox support
  • Object retrieval with forward/fetch (object property resolution)
  • Linked Data Signatures (2017/2019)
  • FEP compatibility (FEP-2677, FEP-8cf5, FEP-7888)
  • Rate limiting and request validation middleware
  • Support non-spec ecosystem extensions (Mastodon's Hashtag, Emoji, PropertyValue)
  • API stabilization for v1.0.0 release

Examples

Runnable examples live in examples/. Each is self-contained:

File What it demonstrates
ex_01_types.nim ActivityStreams data types: build, serialize, deserialize
ex_02_crypto.nim Ed25519 keypairs, signing, SHA-256 digests, HTTP Signatures
ex_03_builders.nim Activity builders: Follow, Accept, Create, Delete, Like, Undo, ...
ex_04_webfinger.nim Handle parsing and JRD responses for WebFinger
ex_05_dispatcher.nim Inbox dispatcher with typed handlers and signature verification
ex_06_server.nim Full ActivityPub HTTP server (powpow) with live endpoints
ex_07_client.nim C2S client: signed delivery of a Follow to an inbox

Run any example with:

nim c -r examples/ex_01_types.nim

❤ Contributions & Support

OpenCode Switch to Open-Source LLMs via OpenCode GO, choosing from a variety of powerful models such as DeepSeek, Qwen, Kimi, GLM-5, MiniMax, MiMo. 🍕 Use our referral link to get started!

🎩 License

MIT license. Made by Humans from OpenPeeps.
Copyright © 2026 OpenPeeps & Contributors — All rights reserved.