1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# zat
> zat is a zig library of AT Protocol building blocks: parsing and validation
> for atproto identifiers, DID and handle resolution, DAG-CBOR / CAR / MST repo
> primitives, STAR archives, did:plc operations, commit signing and
> verification, XRPC, service auth, JWT and OAuth, firehose / jetstream
> streaming, and the wire primitives of permissioned spaces. It targets zig
> 0.17+ (0.16: use v0.5.x).
## Project contracts
- [Homepage](https://zat.dev)
- [Examples](https://zat.dev/docs/examples/index.md)
- [Changelog](https://zat.dev/docs/changelog.md)
- [Source repository](https://tangled.org/zat.dev/zat)
- [AT Protocol specs](https://atproto.com/specs)
## Built with zat
- [zds](https://tangled.org/zat.dev/zds) — an AT Protocol personal data server, built on zat.
- [zlay](https://tangled.org/zat.dev/zlay) — an AT Protocol relay, built on zat: subscribes to every PDS on the network, verifies commit signatures, and serves the merged event stream.
## Install
- Run `zig fetch --save https://tangled.org/zat.dev/zat/archive/main`, then add
the `zat` module in your `build.zig`.
## Agent guidance
- The public API is whatever `src/root.zig` exports; everything under
`src/internal/` is implementation. Import symbols through the `zat` module.
- Runnable, compile-checked recipes live in `examples/` — each is a
`zig build example-<name>` step. Start there for real usage patterns.
- Identifier types (`AtUri`, `Did`, `Handle`, `Nsid`, `Rkey`, `Tid`) parse to
`?T` and borrow their input: validate at the boundary, keep the input alive.
- Network APIs take an explicit `std.Io` handle.
- For Zig language semantics, reach for zigman: https://nate.tngl.io/zigman/
## Source docs
- `README.md` documents the overview and per-area snippets (the site homepage).
- `examples/` holds the runnable recipes, each a paired `.zig` and `.md`.
- `CHANGELOG.md` documents the per-version history.