# NÝR — protocol notes (test reference)

NÝR is an ownerless neighborhood-favor coin. The **Rust** binary (`nyr/`)
is node + chain + terminal wallet. PHP remains the web explorer on the
same SQLite. Home network first.

## Chain file (canonical)

One append-only file, downloaded like Monero's chain. No SQLite in consensus.

Path: `/var/www/blockchain-data/nyr.chain` (env `NYR_CHAIN_PATH`).

```
magic     "NYR\x01"          4 bytes
repeat:
  body_len  u32 le
  body
  checksum  blake2b-256(body)  32 bytes
```

Block body: 106-byte header (height, time, prev, merkle, nonce, difficulty,
protocol, network) + u16 tx count + packed txs. Hashes and keys are **raw
32/16 bytes**, ciphertext raw, little-endian. No JSON, no hex on disk.

Genesis is deterministic: timestamp 0, difficulty 0, nonce 0, three English
preamble txs. Same file on every node.

Operator state (reward address, work clock, mempool) sits beside it in
`nyr.node` — not downloaded.

## Ports

| Port | Role | Monero analog |
|------|------|----------------|
| **19191** | P2P + local submit (`GET /status`, `POST /tx`) | 18080 / 18081 |
| 19192 | reserved RPC | 18081 |

19191 = easy to remember (NÝR-ish), unused by Bitcoin/Monero/ETH.

## Issuance

NÝR is time. A running node accrues seconds (cap **86 400 per 24h window**).
Once per 24 hours it **drops** into the reward wallet:

- work: `min(seconds, 86400) × 0,00001 NÝR`  → max **0,86400 NÝR/day**
- plus **0,00001 NÝR per transfer this node validated** (included in a block)

One work transaction per drop — not per second.

Unbounded supply. No named issuer. No premine.

**Home-net honesty:** this node trusts its own clock (max 2s per beat,
gaps > 30s are a restart). Two-node attestation of work comes when the
second machine is on the table.

## Units

- Display: NÝR, **5 decimal places**, no name for the crumb.
- Internal: 1 NÝR = 100_000 units.
- Social peg: 1 NÝR ≙ one loaf of bread. Not an oracle.

## Addresses and seed

- 13 words from a bundled **2048-word Latin** list (128-bit entropy + 15-bit SHA-256 checksum).
- Same library ships with every node and wallet. Changing it forks seeds.
- Argon2id → X25519 view key + Ed25519 spend/auth.
- Address: `nyr1` + Crockford Base32(view_pk || 2-byte checksum). Sender only needs the view key.

## Privacy (v1)

Transfers store spent note id, nullifier, stealth tag, ephemeral pub,
one-time auth_pk, and **ciphertext** of `{amount, memo, auth_sk}`.
Explorer/API never return amount or memo.

**Gaps (unchanged):** no range proofs yet; X25519/Ed25519 are not PQ.
Envelope `v` is reserved for hybrid ML-KEM + ML-DSA.

## NFT (later)

Image + memo + value. Nothing else in v1.

## HEX (later)

An exchange, if NÝR is ever swapped for a currency. Not a token, not hardware.

## Roadmap

1. Second home node + work attestation
2. P2P gossip
3. Range proofs / confidential sums
4. Hybrid PQ
5. Desktop GUI, then Flutter (wallet + NFT)
6. Onion
7. Exchange ("HEX") if the community wants a window out
