# AGENTS.md — entry point for AI agents and security researchers
This document is the canonical entry point for any AI agent or human researcher who wants to deploy a Montana node, stress-test it, audit the code, and report findings. Read top-to-bottom; commands are copy-paste ready.
## What Montana is, in 60 seconds
Montana is a from-scratch post-quantum blockchain. Three architectural primitives:
1.**VDF-based TimeChain** — globally-ordered windows of ~60 seconds each, sealed by a sequential SHA-256 chain (D = 325 000 000 iterations per window). Cannot be parallelized, cannot be skipped. This is the consensus clock.
2.**Time-as-scarcity** — anti-spam through window-rate-limits, chain_length thresholds, seniority gating. No transaction fees. No gas. Cannot accelerate operations by paying.
3.**Post-quantum from primitives up** — ML-DSA-65 (FIPS 204) for signatures, ML-KEM-768 (FIPS 203) for key exchange, SHA-256 for hashing and VDF, PBKDF2 for key derivation. No ECDSA, no RSA, no curve25519, no secp256k1.
**Pre-mainnet v0.1.** No mainnet date. No token launch. No premine. The implementation is M1-M6 + M9 ready for external audit; M8 (node binary) has 9 documented spec deviations (see [`docs/SPEC_DEVIATIONS.md`](docs/SPEC_DEVIATIONS.md)) operating in M5-singleton mode (one node, no network layer yet).
Singleton means: each deployed node is its own genesis bootstrap, ticking VDF locally, writing its own state. Until M6 network layer is wired into the binary (M6 transport crate is ready, integration into node binary is in progress), nodes do not talk to each other.
This is intentional for v0.1 — it lets you deploy and break a Montana node end-to-end **without** needing a network of peers.
---
## Deploy
### One command on a clean Linux VPS (Ubuntu 24.04 / Debian 12 / Fedora / Alpine)
3. Builds `montana-node` from source (`cargo build --release -p montana-node`)
4. Creates system user `montana` and `/var/lib/montana`
5.**Generates 24-word recovery mnemonic and prints it once** — save it immediately, no second chance
6. Installs systemd unit with hardening (`User=montana`, `NoNewPrivileges`, `ProtectSystem=strict`)
7. Starts `montana-node.service`
8. Installs xray Reality VPN endpoint as a separate systemd service (optional, runs alongside the node — see [`montana-vpn/README.md`](montana-vpn/README.md))
After install:
```bash
systemctl status montana-node # is it running
journalctl -u montana-node -f # live logs (one line per ~60s window)
montana-node status --data-dir /var/lib/montana # phase, balance, current_window
-`state_root` after each apply_proposal byte-equals the expected recompute (logged at INFO level)
Pathological signs (file an Issue):
- Phase regresses (Active → Bootstrap)
-`current_window` stops advancing for >2 minutes
-`state_root` mismatch in logs
- Process panics or OOMs
- Disk usage grows >10 MiB per hour (it should be ~50 KiB per hour)
---
## Stress test — what to throw at it
We have not stress-tested at scale. Here is what would help:
### 1. VDF correctness under chaos
Kill the node mid-window and restart. State must resume from the last cemented window without divergence. Repeat 100×, automate with `kill -9` + immediate `systemctl start`.
Expected: no behavior change. Wall-time is not consensus-critical.
### 4. Determinism — two nodes, same mnemonic, same state_root
Critical. If two independent installs of the same `git rev` with the same seed mnemonic produce different `state_root` after N windows — that is a consensus-fork bug.
- [ ] Audit of the crowdsec / fail2ban / ufw default rules for the VPS installer
- [ ] Independent translation of the spec (currently RU primary, EN fragments)
---
## What we will NOT do
- We will **not** sell tokens. Not now, not at mainnet. Montana has no premine, no presale, no airdrop schedule. Block reward (13 Ɉ per window to operator) is the only emission, paid to whoever ran the VDF for that window.
- We will **not** add fees. Anti-spam is time-based by architectural invariant `[I-15]` of the spec.
- We will **not** add ECDSA / RSA / curve25519 fallback. Post-quantum from day one is invariant `[I-1]`.
- We will **not** add KYC, allowlist, or compliance backdoors. Privacy-by-default is invariant `[privacy-default]`.