{"id":13832800,"url":"https://github.com/ryogrid/nostrp2p","last_synced_at":"2025-08-17T13:05:36.628Z","repository":{"id":221157079,"uuid":"753605029","full_name":"ryogrid/nostrp2p","owner":"ryogrid","description":"Pure Peer-to-Peer Distributed Microblogging System on NAT Transparent Overlay Network","archived":false,"fork":false,"pushed_at":"2024-07-09T00:04:22.000Z","size":331,"stargazers_count":42,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-11T00:11:33.928Z","etag":null,"topics":["decentralized","distributed","golang","gossip-protocol","microblog","nostr","overlay-network","p2p","peer-to-peer","sns"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ryogrid.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["ryogrid"]}},"created_at":"2024-02-06T13:03:56.000Z","updated_at":"2025-03-01T00:36:03.000Z","dependencies_parsed_at":"2024-02-12T05:31:54.594Z","dependency_job_id":"8daf7663-7d87-4a04-920c-224c99ac8805","html_url":"https://github.com/ryogrid/nostrp2p","commit_stats":null,"previous_names":["ryogrid/bazoon","ryogrid/buzzoon","ryogrid/nostrp2p"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/ryogrid/nostrp2p","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryogrid%2Fnostrp2p","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryogrid%2Fnostrp2p/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryogrid%2Fnostrp2p/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryogrid%2Fnostrp2p/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryogrid","download_url":"https://codeload.github.com/ryogrid/nostrp2p/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryogrid%2Fnostrp2p/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270850243,"owners_count":24656470,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["decentralized","distributed","golang","gossip-protocol","microblog","nostr","overlay-network","p2p","peer-to-peer","sns"],"created_at":"2024-08-04T11:00:31.010Z","updated_at":"2025-08-17T13:05:36.578Z","avatar_url":"https://github.com/ryogrid.png","language":"Go","funding_links":["https://github.com/sponsors/ryogrid"],"categories":["Tools"],"sub_categories":["Client reviews and/or comparisons"],"readme":"- [What is NostrP2P?](#what-is-nostrp2p)\n- [Consept and Design](#concept-and-design)\n- [Technical Overview](#technical-overview)\n  - [Difference and Commpon Points with (General) Nostr](#difference-and-commpon-points-with-general-nostr)\n  - [(General) Nostr Architecture](#general-nostr-architecture)\n  - [NostrP2P Architecture](#nostrp2p-architecture)\n- [Build](#build)\n- [NostrP2P Command Usage](#nostrp2p-command-usage)\n- [Specification](#specification)\n- [Examples](#examples)\n  - [Generate Key Pair](#generate-key-pair)\n  - [Server Launch](#server-launch)\n- [Bootstrap Server](#bootstrap-server)\n- [Client](#client)\n- [Trial](#trial)\n  - [Current Implemented Featues on Dedicated NW](#current-implemented-featues-on-dedicated-nw)\n  - [Current Implemented Features with Nostr Client (Not NostrP2P Client) Using a Protcol Bridge Server](#current-implemented-features-with-nostr-client-not-nostrp2p-client-using-a-protcol-bridge-server)\n- [Roadmap (Server\\\u0026Client)](#roadmap-serverclient)\n\n# What is NostrP2P?\n- Pure Peer-to-Peer Distributed Microblogging System on NAT Transparent Overlay Network Based on Idea of [Nostr](https://en.wikipedia.org/wiki/Nostr)\n- Distributed Microblogging System by All User's Contribution\n- I wrote an article about NostrP2P :)\n  - [\"NostrP2P: Pure P2P Distributed Microblogging System - ryo_grid's tech articles\"](https://ryogrid.github.io/tech-entry/about-nostrp2p.html)\n\n# Concept and Design\n- [here (English)](https://gist.github.com/ryogrid/fa2bfa284784c866ad88e3c38445752a)\n  - English version is latest :)\n- [Japanese version](https://gist.github.com/ryogrid/0ba0d825c3bb840dffa519c5ab91d4ff)\n\n\n# Technical Overview\n## Difference and Commpon Points with (General) Nostr\n- Difference with (general) Nostr\n  - Server (Relay server)\n    - Firstly, in NostrP2P, servers communicate with each other on pure peer-to-peer manner. Clients does not\n      - This means that NostrP2P has client-server architecture also\n    - Servers of NostrP2P are correspond and similar to Relay server of Nostr but these are more distributed and coodinate with each other\n    - Servers handle each recieved event data in a different way though these are not special kind one (ex: replacable events) on Nostr because optimization for pure peer-to-peer network architecture is needed\n    - Supporse large number of servers because each user of NostrP2P need my server\n    - Client can trust server it accesses to\n      - This is important for optimization of client's network resource consumption and power consumption\n    - Powerful machine is not needed for server because it handles only one user's requests and amount of managing data is not large compred to (general) Nostr\n      - If we considered server (Relay server) as a kind of database system, above is obvious \n  - Client\n    - Almost same role with one of Nostr but its communication protocol between server is little bit different\n      - In current plan, transport is REST and data is encoded to binary. Not websocket and Not JSON text\n    - Client which is used by User-A only accesses to a server which is managed by the user\n  - In all of design\n    - Microbrogging application specific\n      - This means architecture and protcorl of NostrP2P is not for general purpose unlike Nostr\n        - \"Nostr\" is a name of architecture and protocol and not name of SNS and Microblogging system\n      - In other words, \"NostrP2P\" is a name of an microblogging system like \"Bluesky\"\n- Common point with (general) Nostr\n  - Data structure of event data is almost same\n  - Key pair format and signing method are same\n  - Specification like kind number is same if it is for same functionality (at least for now)\n  - Functionality realization led by Clients\n    - (flexibility may be low compared with general Nostr...)\n  \n　　  \n## (General) Nostr Architecture\n\n```mermaid\n\nclassDiagram\n    RelayServerA \u003c-- ClientX : Raed/Write\n    RelayServerA \u003c-- ClientY : Raed/Write    \n    RelayServerB \u003c-- ClientX : Raed/Write\n    RelayServerB \u003c-- ClientY : Raed/Write\n    RelayServerB \u003c-- ClientZ : Raed/Write\n    RelayServerC \u003c-- ClientX : Raed/Write    \n    RelayServerC \u003c-- ClientZ : Raed/Write\n    RelayServerD \u003c-- ClientZ : Raed/Write\n    RelayServerD \u003c-- ClientY : Raed/Write\n\n    namespace Internet {\n      class RelayServerA{\n      }\n      class RelayServerB{\n      }\n      class RelayServerC{\n      }\n      class RelayServerD{\n      }\n    }\n    class ClientX{\n\n    }\n    class ClientY{\n\n    }\n    class ClientZ{\n\n    }\n```\n  \n## NostrP2P Architecture\n```mermaid\nclassDiagram\n    ServerA \u003c|--|\u003e ServerB : coodinate\n    ServerA \u003c|--|\u003e ServerC : coodinate\n    ServerA \u003c|--|\u003e ServerD : coodinate\n    ServerB \u003c|--|\u003e ServerC : coodinate\n    ServerB \u003c|--|\u003e ServerD : coodinate\n    ServerA \u003c-- ClientA : Raed/Write\n    ServerB \u003c-- ClientB : Read/Write\n    ServerC \u003c-- ClientC : Read/Write\n    ServerD \u003c-- ClientD : Read/Write(VPN)\n    namespace Internet {\n      class ServerA{\n      }\n      class ServerB{\n      }\n    }\n    namespace NW-C____________ {\n      class ServerC{\n      }\n      class ClientC{\n      }      \n    }\n    namespace NW-D______________ {\n      class ServerD{\n      }\n    }\n    namespace NW-A {\n      class ClientA{\n      }\n    }\n    namespace NW-B_________ {\n      class ClientB{\n      }\n    }\n    namespace NW-X_________ {\n      class ClientD{      \n      }\n    }\n    \n```\n\n\n# Build\n```bash\n$ go build -o nostrp2p main.go\n```\n\n# NostrP2P Command Usage\n```\nUsage:\n  nostrp2p [flags]\n  nostrp2p [command]\n\nAvailable Commands:\n  help        Help about any command.\n  server      Startup server.\n  genkey      Generate new key pair.\n\nFlags:\n  -h, --help   Help for NostrP2P\n```\n\n```\nUsage:\n  nostrp2p server [flags]\n\nFlags:\n  -h, --help                         Help for server\n  -l, --listen-addr-port    string   Address and port to bind to (default: 127.0.0.1:20000)\n  -b, --boot-peer-addr-port string   Address and port of a server which already joined NostrP2P network (optional)\n  -p, --public-key          string   Your public key (required)\n  -d, --debug               bool     If true, debug log is output to stderr (default: false)\n```\n\n\n# Specification\n- [here](/specification/SPECIFICATION.md)\n\n\n# Examples\n## Generate Key Pair\n```bash\n./nostrp2p genkey\nSecret Key:\n...\nSecret Key (In Hex Representation): \n...\nPublic Key:\n...\nPublic key (In Hex Representation): \n...\n```\n\n## Server Launch\n```bash\n# 4 servers network on local network (4 shells are needed...)\n./nostrp2p server  -l 0.0.0.0:20000 -p \u003cpublic key in npub format\u003e\n./nostrp2p server -l 0.0.0.0:20002 -p \u003cpublic key in npub format\u003e -b 127.0.0.1:20000\n./nostrp2p server -l 0.0.0.0:20004 -p \u003cpublic key in npub format\u003e -b 127.0.0.1:20002\n./nostrp2p server -l 0.0.0.0:20006 -p \u003cpublic key in npub format\u003e -b 127.0.0.1:20000\n```\n\n```bash\n# 4 servers distributed on different networks\n\n# on network ryogrid.net (bind to address/port which is accessible from The Internet)\n./nostrp2p server  -l 0.0.0.0:20000 -p \u003cpublic key in npub format\u003e\n\n# on network redsky.social (bind to address/port which accessible from The Internet)\n./nostrp2p server -l 0.0.0.0:7777 -p \u003cpublic key in npub format\u003e -b ryogrid.net:9999\n\n# on network A (bind to address/port which is NOT accessible from The Internet)\n./nostrp2p server -l 0.0.0.0:20000 -p \u003cpublic key in npub format\u003e -b ryogrid.net:8888\n\n# on network B (bind to address/port which is NOT accessible from The Internet)\n./nostrp2p server -l 0.0.0.0:20000 -p \u003cpublic key in npub format\u003e -b redsky.social:7777\n```\n\n# Bootstrap Server\n- Currently, running server which is accessible from The Internet is below\n  - ryogrid.net:8888\n    - this address including port number shoud be specified at launching of your server with -b option\n- **These servers don't response to write kind REST API requests from clients. A server for yourself is also needed to use NostrP2P!** \n\n# Client\n- [here](https://github.com/ryogrid/flustr-for-nosp2p)\n\u003cimg src=\"https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/12325/9fce752c-3d73-fa48-10ea-0770330a3b38.png\" height=\"65%\" width=\"65%\" /\u003e\n\n# Trial\n## Current Implemented Featues on Dedicated NW\n- Please refer [this article's Demo section :)](https://ryogrid.github.io/tech-entry/about-nostrp2p.html)\n\n## \u003cdel\u003eCurrent Implemented Features with Nostr Client (Not NostrP2P Client) Using a Protcol Bridge Server\u003c/del\u003e\n- \u003cdel\u003ePlease read [this](https://gist.github.com/ryogrid/5080ff36b6786902d40bb4b91de0766e#file-nostrp2p_demo_v3_procedure-md)\u003c/del\u003e\n\n# Roadmap (Server\u0026Client)\n- [x] Messaging on NAT Transparent Overlay Network\n- [x] Posting with Client\n- [x] Reaction\n- [x] Following\n- [x] Mention\n- [x] Reply\n- [x] Quote Repost\n- [x] Repost\n- [x] Server Side Signature Validation\n- [x] Restriction of Memory Usage on Server\n- [x] Data persistence on Server with embedded DB\n- [ ] Follower Multicast Mode\n  - In this mode, posted messages are not broadcasted and server of follower should register to followee's server\n  - If broadcasting design reaches limit of scalability, this mode will be activated\n- [x] Optimization of Communication Data Amount between Client and Server\n  - Changing serialization format from JSON Text to MessagePack\n    - Format conversion must be needed both side\n  - Activate data compression on HTTP layer (gzip, deflate ... etc) \n- [ ] Developing More Scalable Overlay Transport\n  - Overlay NW with Mesh library may not scale over 100 nodes roughly according to a description at [here](https://github.com/weaveworks/mesh?tab=readme-ov-file#mesh--)   \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryogrid%2Fnostrp2p","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryogrid%2Fnostrp2p","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryogrid%2Fnostrp2p/lists"}