The RAPP Programming Language Appendix A

← Chapter 11: Implementing the Language · Book contents · Appendix B: Glossary and Failure Atlas →

Appendix A — RAPP Reference Manual

Terse, normative-mirroring. Chapters 1–11 teach; this reference is what you keep open while building. Section numbers cite SPEC.md. Requirements language (MUST / MUST NOT / SHOULD / MAY) is RFC 2119 / RFC 8174.

This appendix summarizes chapters 1–11. If its wording and SPEC.md differ, the specification is authoritative.

A.1 Canonicalization (§4)

A.2 Hashing (§5)

A.3 Identity — rappid (§6)

A.4 The Frame (§7)

Exactly 11 keys: spec, kind, stream_id, seq, utc, payload, payload_hash, frame_hash, prev, prev_wave, sig.

field rule
spec MUST be "rapp/1"
kind noun.verb, lowercase labels
stream_id rappid (biography) or net:* (swarm)
seq uint53; genesis 0, then head.seq + 1
utc YYYY-MM-DDTHH:MM:SS.mmmZ (24 chars, ms, Z)
payload I-JSON object
payload_hash H("rapp/1:particle", payload) — the particle
frame_hash H("rapp/1:wave", frame∖{frame_hash,sig}) — the wave
prev previous particle, or null at genesis
prev_wave previous wave on net: past genesis; else null
sig detached JWS string (§10) or null

Build order: particle first, then wave over the frame minus {frame_hash, sig}.

Verify checklist (§7.5) — returns the failing step:

  1. shape & types (exactly 11 keys; spec; kind; seq uint53; utc fixed 24; payload object; hash fields well-formed). 1a. stream binding: stream_id == stream_of_record.
  2. particle: payload_hash == H("rapp/1:particle", payload).
  3. wave: frame_hash == H("rapp/1:wave", frame∖{frame_hash,sig}).
  4. chain: genesis ⇒ seq==0 ∧ prev==null; else seq==head.seq+1 ∧ prev==head.payload_hash ∧ utc>=head.utc.
  5. wire: swarm past genesis ⇒ prev_wave==head.frame_hash; off-swarm ⇒ prev_wave==null.
  6. signature: swarm frame MUST be signed; JWS verified per §10.

Forks & re-genesis (§7.6): forks resolved by stream authority, losing branch sealed. Re-genesis: terminal *.re-genesis frame with H("rapp/1:seal",…) over old head → new genesis in current form citing the sealed head → old frames retained under legacy/ (sealed, never served).

A.5 The Wire (§8)

A.6 The Egg (§9)

A.7 Signatures (§10)

A.8 Conformance & Versioning (§11–§13)

A.9 The Reference Implementation

rapp.py (stdlib only) implements A.1–A.4: canonical, H/Hb, mint_rappid/rappid_valid, build_frame/verify_frame. conformance.py runs V1–V9. realcheck.py runs the whole thing against the live estate. Read rapp.py — it is ~140 lines and it is the spec made executable.

A.10 Normative References

RFC 2119/8174 (requirements) · RFC 8785 (JCS) · RFC 8259/7493 (JSON/I-JSON) · FIPS 180-4 (SHA-256) · RFC 3986 (URI) · RFC 9562 (UUID) · RFC 5280 (X.509 SPKI) · RFC 7515/7797/8037/7518/6979 (JWS/signatures) · RFC 7405 (case-sensitive ABNF).


← Chapter 11: Implementing the Language · Book contents · Appendix B: Glossary and Failure Atlas →