Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions content/ecosystem.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ A native NIP-46 signer for macOS: Zig, no Electron, no WebView. Your key lives i
a local daemon, nothing gets signed quietly, and your `nsec` never leaves it.
→ [`zig-nostr/notary`](https://github.com/zig-nostr/notary) · [read more](/signer)

### Plaza: in progress
### Plaza: shipped

The flagship client: browse and post within two minutes, with the feed rendered
from disk and reconciled in the background. Your key lives in Notary, a separate
Expand All @@ -37,11 +37,12 @@ process, or in your own signer.

### On the roadmap

- **A private messenger**: NIP-17 gift-wrapped DMs, signing through Notary.
- **A document app**: Nostr-native notes and long-form (NIP-23).
- **More NIPs, payments, and platforms**: the ecosystem expands across desktop and mobile.
Both apps are downloadable and both keep growing. What comes next lands inside
them rather than as new apps: private messages, zaps and a wallet, groups, search
and media all belong to the client people already have.

See the [roadmap](/roadmap) for the full sequence.
See the [roadmap](/roadmap) for the order, and for what is deliberately not being
built.

---

Expand Down
4 changes: 2 additions & 2 deletions content/getting-started.mdx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Getting Started

`zig-nostr` is a Nostr protocol library for [Zig](https://ziglang.org). It
targets Zig **0.16** and is **pre-alpha** (`v0.3.5`).
targets Zig **0.16** and is **early** (`v0.3.8`).

## Install

Fetch the library into your project's `build.zig.zon`:

```sh
zig fetch --save https://github.com/zig-nostr/nostr/archive/refs/tags/v0.3.5.tar.gz
zig fetch --save https://github.com/zig-nostr/nostr/archive/refs/tags/v0.3.8.tar.gz
```

Then wire the module in `build.zig`:
Expand Down
18 changes: 9 additions & 9 deletions content/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ title: The Nostr protocol, natively in Zig
<div className="zn-card">
<div className="zn-icon">🖥️</div>
<h3>Native apps</h3>
<p><a href="/signer">Notary</a> ships today, <a href="/plaza">Plaza</a> is the flagship client in progress, and a messenger and more are on the way across desktop and mobile. Real products, all on one core.</p>
<p><a href="/signer">Notary</a> and <a href="/plaza">Plaza</a> both ship today: a remote signer and a local-first client you can download and use. Private messages, zaps and groups land inside them. Real products, all on one core.</p>
</div>
</div>

Expand Down Expand Up @@ -93,21 +93,21 @@ title: The Nostr protocol, natively in Zig
<div className="zn-card">
<div className="zn-app-head">
<h3>Plaza</h3>
<span className="zn-tag zn-tag-building">Building</span>
<span className="zn-tag zn-tag-shipped">Shipped</span>
</div>
<p>A fast, local-first client: browse and post within two minutes, with the feed rendered from disk.</p>
<p>A fast, local-first client: browse and post within two minutes, with the feed rendered from disk. A downloadable macOS app.</p>
<a className="zn-applink" href="/plaza">Learn more →</a>
</div>
<div className="zn-card">
<div className="zn-app-head">
<h3>Messenger</h3>
<h3>Private messages</h3>
<span className="zn-tag">Planned</span>
</div>
<p>A private DM app: NIP-17 gift-wrapped messages, signing through Notary, rendering instantly from the local store.</p>
<p>NIP-17 gift-wrapped DMs on the local store, signing through Notary. A milestone inside Plaza rather than a separate app: a messenger you have to switch to is one you stop using.</p>
</div>
</div>

<p className="zn-more">More native apps, and more platforms, desktop and mobile, are on the <a href="/roadmap">roadmap</a>.</p>
<p className="zn-more">What comes next, and what is deliberately not being built, is on the <a href="/roadmap">roadmap</a>.</p>

<h2 className="zn-section-title">Install the core</h2>

Expand All @@ -116,15 +116,15 @@ title: The Nostr protocol, natively in Zig
</p>

```sh
zig fetch --save https://github.com/zig-nostr/nostr/archive/refs/tags/v0.3.5.tar.gz
zig fetch --save https://github.com/zig-nostr/nostr/archive/refs/tags/v0.3.8.tar.gz
```

```zig
const nostr = b.dependency("nostr", .{ .target = target, .optimize = optimize });
your_module.addImport("nostr", nostr.module("nostr"));
```

zig-nostr is **pre-alpha** and MIT-licensed, a library plus native showcases,
all on one core. [Explore the docs →](/getting-started)
zig-nostr is **early** and MIT-licensed: a library, plus two native apps you can
download today, all on one core. [Explore the docs →](/getting-started)

</div>
26 changes: 21 additions & 5 deletions content/nips.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,25 @@ official specification vectors.
| [46](https://github.com/nostr-protocol/nips/blob/master/46.md) | Nostr Connect, remote signing | ✅ done |
| [49](https://github.com/nostr-protocol/nips/blob/master/49.md) | Private key encryption (`ncryptsec`) | ✅ done |
| [65](https://github.com/nostr-protocol/nips/blob/master/65.md) | Relay list metadata (outbox) | ✅ done |
| [17](https://github.com/nostr-protocol/nips/blob/master/17.md) | Private direct messages | 🚧 planned (A6) |
| [59](https://github.com/nostr-protocol/nips/blob/master/59.md) | Gift wrap | 🚧 planned (A6) |
| [10](https://github.com/nostr-protocol/nips/blob/master/10.md) | Reply threading | 🚧 planned (A7) |
| [17](https://github.com/nostr-protocol/nips/blob/master/17.md) | Private direct messages | 🚧 planned |
| [59](https://github.com/nostr-protocol/nips/blob/master/59.md) | Gift wrap | 🚧 planned |

The planned NIPs land with the [showcase apps](/roadmap): a NIP-17 private
messenger (A6) and a read-only outbox client (A7).
Private messages and gift wrap land together, in [Plaza's private messages
milestone](/roadmap).

## In the apps

The library gives an app the protocol. These are implemented above it, in
[Plaza](/plaza), and are listed separately because they are client behaviour
rather than library surface.

| NIP | Title | Where |
|----|----|----|
| [02](https://github.com/nostr-protocol/nips/blob/master/02.md) | Contact lists | reading and writing your follows |
| [05](https://github.com/nostr-protocol/nips/blob/master/05.md) | DNS identifiers | the verified handle on a profile |
| [10](https://github.com/nostr-protocol/nips/blob/master/10.md) | Reply threading | threads, and replies you post |
| [25](https://github.com/nostr-protocol/nips/blob/master/25.md) | Reactions | likes, in the feed and notifications |
| [27](https://github.com/nostr-protocol/nips/blob/master/27.md) | `nostr:` mentions in content | names instead of raw base32 |
| [89](https://github.com/nostr-protocol/nips/blob/master/89.md) | Application handlers | the `client` tag on notes you post |
| [92](https://github.com/nostr-protocol/nips/blob/master/92.md) | Media attachments | `imeta` dimensions, so an image reserves its box before it loads |
| [57](https://github.com/nostr-protocol/nips/blob/master/57.md) | Zaps | receipts are read and shown. Sending is a milestone away |
13 changes: 8 additions & 5 deletions content/performance.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@ Measured on an Apple Silicon Mac, `ReleaseFast`, warm cache, best of 50 runs.
Events are spread across 100 authors; the feed query is a 20-author, `kind:1`
home timeline returning 500 notes.

| Store size | Feed query (500 notes) | Profile query | Ingest |
|----|----|----|----|
| 20,000 events | 0.26 ms | 0.09 ms | ~135k events/s |
| 100,000 events | 0.28 ms | 0.25 ms | ~135k events/s |
| Store size | Feed query (500 notes) | Timeline query (1 author) | Profile query | Ingest |
|----|----|----|----|----|
| 20,000 events | 0.25 ms | 0.09 ms | 0.007 ms | ~170k events/s |
| 100,000 events | 0.28 ms | 0.24 ms | 0.008 ms | ~149k events/s |

The headline isn't just that a feed query takes **~0.28 ms**: it's that going
from 20k to 100k stored events barely moves it. That's the **bounded query
from 20k to 100k stored events barely moves it. The profile query makes the same
point sharply: fetching one account's `kind:0` out of a hundred thousand events
reads a single index entry, so it costs **8 microseconds** and does not care how
much history sits behind it. That's the **bounded query
planner**: it walks the indexes newest-first and stops at `limit`, so latency
tracks the page size you ask for, not the size of the store.

Expand Down
31 changes: 13 additions & 18 deletions content/plaza.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -114,30 +114,25 @@ See [performance](/performance) for the library numbers underneath.

## Getting it

Plaza is not tagged for download yet. Build it from source today:

```sh
git clone https://github.com/zig-nostr/plaza
cd plaza
npm install -g @native-sdk/cli
native build . # a ReleaseFast binary in zig-out/bin/
scripts/package-macos.sh # or the same artifact as Plaza.app
curl -fsSL https://raw.githubusercontent.com/zig-nostr/plaza/main/scripts/install-macos.sh | bash
```

macOS on Apple Silicon. A one-line installer lands with the first tagged
release.
macOS on Apple Silicon. The installer verifies the download's SHA-256, installs
`Plaza.app`, clears the download-quarantine flag so it opens without a Gatekeeper
detour, and launches it. Your key, session and local store live in `~/.plaza` and
survive every upgrade.

Plaza is ad-hoc signed and not notarized on purpose. It signs notes with your
key, so the trust anchor is a build you can reproduce rather than an Apple
signature you cannot inspect.

Linux builds and tests in CI on every change. Windows is not in the matrix yet:
the relay transport resolves hostnames through libc `getaddrinfo`, which Zig's
standard library does not declare for Windows, so nothing depending on the
library links there. That is a gap in the protocol library rather than in Plaza.
Packaged releases for either come later anyway: the toolkit renders through a
software rasteriser off macOS today, and shipping one now would misrepresent how
Plaza performs.
signature you cannot inspect. Read the
[installer](https://github.com/zig-nostr/plaza/blob/main/scripts/install-macos.sh),
or build the same artifact yourself:

```sh
git clone https://github.com/zig-nostr/plaza
cd plaza && scripts/package-macos.sh
```

## Built on the core

Expand Down
Loading