# XΦ Genesis v0.0.1
**XVAITA Phi — Ex Entropia, Valor.**

A local experimental cryptocurrency application for the XVNANDI workstation. It implements real SHA-256 proof-of-work, browser-generated Ed25519 wallet keys, signed transfers, a block explorer and a persistent, locally verified ledger. All coins are experimental and have no monetary value. This is not a decentralized public network, exchange, investment product or implementation of the entropy currency hypothesis.

## Start on Pop!_OS / Linux

1. Extract the ZIP into a folder. Open a terminal in that folder (the folder containing `server.py`).
2. Install Python 3.10+ and its venv package if not already available (on Ubuntu/Pop!_OS: `sudo apt install python3 python3-venv`).
3. Run `bash start-linux.sh`. The script creates a virtual environment, downloads the Python dependency and starts the local server. Internet access is needed for initial dependency installation.
4. Open `http://localhost:8765` in an up-to-date Chrome, Chromium, Edge or Firefox browser supporting WebCrypto Ed25519. Leave the terminal running. Stop with Ctrl+C.

## Start on Windows 11

Install Python 3.10+ with the Python launcher from https://www.python.org/downloads/ if needed. Extract the ZIP, then double-click `start-windows.bat`. Open `http://localhost:8765` in a compatible browser. Keep the console open. This Windows launcher is supplied but has not been tested on Windows.

## Try your first transaction

1. Click **Create wallet** and **Mine one block**. Wait until the block is accepted. Your balance becomes 100 XΦ.
2. Create wallet 2 and copy its public address.
3. Switch to wallet 1, paste wallet 2's address, enter 25, then click **Sign & submit transfer**.
4. Switch to wallet 2 and mine another block. The transfer is now confirmed. Wallet 1 should have 75 XΦ and wallet 2 should have 125 XΦ (25 transferred plus 100 mined).
5. Inspect the two blocks in the explorer. Export each test wallet backup if you need to preserve it.

The server saves the ledger in `data/ledger.json`; the browser saves wallet keys in local storage. Backups are unencrypted and must be treated as sensitive. Never use these keys for real assets. Use only disposable test wallets. Clearing browser data can erase keys. Use the same localhost URL each time; browser storage is origin-specific. To start a new experiment, stop the server and move the ledger file to a backup location before restarting. Existing browser wallet keys do not themselves restore balances on a new ledger.

## Technical implementation

- Network identifier `XPHI-GENESIS-LOCAL-1`; first block follows an all-zero previous hash; zero initial coins.
- Actual SHA-256 proof of work: the browser worker searches for a header hash with three leading hexadecimal zeroes. The server verifies the proof and transaction signatures. This fixed low difficulty intentionally makes blocks quick; there is no 60-second target or difficulty adjustment.
- Browser-generated Ed25519 keypairs; public address is the raw 32-byte public key as hex. The private key signs a network-specific message; the server never receives it. Public keys and all transfers are visible in the ledger.
- Whole test coins only. 100 per initial block; reward halves every five million blocks, rounding down to whole coins, and becomes zero after seven halvings. The theoretical total is 985 million whole test coins, below the proposed one-billion ceiling. The future eight-decimal schedule is not implemented.
- Pending transfers reserve funds; transactions are checked in order, with sender nonces preventing replay. Pending incoming funds may be spent in later ordered pending transfers; confirmation requires a block. No fees, block maturity, fork-choice rule or peer synchronization.
- Local threaded Python server, JSON persistence and replay verification, browser JavaScript and WebCrypto. Replay is intentionally simple and will not scale to a large ledger. The server is authoritative and can be modified by its operator; hash chaining is not a substitute for distributed consensus.
- Network access is intentionally restricted to loopback and same-origin local requests. Do not expose the server or XVNANDI's personal files, storage or administrative services to the internet. No TLS, peer-to-peer network, public deployment, GPU support, actual entropy measurement, RandomX or useful-work consensus yet.

## Tests

Run from the project directory after installing requirements:

```sh
python -m unittest discover -s tests -v
```

Four backend tests passed in the development environment: mining/transfer persistence, invalid signatures/overspending/replay, invalid and stale proof, reward schedule. The actual JavaScript mining worker and WebCrypto wallet signing were also tested against a live HTTP server using Node.js 22, with successful balances of 75 and 125 XΦ. To repeat, start a **fresh disposable** server using `python server.py --data /tmp/xphi-smoke.json --port 8765` (choose a new temporary path if it already exists), then run `node tests/client_smoke.mjs` in another terminal. The browser UI end-to-end test was blocked by the development environment's browser navigation policy; browser UI, Windows, Pop!_OS and actual XVNANDI have not been independently tested. No formal security audit has been performed.

## Before a public launch

1. Test the app on XVNANDI and independent computers with multiple browsers.
2. Choose and review an open-source license and established peer-to-peer blockchain codebase; implement consensus, fork handling, sync, independent nodes, difficulty and precision.
3. Move public infrastructure to isolated servers; use signed releases, HTTPS, secure wallet storage, abuse protection and independent security review.
4. Introduce calibrated energy and entropy observations as research telemetry, not monetary proof. RandomX and proof of useful work are future milestones.
5. Publish a public testnet with valueless coins if verification and security milestones pass. Real-value commerce, redemption and trading require further review, security and legal/accounting analysis. Do not market this prototype as an investment.
