xPrivFi
Last updated: 27 Nov 2025 — Developer Documentation v2.0
Documentation

Protocol & Developer Documentation

Comprehensive documentation of the xPrivFi Layer-1 protocol, mining system, economics, RPC interface, consensus rules, and future upgrade path.

The documentation is divided into sections covering the base protocol (Layer-1), the mining system (Layer-2 HexGrid), RPC interfaces, economic model, upcoming privacy features, and long-term architectural plans.


1. High-Level Overview

xPrivFi is a clean-slate Layer-1 blockchain for digital cash with:

2. Monetary Model

The supply of XPF is permanently capped at 1,000,000. The economic design is intentionally minimal:

Layer-2 participation fees (e.g. 0.001 XPF) activate only after XPF is listed on an external marketplace. These fees are routed to Dex_Main — a closed-loop ecosystem wallet.

3. Layer-1 Protocol (Consensus)

The xPrivFi L1 protocol maintains a simple, auditable consensus surface.

3.1 Block Header

3.2 Consensus Rules

for each new block B:
  1. verify PrevHash matches tip
  2. check timestamp is valid (not far future)
  3. verify median-past-time
  4. compute expectedDiff using CP-Diff v1.0
  5. PoW(RandomHash(header)) <= target(difficulty)
  6. apply all transactions
  7. reward = MiningRewardAtoms(B.height)
  8. ensure reward <= remainingMineable
  9. credit miner with reward + fees

3.3 State Model

4. Transactions

XPF uses an account-based transaction format:

Fees are credited to miners. Once block rewards end, fees become the sole source of miner compensation.

5. HexGrid Mining (Layer-2)

Mining in xPrivFi is performed via the HexGrid Layer-2 game. It is fully off-chain and does not modify consensus rules.

5.1 Round Structure

5.2 Reward Flow

  1. players join a round (optionally: fee after listing)
  2. players select HexGrid tiles
  3. off-chain engine selects 1 winner
  4. engine submits a normal on-chain reward transaction
  5. winner receives 1 XPF instantly in wallet

5.3 Fees

6. JSON-RPC Interface

The RPC API allows wallets, explorers and miners to interact with the node.

6.1 Standard Methods

6.2 Mining-Related (if exposed)

These endpoints vary depending on your mining pool implementation.

7. Privacy Roadmap (CP-Shield)

Privacy is introduced through optional higher-layer features without altering the fundamental L1 consensus rules.

Privacy is always opt-in.

8. Future Work