Files
wikideck/README.md
T
2026-10-28 17:09:58 -04:00

18 KiB
Raw Blame History

Wikideck

Wikideck is an experimental blockchain game about mining, collecting, and trading illustrated Wikipedia cards. Mine a block with the native RandomX CPU miner to earn a card, build a collection in a local wallet, and trade cards directly with another player. The default app has no marketplace, prices, or checkout.

Mining uses RandomX, the proof-of-work algorithm also used by Monero, designed to keep general-purpose consumer CPUs competitive. Wikideck is an independent blockchain, not part of Monero or its mining/security network. Hardware, total network hashpower and difficulty determine results; no particular mining reward rate or profitability is guaranteed.

This is a local test network, not a public mainnet or an investment product. No public bootnodes or hosted network are provided. Test NFTs have no promised value. Do not use funds or valuable assets. This project is not affiliated with Wikipedia or the Wikimedia Foundation.

Mine, collect, and trade cards

  • Mine Wikipedia cards. Each accepted block mints a native NFT for the miner from a random illustrated English Wikipedia article. The card records the article snapshot and mint-time statistics. The same page can appear on more than one distinct card. The reward is a card representing a page—not ownership of the page, its copyright, or a payment to Wikipedia.
  • Build collections. Browse chain discoveries or focus on a subject, series, or theme. Cards are controlled by your encrypted local wallet.
  • Trade directly. Look up another public wallet and exchange up to eight cards on each side in one signed, atomic trade. Offers are shared between the two players; the app does not list cards for sale or process payments.
  • Gameplay is not included yet. The current release supports mining, collecting, transfers, and direct trades. Playable card games are future work.

Optional legacy market modules

Market and custody code remains in the repository for separate experiments, but it is not part of the default card-trading experience. The server does not open a market journal, expose market APIs, or run its reconciliation worker unless WIKIDECK_MARKET_RUNTIME_ENABLED=1 is explicitly set. Enabling it is an operator decision; market orders are local to the node, checkout is simulated, and no real XMR is accepted or sent. See the market implementation notes and security boundaries before enabling it. Existing market data is not deleted when the feature is off, but disabling an existing market pauses order resolution; review outstanding orders before switching modes.

Licensing status: this checkout does not yet contain a project LICENSE file. Source availability alone does not grant open-source modification/redistribution rights. Wikipedia text/images and dependencies retain their separate licenses.

What's available now

Available in the testnet Not included in the default experience
RandomX mining and illustrated Wikipedia card rewards Marketplace listings, auctions, and checkout
Encrypted local wallets, collections, transfers, and atomic card trades Real cryptocurrency payments or custody
Local single-node or optional three-node testnet Playable card games and production network launch

Quick start: one local node (Docker)

Install Docker Desktop with Linux containers and Docker Compose v2. From the repository root:

docker compose up --build -d
docker compose ps

Open http://127.0.0.1:3001. The first run builds the node and native RandomX engine. The node does not mine automatically. Open the wallet panel to create a local wallet and encrypted backup, then follow Mine Wikipedia cards with RandomX to run the miner. The default stack leaves marketplace startup and APIs disabled. Stop the node with docker compose down; the ledger volume remains. Do not add -v unless you intend to delete that data.

Optional: three-node testnet (Docker)

Install Docker Desktop with Linux containers and Docker Compose v2. From the repository root, start three connected nodes:

docker compose -f compose.testnet.yaml up --build -d
docker compose -f compose.testnet.yaml ps
docker compose -f compose.testnet.yaml logs -f node-a

Open http://127.0.0.1:3101. The other nodes are at http://127.0.0.1:3102 and http://127.0.0.1:3103. Each node validates blocks independently and stores its ledger in a separate Docker volume. Marketplace runtime is disabled by default; mining does not start automatically. A healthy node is not necessarily connected to its peers; check the peer status in the interface or request /api/peers. Nodes need outbound access to Wikipedia when generating mining templates and capturing mint-time statistics. If that data is unavailable, the node returns an error and mining can be retried.

Stop the nodes with:

docker compose -f compose.testnet.yaml down

The target block interval is 15 minutes. The volumes persist across stops and rebuilds. Do not add -v unless you intend to delete all three ledgers. Back up wallets separately. Protocol v6 adds atomic multi-card trades and a new chain identity; earlier v2–v5 ledgers and encrypted backups are not compatible. To keep old Docker data intact while trying v6, use a separate Compose project name, for example docker compose -p wikideck-v6 -f compose.testnet.yaml up --build -d, and use the same -p wikideck-v6 for subsequent Compose commands. The default docker compose up --build -d uses compose.yaml: it starts one isolated node on port 3001 with a different volume.

For an existing host install, keep the old data directory intact and set WIKIDECK_DATA_DIR to a new empty directory before starting protocol v6. The node intentionally fails closed on an old-protocol ledger; it does not reset or migrate it. A v6 JSON ledger is imported into SQLite on first startup and left in place as a recovery copy.

Run on your host

The legacy market can be explicitly enabled with WIKIDECK_MARKET_RUNTIME_ENABLED=1; do not enable it for a node that has unresolved orders without reviewing its local journal first. When disabled, the market journal is left untouched, but the node does not reconcile it or expose market APIs. The separate custody and Monero experiments require dedicated configurations and are not needed to mine or trade cards. Their deployment instructions remain in the docs/ directory, but are outside the supported quick-start path.

Requirements: Node.js 24, npm, Git, CMake 3.24+, and a C/C++17 toolchain. The first native-engine configuration downloads the pinned RandomX source over HTTPS. On Windows, install a compatible toolchain (for example, MinGW-w64 and make) and use the matching CMake generator. Do not change generators in an existing native/build directory; use a fresh build directory when switching toolchains.

Install dependencies and build the native RandomX engine:

npm install
npm run native:configure
npm run native:build
npm run test:native
npm run build
npm start

On Windows with MinGW, configure with npm run native:configure -- -G "MinGW Makefiles". If PowerShell blocks the npm shim, use npm.cmd; follow your organization's execution policy rather than bypassing it. The optional platform scripts are scripts/build-randomx.ps1 and scripts/build-randomx.sh. See native engine setup and protocol for toolchain details.

The node listens at http://127.0.0.1:3001 by default. For development, npm run dev starts the API on port 3001 and Vite on http://127.0.0.1:5173. Keep both services on loopback; Vite proxies the browser's /api requests to the API. The native miner should connect directly to the API port, not Vite.

Wallets and backups

Open the wallet panel to explicitly create an encrypted local P-256 wallet, unlock an existing vault, or encrypt a legacy plaintext wallet without changing its identity. Nothing is silently generated or unlocked at startup. Choose a strong local password of at least 12 characters. Wallet backup & recovery downloads a separately password-encrypted portable backup; keep the file outside the repository and its password separately, and test recovery in another browser profile.

New/migrated local vaults encrypt the key in IndexedDB; the unlocked key remains exportable in tab memory for signing and backup. Manual locking, five-minute inactivity, a four-hour absolute lifetime, reload, or hiding/leaving the tab ends the session. Same-origin compromise can still capture passwords or abuse an unlocked signer. Forgotten local passwords cannot be reset: recover from a usable backup. Legacy disk copies may retain old plaintext keys even after migration. Wallets are scoped to an origin (scheme, hostname, and port), so a backup must be restored at another origin to use the same identity there. Recovery does not move assets between chains. See encrypted wallet lifecycle and remaining risks.

The current testnet wallet is separate from any wallet used by an older demo. There is no automatic migration. See consensus, wallets, and operational limits and the in-app backup warnings for more detail.

Mine Wikipedia cards with RandomX

Mining uses the native CPU RandomX engine. First build the engine, download an encrypted wallet backup, then run the CLI from an interactive terminal and enter the password at its hidden prompt:

npm run miner -- --wallet "path/to/encrypted-backup.json" --consent --node http://127.0.0.1:3101 --blocks 3

Use port 3001 for the default single host/Docker node, or 3101–3103 for the three-node Docker testnet. The command above uses node-a. The miner defaults to one worker, light mode, and one block; --blocks 3 requests up to three accepted blocks. Press Ctrl+C to stop it. Do not put the backup password in a command, environment variable, or repository file. The backup and password are decrypted locally and are not sent to the node.

Each template request asks English Wikipedia for up to ten random pages and retries at most three times to find one with an image and readable extract. The same page may be selected again. The node also captures page size, language-link count, revision, pageviews, and derived scores for the mint-time snapshot. If Wikipedia cannot supply the article or its metadata, template creation returns an error; there is no fixed-article fallback. Validators check and commit the included snapshot without contacting Wikipedia during consensus validation.

Light mode needs a 256 MiB cache plus scratchpad and process overhead. --fast is optional and needs over 2.3 GiB per miner process. Mining consumes CPU, power, and time; RandomX is not a guarantee of ASIC resistance. Do not expose an HTTP miner endpoint remotely; use HTTPS. Detailed resource, native build, and line-protocol notes are in docs/randomx-native.md.

What the app shows

  • Discover shows preview examples until the node has mined blocks; previews are not owned NFTs. Minted cards can reference the same page, but each carries its own captured stats snapshot.
  • My collection shows NFTs owned by the active local wallet on the connected node's canonical chain.
  • Block explorer distinguishes block IDs, NFT token IDs, and RandomX proof hashes. A submitted transfer is pending until a block confirms it. Reorganizations can change canonical ownership and confirmations.
  • Trade decks lets you look up another public wallet by receive address, select up to eight cards on each side, prepare a signed offer, and accept another player's offer. Offers are shared as JSON for the other player to review; they are not submitted until accepted. The two parties sign the same card list, and validators apply the whole bundle atomically or reject it entirely. Offers are not reservations: before acceptance the app re-checks ownership, maturity, sequences, and pending activity; stale offers must be recreated.
  • Each minted card shows current Wikipedia statistics alongside its immutable at-mint snapshot: pageviews, article size, language links, revision, and derived scores. Current values may change; at-mint values are committed to the block. Missing pageview data stays unavailable, not zero.
  • The appearance selector offers Catppuccin Mocha, Macchiato, Frappé, and Latte themes.

The browser interface trusts the connected node's reported state. It does not independently verify the chain or provide an SPV client. Transfers are irreversible once confirmed; check the recipient address carefully.

Mainnet candidate · launch gated

Production status: NO-GO pending remediation and independent review. See the security review and operator launch checklist. A read-only launch:preflight script reports blockers and local gate status without launching or granting approval.

A separate mainnet profile has its own network/genesis identity, ledger and market directories, browser wallet, backup checks, and opt-in Compose definition. It preserves the existing testnet chain and does not migrate testnet cards. No production network has been launched or certified by this work. Startup requires explicit chain-specific approval, an operator review attestation, the candidate genesis time, HTTPS origins and multiple configured peers. Real payments remain blocked even then. See the candidate launch gates and production checklist.

Tests and development checks

Offline preparation tools: analyze:consensus reports deterministic retarget/timestamp scenarios; benchmark:randomx runs a bounded native benchmark only with explicit --consent. Neither launches a node nor changes consensus or approval settings. See calibration evidence and limitations before interpreting rates or illustrative targets.

npm test
npm run build
npm run test:native

npm test runs the application test suite, including fast test-only proof tests. npm run test:native runs the real upstream RandomX known-vector test and requires a native build configured with tests enabled; the documented npm run native:configure command enables them. The Docker build also builds RandomX and runs its native test.

The Dockerfile also provides a test target containing Node 24, development dependencies, the tests, and the compiled Linux-native RandomX binary. Build that target and run the resulting image to exercise the full native HTTP suite without relying on a host-platform binary. TypeScript compilation enforces erasable syntax because the production runtime strips types directly.

To explicitly test propagation and transfer behavior across the three local Docker nodes, first build the host native engine and start the three-node testnet, then run:

node --experimental-strip-types scripts/testnet-smoke.ts --consent

This mines three real blocks using disposable identities. It changes the testnet, and is not run automatically.

Network and safety limits

Live XMR payments are not implemented. The selected custody design uses direct Monero wallet/daemon observation and a pooled liability ledger; no real deposits, credits, withdrawals, or sale settlement are enabled. See the custodial market design and launch hold points.

Deployment and recovery preparation includes explicit trusted-proxy configuration, opt-in loopback-only diagnostics and ops:check, plus stopped-node paired node:backup create/verify/new-directory restore tooling. Backups contain sensitive market data and require external encryption/access control. Tools do not configure TLS/alerts or authorize production launch/restore.

Stage-1 node resource controls bound global RPC admission, response bytes and canonical page sizes. The UI reuses paged history; legacy full-state responses stop beyond 128 blocks. A consent-gated loopback-only smoke-load script is available as test:rpc-load. This does not resolve long-chain/DAG storage limits or establish production capacity.

Nodes use only explicitly configured peers; there is no discovery service or public bootstrap network. The peer, storage, and HTTP configuration is documented in docs/testnet-consensus.md. The implementation is experimental: it has no consensus transaction fees or established economic security (market fees are off-chain simulations), and remains vulnerable to resource exhaustion, isolation/eclipsing, censorship, majority-hashpower attacks, and reorganizations. The ledger now uses transactional SQLite/WAL storage and sparse per-block NFT-state deltas, but nodes still retain DAG block records in memory, rebuild state roots over the full NFT set, and revalidate all proofs at startup. It is not yet an archival-scale production design. HTTPS, container hardening, and passing tests do not constitute a security audit.

Before considering any broader deployment, the protocol and cryptography would need independent audits, adversarial network testing, hardened abuse controls, and tested recovery procedures. Do not expose a public node or use valuable assets on this experimental network.

Attribution

The four original starter summaries in the interface are preview examples only; they are not mintable. Mined cards contain short snapshots from Wikipedia contributors, licensed under CC BY-SA 4.0, and a Wikimedia-hosted picture. Open each card's Image & license link and review the file-specific license and attribution before reuse. A native NFT does not grant copyright or exclusive rights to article text or images.