# PQWERAI Developers — full text export (testnet-20778+83ff5b69f0) # AI Network and GhostLLM runtime # AI Network and GhostLLM runtime AI runs **outside block validation**. The wallet downloads signed models, starts a local runtime, discovers providers and pays for accepted answers through testnet escrow. These services have different access/payment rules. | Area | Current implementation | Limit | |---|---|---| | [Model distribution](model-distribution.md) | Public approved licence/weights/runtime bytes | A CID needs retained reachable bytes; timeouts are not licence denials | | [GhostLLM runtime](ghostllm-runtime.md) | Verified CPU/Vulkan start, repair and real inference readiness | One-PC GPU verification; independent hardware acceptance open | | [AI Sharing](../wallet/ai-sharing.md) | Hosting consent, resource mode and mining priority | Local activity does not mint rewards | | [Pools](../getting-started/model-pool.md) | Federated directories, whole-model routing or split stages | Independent split execution and pooled settlement open | | [Paid Ask/editor gateway](../wallet/paid-ask.md) | Quote, explicit spending, request authorization, streamed answer and matching charge | Eligible reachable provider, testnet funds and payer block required | | [ServiceEscrow v3](service-escrow.md) | Generic quote/fund/propose/accept/finalize/withdraw | Separate from AIJobMarket request-authorization API | | [Revenue](revenue-policy.md) | Deployment-specific payees, exact provider remainder | Local 100% fixture differs from live 88/4/4/4 deployment | | [Workflows](workflows.md) | Provider discovery, LoRA, datasets and cited knowledge answers | Configuration is not proof of execution | | [Internal agents](../nodes/agents.md) | Six guarded roles and Discord status records | Community inference waits for official-pool capacity | The AI market contracts (ModelRegistry, AIJobMarket, AIProviderRegistry) were **deployed on chain 20778** on 27 November 2026; no independent provider is registered on 20778 yet, so a paid request needs a reachable registered provider first. Paid request timing and acceptance were exercised by one operator on 21 November, before the chain 20778 launch. This does not establish an independent provider cohort or proof of inference quality. Prompts/outputs stay off chain; only payment/receipt commitments go on chain. A signature authenticates a provider's statement, not its computation. Distributed training payouts and independent hardware/contribution settlement remain open. # GhostLLM runtime integration # GhostLLM runtime integration The GhostLLM runtime is the inference software the wallet and providers run in a **separate process**. Core validates blocks independently. *Credits: the GhostLLM runtime packages the upstream open-source MeshLLM project under its licence.* | Profile | Behaviour | |---|---| | Wallet 0.8.21 managed Bonsai | Signed bundle pins the 0.78 runtime preview archive and GGUF; Windows CPU/Vulkan mode follows hardware and user choice | | Operator-supervised GhostLLM runtime | Pinned native files, isolated data and explicit resource policy; older CUDA profiles are not the Windows default | | Colibri | Separate optional loopback backend, locally tested; unauthenticated cluster mode stays off | The wallet downloads approved content through public HTTPS/IPFS, checks hashes/registry and binds runtime metadata to the signed archive. Model/licence/vision files are rechecked at start. The local OpenAI-compatible API uses literal loopback and its actual port is discovered. Real inference is checked at startup and recovery. **Off** cancels pending restarts. [AI Sharing](../wallet/ai-sharing.md) covers operation and diagnostics. A pool member holds the whole model when it fits with working memory; otherwise the runtime uses layer stages. Only loaded runtime nodes/stages count as serving. Directory membership is insufficient. Real 0.8.21 checks exercised downloads, resume, repair, configuration, inference and restart cancellation on one RTX 4060 Ti PC. Another PC's RTX 2070 timeout remains unresolved. Independent multi-host acceptance and accountable hardware measurement remain open; usage receipts are provider claims. # Model downloads, IPFS and access # Model downloads, IPFS and access Anyone can read approved model content from public PQWERAI IPFS HTTPS gateways. Downloading the published licence, weights or runtime needs **no wallet signature, pool invitation, account or payment**. The wallet still verifies the signed bundle, file sizes and SHA-256 values before use. | Service | Access | Purpose | |---|---|---| | Public content gateway | Public reads of published bytes | Model/licence/runtime downloads | | Kubo API / private storage swarm | Operator-only | Administration and replication; public reads do not expose these controls | | Managed model on your PC | Explicit download/hosting consent | Local inference | | Pool mesh/relay | Signed membership and approved topology | Exchange inference work | | Paid provider | Quote and explicitly funded escrow | Accepted customer inference | | [Storage reward](../getting-started/ipfs-storage-reward.md) | Bonded v2 proof-of-access rules | Reward availability, separate from downloading | ## LICENSE unavailable “LICENSE is not available ... The operation was canceled” reports a failed/timed-out fetch. It does not prove the model licence forbids use. The exact manifest-pinned licence must still be fetched and verified. Bonsai displays Apache-2.0 with its attribution; runtime/upstream components keep their own notices. The primary gateway's stalled TLS-handshake handling was repaired on 22 November and full downloads were verified. The legacy secondary gateway remained unavailable in that investigation. Public read access does not promise uptime or establish independent replication, fully signed release catalogs or no-GitHub bootstrap acceptance. ## Wallet recovery 0.8.21 resumes interrupted downloads with validated ranges, bounds stalled headers/data and reuses verified local files offline. Model/licence/vision files are rechecked at start; runtime metadata is bound to the signed archive. Use [AI Sharing diagnostics](../wallet/ai-sharing.md) if download completes but runtime startup fails. A CID identifies bytes; it does not retain them. Independent replicas and recovery from CAR backups remain separate distribution acceptance requirements. # AI service revenue policy # AI service revenue policy **Version 3 (current, 2026-11-05):** for each settled charge, each deployment-configured payee receives `floor(charge × bps / 10000)` and the serving provider receives the exact remainder. | Rule | Value | |---|---| | Scope | Inference only | | Founder share | 0 (the founder is paid only from block issuance) | | Training / model fund | 0 (training is out of scope for this testnet) | | Payees | ≤ 4, distinct, non-zero, each bps > 0, total < 10000 | | Local test fixture | No payees → the provider receives **100 %** | | Approved production schedule | None yet — pending economic approval | | On-chain commitment | `distributionHash = keccak256(abi.encode(3, payees, bps))`, fixed per deployment | ## History | Version | Split | Status | |---|---|---| | v1 | 80 / 7 / 4 / 4 / 4 / 1 (provider / model-training fund / … / founder) | Superseded; legacy escrows only | | v2 | 81 / 7 / 4 / 4 / 4 / 0 | Superseded; legacy escrows only | | v3 | provider remainder, configurable payees, founder 0, training 0 | **Current** | Historical design documents may still mention the 80/7/4/4/4/1 split; it no longer applies to new deployments. Block issuance (67 % PoW / 18 % Smartnodes / 1 % founder / 9 % Quantum Reserve / 5 % IPFS storage pool on chain 20778, from block 1) is a different mechanism — see [Rewards and issuance](../mining/rewards-and-issuance.md). ## AI market deployment terms The AI market was **deployed on chain 20778** on 27 November 2026. The AIJobMarket deployment terms recorded before the chain 20778 launch are **88% provider / 4% gateway verification / 4% CPU pool / 4% Smartnode pool**. These are that deployment's terms. Generic ServiceEscrow v3 fixtures with no payees give the provider 100%; they do not redefine the live schedule. Existing escrows retain their committed terms. Neither schedule changes issuance, activates proposed 85/5/5/5 terms or pays from local GPU counters. # ServiceEscrow contract reference # ServiceEscrow reference Solidity 0.8.26, SPDX MIT. Constants: `REVENUE_POLICY_VERSION = 3`, `MAX_PAYEES = 4`, `BPS_DENOMINATOR = 10000`, `DOMAIN = keccak256("PQAI-SERVICE-QUOTE/1")`. ## Constructor ```solidity constructor(address arbiter, address[] payees, uint16[] bps, uint256 challengeBlocks, uint256 disputeBlocks) ``` `arbiter ≠ 0`; windows 1..100000 blocks; up to 4 distinct non-zero payees, each `bps > 0`, total `< 10000` (the provider always keeps a share). `distributionHash = keccak256(abi.encode(3, payees, bps))` commits the schedule for life. ## Quote ```solidity struct Quote { bytes32 job; address payer; address provider; bytes32 model; uint256 maxTokens; uint256 pricePerToken; uint64 expiresAt; uint32 serviceBlocks; } ``` `quoteHash(q) = keccak256(abi.encode(DOMAIN, block.chainid, address(this), q))`, signed by the provider as an EIP-191 personal message over the 32-byte hash (65-byte signature, low-s, v ∈ {27, 28}). ## Functions | Function | Caller | Effect | |---|---|---| | `fund(Quote, bytes sig)` payable | payer | Requires `msg.value == maxTokens × pricePerToken`, unexpired quote (`block.number ≤ expiresAt`), valid provider signature. State → Funded, deadline = now + serviceBlocks | | `propose(bytes32 id, bytes32 receipt, uint256 tokens)` | provider | Before deadline; receipt unused; `0 < tokens ≤ maxTokens`. charge = tokens × price. → Proposed | | `accept(bytes32 id)` | payer | → Accepted; deadline = now + challengeBlocks | | `dispute(bytes32 id)` | payer (Proposed/Accepted) or provider (Proposed) | Before deadline. → Disputed; deadline = now + disputeBlocks | | `resolve(bytes32 id, uint256 approvedCharge)` | arbiter | `approvedCharge ≤ charge`; → Accepted, final | | `finalize(bytes32 id)` | anyone | After the Accepted deadline: credits payer refund, payee shares (floor), provider remainder. → Settled | | `refundExpired(bytes32 id)` | anyone | Funded/Proposed/Disputed after deadline: full budget to payer. → Refunded | | `withdraw()` | any creditor | Pull payment of `credits[msg.sender]` (reentrancy-guarded) | | `distribution()`, `quoteHash()`, `jobs(id)`, `credits(addr)`, `usedReceipts(r)` | view | | States: `0 None, 1 Funded, 2 Proposed, 3 Accepted, 4 Disputed, 5 Settled, 6 Refunded`. ## Events | Event | When | |---|---| | `Funded(bytes32 indexed job, bytes32 quoteHash)` | fund | | `Proposed(bytes32 indexed job, bytes32 receipt, uint256 charge)` | propose | | `Changed(bytes32 indexed job, State state)` | accept, dispute, resolve, finalize, refundExpired | | `Paid(address indexed recipient, uint256 amount)` | withdraw | Revert reasons are listed in the [tutorial](../getting-started/ai-payment-app.md#errors-revert-reasons). ## Integration notes - Jobs funded on older escrows (v1 80/7/4/4/4/1, v2 81/7/4/4/4/0) keep their terms; new markets deploy v3. - A reorganisation can undo allocation and withdrawal; wait for BFT finality before irreversible delivery. - After final allocation, pull credits are not revocable by the contract. ## Wallet AIJobMarket requests The current wallet paid route targets AIJobMarket, adding eligibility, request-hash authorization and receipt binding. This generic ServiceEscrow ABI is not an alternative ABI for AIJobMarket. See [Paid Ask](../wallet/paid-ask.md) for the user flow. # AI Workflows in the wallet # AI Workflows in the wallet !!! note "Release status" AI Workflows ships since wallet 0.8.8 (test-network pre-release, CR-0044). The nodes and templates marked **new in 0.8.9** below were added in wallet 0.8.9 (CR-0052). Step-by-step user guide: [pqwerai.com/wallet/workflows/](https://pqwerai.com/wallet/workflows/). The **AI Workflows** page (Ctrl+Shift+8) lets you build an AI task as connected nodes, then run it. Every node calls a real wallet service. Nothing is simulated: a step either runs or stops with the reason and a suggested fix. The **Canvas** page (Ctrl+Shift+7) is a separate tool. It builds Solidity contracts and is unchanged. ## Simple and Advanced modes | Mode | What you see | | --- | --- | | **Simple** | Templates, the template's text inputs, a **Run** button and the results | | **Advanced** | The node library and search, every parameter, groups, subworkflows, the problems list and the run log | ## Starter templates Every template was run live on 19 November 2026 the way a new user meets it: the approved local model, a public test-network RPC and AI market, an empty data folder and every payment refused (test `WorkflowTemplateAuditLiveTests`, CR-0076). Each template now says under its name what it needs; templates that read a file copy a sample into the workflow data folder when you open them, never over a file you already have. | Template | What it does | Cost | Live result for a new user | | --- | --- | --- | --- | | AI chat | Asks your local model; a Memory node keeps the conversation | Free (local) | Works | | Multi-agent collaboration | A planner, a critic and a writer take turns on one task | Free (local) | Works | | GhostLLM paid inference | Finds providers on chain, picks the cheapest, shows the price, pays through escrow | Paid: asks first | Finds the provider and the signed quote, then stops at your approval | | AI training: evaluate a model | Scores your local model on a JSONL dataset | Free (local) | Works with the sample `qa.jsonl` | | Smart-contract interaction | Reads a contract on chain 20778, checks the result and pins it to IPFS | Free | Needs your IPFS node running; the contract read works without it | | Summarize and translate | Bullet-point summary with the local model, then a translation | Free (local) | Works on a sample text (before CR-0076 it summarized its own placeholder) | | Sort messages by type | Classify labels a message; each label goes to its own branch | Free (local) | Works | | Extract data to JSON | Extract Fields fills named fields, Get Field and Check verify the total, File saves the JSON | Free (local) | Works | | Balance report | Block Height and Balance feed a Template that is shown and saved to a file | Free | Works (reads the IPFS reward pool's balance) | | Ask your documents (RAG) | Splits and indexes documents, answers with citations | Free (local) | Works with the sample `handbook.md` (keyword search; connect an embedding model for semantic search) | | LoRA style | Merges LoRA adapters into a base model and chats with it | Free (local) | Needs your own base model and LoRA files; the built-in Bonsai model cannot take a LoRA | ## Before you run, reused steps and run history (CR-0077) These features are in wallet 0.8.14. - **Before you run.** The Run tab lists what the workflow needs, line by line, with the node and the fix: - the files in the data folder, - whether the local AI model is running, - whether your IPFS node is running, - the network connection, - the most the run can spend. **Check** runs these tests without running any step. **Run** runs them first, then runs the workflow anyway: a step that misses something fails with the same fix. Nothing is signed or paid by the check. - **Reuse unchanged results.** A local step whose settings and inputs did not change since the last run is not run again. It shows **Cached**, so a long model answer is not recomputed when you only change a later step. These steps always run again: - steps that read the network or the chain, - steps that write files or use conversation memory, - steps that sign or pay, - agents with tools, - LoRA merges and model servers. **Run fresh** forgets the reused results. They are kept in memory for the wallet session only. - **Output of each step.** After a run, select a node (Node tab) to see what it produced on each output port, with its type. - **History.** Each run is saved in the workflow folder (`runs//`, the last 30 per workflow). The record holds the state, message and output previews of every step. Pick a past run in the History tab to show it on the canvas. Outputs are previews of at most 4,000 characters. Node outputs never contain keys or passwords. ## Models tab, images, video and speech (CR-0079) These features are in wallet 0.8.14. The **Models** tab lists the programs and models the canvas can run on your PC. For each one it shows the licence, the download size, whether it fits your GPU, and **Install** or **Remove**. Before downloading, the wallet shows every file and the site it comes from, and asks you first. Every byte is checked against a SHA-256 pinned in the wallet. A download that stops resumes where it stopped. Only permissive licences are offered (owner decision, 19 November 2026). | Entry | What it adds | Licence | Download | | --- | --- | --- | --- | | Qwen3 0.6B (Q8_0) + TL;DR summary LoRA | A small chat model that can take LoRAs (Bonsai cannot), with a sample LoRA | Apache-2.0 | 650 MB | | stable-diffusion.cpp (Vulkan) | The image and video program (release master-1106-532d2c1) | MIT | 30 MB | | Stable Diffusion XL 1.0 + fp16 VAE | 1024×1024 images; needs a GPU with 6 GB or more | CreativeML OpenRAIL++-M / MIT | 7.3 GB | | Pixel art LoRA for SDXL | A style LoRA for SDXL | CreativeML OpenRAIL-M | 170 MB | | Wan 2.2 TI2V 5B (Q4_K_M) | Short video clips; needs a GPU with 8 GB or more | Apache-2.0 | 8.5 GB | | whisper.cpp v1.9.2 + Whisper base | Speech to text in about 99 languages, on the CPU | MIT | 150 MB | | FFmpeg 8.1 (LGPL build) | Converts recordings for Whisper; runs as a separate program | LGPL | 80 MB | New nodes (category **Image, video & audio**): | Node | What it does | | --- | --- | | **Generate Image** | Text to image, or image to image with a start image. Uses an installed model plus any LoRA Loaders connected to *LoRAs*. The same seed and the same inputs give the same image. | | **Generate Video** | Text (or a start image) to a short clip with Wan 2.2 5B. | | **Load Image** / **Load Audio** | A file from the workflow data folder. | | **Speech to Text** | Whisper transcription. `auto` detects the language; it can also translate to English. | | **Image** / **Video** (Output) | Shows the result. **Open** opens the file with your default app. | LoRAs work the way they do in ComfyUI: chain **LoRA Loader** nodes with a strength. For text models the stack is merged into the base model. Image LoRAs are applied when the image is made. A LoRA only fits the model family it was trained for. The Models tab names each LoRA's base model, and the check before running refuses a mismatch (for example, a Qwen3 text LoRA on SDXL). New templates: - **Image with a LoRA** (SDXL + pixel art). On the owner PC (RTX 4060 Ti 16 GB) one 1024×1024 image took 80 s. - **Voice note to summary** (Whisper, then the local model). - **Text to video** (Wan 2.2 5B). - The **LoRA style** template now uses the pinned Qwen3 0.6B + TL;DR LoRA from the Models tab, so it works without your own files. Not yet available: - **Paid remote image and video jobs**: these are the next phase. ### Text to speech and music (CR-0081, wallet 0.8.14) Both run on the pinned program [audio.cpp](https://github.com/0xShug0/audio.cpp) v0.9.5 (Apache-2.0). It is installed from the Models tab together with the model it needs: | Entry | What it adds | Licence | Download | | --- | --- | --- | --- | | Chatterbox (Q8_0) + default voice | Speech in 19 languages (English, Italian, Spanish, French, German, Portuguese and more), on the GPU (Vulkan build) | MIT; the default voice is a public-domain LJSpeech recording | 2.2 GB | | ACE-Step 1.5 Turbo (Q8_0) | Songs with vocals, or instrumentals, 10 to 240 seconds long, on the CPU (CPU build; about 16 GB of RAM) | MIT | 6.2 GB | Chatterbox speaks in the voice of a short recording. With nothing connected, it uses the public-domain default voice. Connect **Load Audio** to *Voice recording* to make it speak in your own voice; any WAV, MP3, M4A, OGG or FLAC works. Kokoro, which has built-in voices, was not chosen: its English and Italian pronunciation needs the eSpeak-ng library, which is GPL-3.0, and the wallet offers permissive licences only. Music uses the CPU build of audio.cpp. On a Ryzen 9 3900X the Vulkan build stops with an illegal-instruction error on the ACE-Step path, while the CPU build of the same release works. A 30-second song took 3.5 minutes there. New nodes: - **Text to Speech**: text in, speech out. Pick the language, and optionally connect a voice recording. - **Generate Music**: a style prompt and optional lyrics in, a song out. - **Audio** (Output): plays the result with **Open**. New templates: **Read aloud** and **Song from a prompt**. You can combine them with the earlier nodes: for example, **Voice note to summary** followed by **Text to Speech** reads the summary back to you. ## Run a request in the official PQWERAI pool (CR-0090, wallet 0.8.14) **Discover Provider** has a **Source** setting: - **any provider** (the default): every provider that is approved on chain for the model, as before. - **official pool**: only providers that serve in the official PQWERAI sharing pool of the network (on testnet 20778: `bonsai-2-community`, created on 28 November 2026, no members yet). Their wallet or payout address must be a member of the pool in the *ready* or *active* state, and not reported offline. - **pool id**: the same rule for one pool that you choose; paste its id (0x and 64 hex characters) from AI Sharing or Model Pools. The wallet reads the pool's members from the pool directory and checks every provider on chain again. It is the same rule as the **Use AI** pool route, so a workflow and VS Code reach the same machines. When no provider serves in the pool, the node stops before any quote and nothing is paid. Use **Estimate Cost** and **Escrow** after it, exactly as with any provider. ## Node categories | Category | Nodes | | --- | --- | | AI Models | Select Model, Load Model, Inference; **new in 0.8.9:** Summarize, Classify, Extract Fields, Translate | | Agents | AI Agent (read-only tools, step limit), Tool, Memory, Multi-Agent | | Training | Dataset, Fine-Tuning, Evaluation | | GhostLLM | Discover Provider (any provider, the official PQWERAI pool, or one pool), Route Request, Relay (AI P2P overlay) | | Payments | Estimate Cost, Escrow, Settlement | | Blockchain | Read Contract, Verify Transaction, Submit Transaction; **new in 0.8.9:** Block Height, Balance | | Storage | IPFS Upload, Retrieve, Verify CID | | Logic | Condition, Loop (runs a subworkflow per item), Router, Merge, Text Input; **new in 0.8.9:** Check | | Output | Text, JSON, File, Result Viewer | | Text & Data (**new in 0.8.9**) | Template, Transform Text, Extract Pattern, Parse JSON, Get Field, Build JSON, List, Calculate, Convert Units, Hash | Ports are colour-coded by value type, and the editor refuses a connection between types that do not match. **Fine-Tuning** is in the library, but chain 20778 has no training market. The node therefore stops with that message and pays nothing. ### Behaviour of the nodes added in 0.8.9 - **Classify** asks the model for one of two or three labels. It picks the label the answer names first, as a whole word. The input text goes out on that label's port, or on **Other**, and **Label** always carries the chosen name. - **Extract Fields** keeps only the field names you list. A field the model did not find is `null`. When the answer is not JSON, the object carries `_error`. - **Get Field** follows paths such as `result.items[0].name`. A missing or `null` value sends nothing on **Value** and `false` on **Found**, so later nodes are skipped rather than fed an empty value. - **Check** passes its value on when the test holds. Otherwise the node fails with your message, and the nodes after it are skipped. - **Extract Pattern** uses .NET regular expressions with a 250 ms time limit and returns at most 100 matches. **List** and **Transform Text** stop at 1,000 items, and results are capped at 64 KiB. - **Calculate** uses decimal arithmetic (no binary rounding errors) and refuses division by zero and overflow. **Convert Units** is exact to 1 wei. **Hash** gives SHA-256 or Keccak-256 as `0x` hex. ## Datasets, knowledge bases and LoRA (CR-0054) These nodes are in wallet 0.8.10 and later. | Node | What it does | | --- | --- | | **Load Documents** | Reads `.txt`, `.md`, `.jsonl`, `.json` or `.csv` from the workflow data folder or an IPFS CID. Each JSONL or CSV row becomes a document; text comes from `text`/`content`/`body`, or `prompt` plus `response`/`expected`. | | **Text Splitter** | Splits on paragraph, line, sentence and word boundaries into chunks of up to N characters. Chunks overlap, so a fact on a boundary is still found. | | **Knowledge Base** | Builds a keyword (BM25) index. If an embedding model is connected, it also builds vectors. It can save a `.kb.json` file to the output folder, which you can share or pin on IPFS. | | **Load Knowledge Base** | Opens a saved `.kb.json` from the data folder or IPFS. | | **Retriever** | Finds the best passages: **keyword**, **semantic** (needs the embedding model the base was built with) or **hybrid** (both, combined by rank). | | **Knowledge Q&A** | Answers from the retrieved passages only, citing them as [1], [2]. It says so when the passages do not contain the answer. | | **Knowledge Search Tool** | Lets an AI Agent search the base itself (`CALL knowledge_search `). | | **Documents to Dataset** | Turns prompt/response rows into an evaluation dataset for **Evaluation**. | | **Model File** | Serves any GGUF from the data folder (a chat model or an embedding model such as Qwen3-Embedding-0.6B) with your installed GhostLLM runtime, on this PC only. | | **LoRA Loader** | Adds a LoRA adapter (GGUF, from the data folder or IPFS) with a strength from −4 to 4. Chain loaders to stack up to 8 adapters, as in ComfyUI. | | **Apply LoRA** | Merges the stack into a base model and serves the result locally. It can re-quantize to Q8_0 or Q4_K_M. | How it works and its limits: - **Semantic search needs an embedding model.** The Bonsai chat model cannot produce embeddings (the GhostLLM runtime refuses: "endpoint requires Embedding"). Connect a **Model File** node with an embedding GGUF to the *Embedding model* ports. Without one, use **keyword** search. - **LoRA is merged, not loaded at run time.** The GhostLLM runtime cannot load adapters, so the wallet computes `W' = W + strength · (alpha / rank) · B·A` for every adapted weight. It writes a new GGUF, copying all other tensors unchanged, and caches it by base model, adapters, strengths and output type. The official llama.cpp release has no export tool, so this runs in the wallet itself. Only re-quantizing uses the official `llama-quantize` (llama.cpp b12237, verified by SHA-256). The wallet asks before downloading it, and output **F16** skips it. - **Base models:** F32, F16, BF16 or Q8_0 GGUF of the same family the LoRA was trained for. **Bonsai 2 (ternary) cannot take a LoRA**: its rotated ternary weights do not match standard adapters. - Everything runs on your PC. A knowledge base, a LoRA or a merged model leaves it only when you upload it with an IPFS node. ## Payments and signatures - Every node that pays or signs (**Escrow**, **Settlement**, **Submit Transaction**, **Fine-Tuning**) is marked PAID or SIGNS. Before it runs, the wallet shows the maximum cost and asks you to approve. - After your approval, the wallet's usual transaction dialog asks for your password. The workflow engine never holds a key or a password. - **Estimate Cost** refuses a quote above the limit you set, before anything is signed. - **Escrow** uses the AI market on chain 20778 (AIJobMarket, deployed on 27 November 2026; no independent provider registered yet). The wallet checks the provider's on-chain charge against the answer it received, and refunds the unused budget. ## Files: `pqwerai-workflow/1` **Export** saves a workflow as a `.pqflow.json` file, and **Import** opens one. A workflow file holds data only: - nodes, connections, groups and subworkflows; - only node types from the catalog, and only the parameters each node declares; - no file paths: Dataset and File nodes take a plain file name inside the wallet's workflow `data` and `output` folders. On import, the wallet refuses a file that breaks any of these rules or is larger than 1 MiB. Every **Save version** keeps a numbered copy, and every change is autosaved. ## Editing - **Moving around:** drag the canvas to pan, Ctrl+wheel to zoom, Fit to view, and a minimap. - **Adding and connecting:** drag nodes from the library, or right-click the canvas and search. Drag from an output to an input to connect. - **Selecting:** Ctrl+click selects several nodes, and Shift+drag selects with a box. - **Shortcuts:** Ctrl+Z/Y undo and redo, Ctrl+C/V/D copy, paste and duplicate, Ctrl+G group, Ctrl+L auto-layout, Del deletes, F5 runs and Esc stops a run. - **Run status:** each node shows its own state: waiting, running (with progress), waiting for approval, done, skipped, failed (with a fix) or cancelled. ## Test status Author review only. The tests ran on 15 November 2026: | Test | What was checked | | --- | --- | | Engine unit tests (30; 70 with the 0.8.9 nodes) | Import rules, typed connections, cycles, branches, approval refusal, the cost limit, cancellation, loops, agent tools, CID checks, undo/redo, versions and the folder sandbox | | Real-service test | The approved Bonsai model on the GhostLLM runtime and a public test-network RPC: chat with memory, three-agent run, evaluation, agent with the chain-height tool, contract read, cancellation while the model answers, and a refused payment that never reaches signing | | UI test | The real wallet app on a public test network: templates, contract read, readable failures (no IPFS node, no local model, no provider), Advanced editing, problems list and undo | Details: `audit/evidence/2026-11-15-ai-workflows/` in the repository. # Blockchain and EVM # Blockchain and EVM PQWERAI is an EVM chain whose blocks are produced by **GhostRider proof of work** and finalized by **Smartnode checkpoint votes**. To applications it looks like an Ethereum JSON-RPC node with chain ID **20778**, plus the `g4_*` namespace for finality and issuance. ```mermaid flowchart LR subgraph Production["Block production (3–7 s)"] M[GhostRider miners] --> B[Blocks: EVM state transition] end subgraph Finality["Finality (every 32 blocks)"] V[Smartnode validators] -- signed votes --> C[Checkpoint certificate] end B --> C C --> F[(Finalized: never reorganised)] ``` | Topic | Page | |---|---| | Chain ID, issuance, EVM rules, finality and registry parameters | [Network parameters](network-parameters.md) | | Which EVM opcodes and EIPs are active | [EVM compatibility](evm-compatibility.md) | | Transaction types, gas, base fee burn, priority fee | [Transactions and fees](transactions-and-fees.md) | | When a transaction is irreversible | [Finality for applications](finality.md) | | Every JSON-RPC method | [JSON-RPC reference](../reference/json-rpc/index.md) | | Try read-only requests | [API playground](../playground.md) | ## What differs from Ethereum mainnet - **Consensus:** PoW (GhostRider) + FFG-style checkpoint finality, not proof-of-stake block proposals. `0x44` (`PREVRANDAO`/`DIFFICULTY`) returns the PoW difficulty, not beacon randomness — never use it as randomness. - **No blobs:** EIP-4844 blob transactions and the `BLOBHASH`/`BLOBBASEFEE` opcodes are not available. - **Finality tags:** on the public RPC endpoints `safe` and `finalized` both resolve to the Smartnode finalized checkpoint (CR-0094); a self-hosted Core node returns errors for them, so use `g4_status.finalized_height` there. - **RPC surface:** no `personal_*`, `admin_*`, `debug_*`, `miner_*`, tracing or WebSocket subscriptions. - **Issuance:** uncapped, split 67 % PoW / 18 % Smartnodes / 1 % founder treasury / 9 % Quantum Reserve / 5 % [IPFS storage pool](../getting-started/ipfs-storage-reward.md) on chain 20778 from block 1 (bound in the genesis, no fork), credited per epoch by validator vote participation; EIP-1559 base-fee burn. # EVM compatibility # EVM compatibility The PQWERAI EVM is the unmodified Core-Geth EVM. `network.json` declares the Ethash-family rules through London at genesis plus EIP-3651, EIP-3855, EIP-3860, EIP-5656 and EIP-1153 at block 0. The table below was **measured** on a live node with the same EVM rules before the chain 20778 launch, with the opcode probe at the end of this page; chain 20778 is live since 27 November 2026, so re-run the probe against it to confirm on your own. | Opcode / feature | Fork | Chain 20778 (same rules) | |---|---|---| | `BASEFEE` (EIP-3198), EIP-1559 transactions | London | ✅ supported | | `PUSH0` (EIP-3855) | Shanghai | ✅ supported | | Warm `COINBASE` (EIP-3651), initcode limit (EIP-3860) | Shanghai | ✅ active per network.json | | `MCOPY` (EIP-5656) | Cancun | ✅ supported | | `TLOAD` / `TSTORE` (EIP-1153) | Cancun | ✅ supported | | `SELFDESTRUCT` | — | executes (pre-Cancun EIP-6780 semantics are not claimed; do not rely on it) | | `BLOBHASH` (EIP-4844) | Cancun | ❌ `invalid opcode: BLOBHASH` | | `BLOBBASEFEE` (EIP-7516) | Cancun | ❌ `invalid opcode: BLOBBASEFEE` | | `CLZ` (EIP-7939) | Osaka | ❌ `opcode 0x1e not defined` | | `PREVRANDAO` / `DIFFICULTY` (`0x44`) | — | returns the **PoW difficulty** (e.g. `0x200`) | | Blob transactions (type 3) | Cancun | ❌ blob rules not activated | | EIP-7702 set-code transactions (type 4) | Prague | ❌ `transaction type not supported` | ## Compiler targets | Toolchain | Recommended setting | Notes | |---|---|---| | solc 0.8.26 | `evmVersion: cancun` (or `london`) | Fine unless the source calls `blobhash()` or `block.blobbasefee`. The Wallet Studio templates use `london`. | | Vyper 0.4.3 | `--evm-version cancun` | Tested | | Huff Neo (`hnc`) 1.7.1 | `-e cancun` | Default target `osaka` emits nothing chain-incompatible for simple code, but pin it | | Fe 26.5.1 | default | Experimental; tested on a counter only | | Foundry | `evm_version = "cancun"` | Tested with Foundry 1.8.5 | | Hardhat | `evmVersion: "cancun"` | Not executed for this release | !!! note "Correction" Older wallet documentation stated that the chain has no `PUSH0`/`MCOPY`. That is obsolete: both execute under the chain 20778 rules (measured before the chain 20778 launch on a node with the same EVM rules). Compiling for `london` remains valid and is what the shipped Studio artifacts use. ## Probe a node yourself Read-only: the code runs through an `eth_call` state override, nothing is deployed. ```python title="python/opcode_probe.py" --8<-- "python/opcode_probe.py" ``` ```text PUSH0 (Shanghai) supported MCOPY (Cancun) supported TLOAD (Cancun) supported TSTORE (Cancun) supported BLOBHASH (Cancun, EIP-4844) NOT supported: invalid opcode: BLOBHASH BLOBBASEFEE (Cancun) NOT supported: invalid opcode: BLOBBASEFEE CLZ (Osaka) NOT supported: invalid opcode: opcode 0x1e not defined ``` ## Limits - Contract code size 24,576 bytes (EIP-170); initcode 49,152 bytes (EIP-3860). - Genesis block gas limit 15,000,000; miners may target another limit with `--miner.gasceil`. - Precompiles are those of the Ethereum fork rules above (no KZG point evaluation, since there are no blobs). # Finality for applications # Finality for applications | Stage | Meaning | How to check | |---|---|---| | Pending | In a node's pool | `eth_getTransactionByHash` returns it with `blockNumber: null` | | Included | In the current canonical chain; can still be reorganised by a heavier PoW branch | Receipt exists | | **BFT-finalized** | At or below a checkpoint signed by > 2/3 of the epoch set's stake; nodes never reorganise below it | `blockNumber ≤ g4_status.finalized_height` **and** block hash unchanged | Checkpoints are every 32 blocks (epochs). Finality normally trails the head by one to two epochs; in the tested run a transaction became final after about 8 minutes. ```bash title="quickstart/wait-finality.sh" --8<-- "quickstart/wait-finality.sh" ``` ## Rules for application developers 1. **Credit irreversible value only after BFT finality** (exchanges, bridges, AI deliverables, off-chain goods). 2. **Re-check the block hash** after finality: if your transaction's block was replaced before finalization, the transaction may be in another block or dropped. 3. **Do not trust a single endpoint for finality.** Compare `g4_status.finalized_hash` across independent operators or run your own node. 4. **Know where the `safe`/`finalized` block tags work.** The public endpoints `rpc-testnet.pqwerai.com` and `rpc-testnet2.pqwerai.com` resolve both tags to the Smartnode finalized checkpoint (`g4_status.finalized_height`), after checking that its hash is on the canonical chain; `safe` deliberately uses the same checkpoint, not the newer justified one (CR-0094). If finality is not reporting they return an error instead of guessing. A PQWERAI Core node you run yourself still returns `"safe block not found"` / `"finalized block not found"`: there, use `latest` plus the `g4_status` check. 5. **Plan for stalls.** If less than 2/3 of validator stake is online, PoW blocks continue but `finalized_height` stops advancing. Show "awaiting finality" rather than failing. ## `g4_status` fields used for finality | Field | Meaning | |---|---| | `head` | Current head height | | `finalized_height`, `finalized_hash` | Latest BFT-finalized checkpoint | | `justified_height`, `justified_hash` | Latest justified checkpoint (finalization candidate) | | `finality` | `true` when the node runs the registry/finality profile | | `epoch_set_size`, `epoch_set_root` | Validator set of the current epoch | Full method reference: [`g4_status`](../reference/json-rpc/g4.md#g4_status). # Network parameters # Network parameters Protocol parameters of PQWERAI public testnet 20778, from the docs-owned `developers/data/network-20778.json` (the chain 20778 genesis manifest, with stale text corrected). Deployment identity and rollout notes come from the reviewed `developers/data/feature-checkpoint.json`. Always pin the actual chain ID and genesis, and consult the feature ledger for acceptance limits. !!! note "Launch status" Chain 20778 is live since 27 November 2026 (21:47 UTC); the public RPC hostnames below serve it since 28 November 2026. Every validator, miner and public service is still run by the project. ## Identity | Parameter | Value | |---|---| | Network name | PQWERAI public testnet | | Status | public testnet 20778 live since 2026-11-27 21:47 UTC (genesis v3, Core a679d60a1; first finalized checkpoint 64 at 22:03 UTC); public endpoints since 2026-11-28; no real funds | | Protocol version | `pqwerai-v8-testnet/1` | | Chain ID / network ID | `20778` (`0x512a`) / `20778` | | Native asset | tPQAI, 18 decimals | | Genesis | `0xe7c41635510f505a98776ca3a198730e0cc120cd10039069006be334f41f3db6` — new genesis for chain 20778 (Core `a679d60a1`) | | Genesis file SHA-256 | `fcc415773df127442c22fc8a8cc2cee6a33302702f35654fa31905c737b7be8b` | | Genesis validators | 8 x 32 tPQAI: sn1-sn8, two per host on four standalone VPS (Chicago, Frankfurt, Los Angeles, Amsterdam), all run by the project | | Reviewed | 2026-11-28 (author review; no independent acceptance) | ## Add the network to a wallet ```json { "chainId": "0x512a", "chainName": "PQWERAI Testnet 20778", "nativeCurrency": { "name": "tPQAI", "symbol": "tPQAI", "decimals": 18 }, "rpcUrls": [ "https://rpc-testnet.pqwerai.com", "https://rpc-testnet2.pqwerai.com" ] } ``` Pin both the chain ID and the genesis hash above. ## GhostRider proof of work | Parameter | Value | |---|---| | Helper | pqwerai_hash_worker (native GhostRider stream helper) (`sha256 3a54f0bb461f296b…`, Linux genesis profile; see platform note below) | | Base difficulty | 64 (adaptive: True) | | Difficulty rule | next = parent*2 if gap=8s; else parent; clamped to [base, 16*base] | | Target block interval | 3–7 s | | Fork choice | greatest total difficulty; equal TD keeps local head; never reorganises below the BFT finalized checkpoint | Platform note: linux-amd64 pqwerai_hash_worker pinned in the genesis profile; native Windows Core uses pqwerai-hash-worker.exe (sha256 2fd87b73b22239b47d4d9f09fc2bd9e62623e634d539f84c1fb7cd6b6f57626c), admitted by Core as the same GhostRider artifact identity (no WSL); the Windows wallet bundles it; macOS/ARM64 helper: none. The Windows wallet for chain 20778 is wallet 0.9.0 (published 28 November 2026); verify platform binaries against the release's `SHA256SUMS`, not the Linux genesis hash. ## Issuance | Parameter | Value | |---|---| | Split | 67% PoW miners / 18% active Smartnode validators / 1% founder treasury / 9% Quantum Reserve / 5% IPFS storage pool of each epoch issuance from block 1, the first settlement (ipfs-reward/v1 bound in the genesis profile; no fork flag on any node), credited at epoch settlement in proportion to validator vote participation (zero participation means zero issuance) | | Cap | none (uncapped, per owner policy) | | Fees | EIP-1559 base fee burned (tracked as fee_burn_wei); priority fee to the miner | | Founder share | founder and reserve shares are carved out of the same issuance; transfers, gas fees and AI payments are never charged | | Quantum Reserve | contract address 0xcebDE02DF19270F4E56423607806AAeC6561A945 pinned in the genesis profile; the QuantumReserve contract was deployed there by the reserve deployer's first transaction in block 165 on 2026-11-27; the Quantum Layer only advises; execution is by a post-quantum 2-of-3 multisig within caps; automatic rules off | | Accounting RPC | `g4_status.minted_wei, fee_burn_wei, pow_issued_wei, pos_issued_wei, founder_issued_wei, reserve_issued_wei, registry_slash_burned_gwei` | ### IPFS storage share The 5% IPFS storage share is **active from block 1** (the first settlement): ipfs-reward/v1 is bound in the chain 20778 genesis profile, so no node passes a fork flag for it. It is the 72/18/1/9 base split with 5 points of the PoW share going to the IPFS storage pool `0xf4286aEB5865B9Ea6d620595E9E72707B0134EB5` = CREATE(`0x7b20435DE366181F009b24BD25045Eb4fEf89252`, nonce 0). The bonded v2 pool contract was deployed there as that deployer's transaction number 0 in block 143 on 27 November 2026; the share accrued to the pool address from block 1. Like every share it is credited once per 32-block epoch according to Smartnode vote participation. See [the storage-reward guide](../getting-started/ipfs-storage-reward.md). ## EVM | Parameter | Value | |---|---| | Engine | Core-Geth EVM (unmodified opcode semantics) | | Rules | Ethash-family protocol changes through London at genesis, plus EIP-3651, EIP-3855 (PUSH0), EIP-3860, EIP-5656 (MCOPY), EIP-1153 (transient storage) at block 0 | | Genesis gas limit | 15,000,000 | | Genesis base fee | 1,000,000,000 wei | | Transaction types | legacy (EIP-155), EIP-2930, EIP-1559 | | Genesis features | official; enabled at genesis block 0 only; ML-DSA-65 (0x0d01) and SLH-DSA-SHAKE-192s (0x0d02) precompiles enabled at genesis block 0 only; registry-topup/v1, registry-stage-surround/v1, EIP-6780 and wasm-vm/v1 locals metering at block 0; GhostShield v2 (ghostshield-guarantee/v2) at block 0 with the approved parameters, payment-assurance claims on from block 1 (owner decision 2026-11-27; testnet only, a mainnet needs the independent review); ipfs-reward/v1 from block 1. Bound in the genesis profile commitment: nodes pass none of the former fork flags | ## GhostFlow (parallel execution, experimental) | Parameter | Value | |---|---| | Activation | node-local options `--pase-workers` (0 = canonical serial, default; 2..16 = GhostFlow parallel execution) and `--pase-general` (contract blocks too) | | Consensus effect | none: GhostFlow must produce identical blocks, state roots, receipts and logs; any speculative conflict falls back to serial execution | | Scope | experimental; with `--pase-general` transfers and contract calls are speculated with read/write-set tracking (same result as serial); `--pase-workers` without `--pase-general` runs serially on chain 20778 because GhostShield v2 is active from genesis (GS2-01); measured 1.3-1.6x execution speed-up only at >=512 tx per block in a single-process benchmark; no network throughput figure is claimed | ## Finality | Parameter | Value | |---|---| | Kind | FFG-style checkpoint finality over registry-derived Smartnode validator sets | | Epoch length blocks | 32 | | Quorum | strictly more than 2/3 of the epoch set's effective stake | | Minimum genesis validators | 4 | | Max link span blocks | 4096 | | Vote transport | signed votes travel between validators by peer-to-peer gossip (pqv/1); certificates travel as transactions/blocks over devp2p; g4_submitVote over authenticated JSON-RPC remains available | | Signer safety | persistent journal with double-vote and surround-vote locks, fsync before release, stale-backup anchoring | | Liveness profile | {'duty_window_blocks': 8, 'inactivity_epochs': 12, 'note': 'liveness/v1 (certificate duty credit; force-exit of validators unseen for 12 checkpoints); genesis-bound'} | ## Smartnode registry | Parameter | Value | |---|---| | Registry account | `keccak256('PQAI/private/G4/registry/v1')[12:]` | | Operations | `register=1, topup=2, delegate=3, undelegate=4, claim=5, rotate=6, exit=7, withdraw=8, slash=9` | | Operation gas | `150000` | | Genesis validator stake gwei | `32000000000` | | Min stake gwei | `1000000000` | | Max effective stake gwei | `2048000000000` | | Min delegation gwei | `1000000` | | Activation delay epochs | `2` | | Unbonding epochs | `4` | | Evidence window epochs | `3` | | Slash fraction | `25/100 of stake, burned` | | Max set size | `64` | | Max registered | `256` | | Withdrawal rule | `only after exit + unbonding AND the withdrawable epoch is BFT-finalized` | ## RPC | Parameter | Value | |---|---| | Default bind | `127.0.0.1` | | Served namespaces | `eth`, `net`, `web3`, `txpool`, `g4` (+ `pqwerai_peerHealth` operator diagnostics) | | Never exposed | `personal`, `admin`, `debug`, `miner`, `clique`, `engine` | | Non-loopback bind | --rpc.token-file (bearer token >= 16 bytes, constant-time compare) | | Max request | 4,194,304 bytes | ## P2P | Parameter | Value | |---|---| | Default port | 30303 | | Discovery | off by default; --discovery with --bootnodes enables discv4 seeded by bootstrap nodes | | Bootstrap privileges | none; bootstrap nodes are ordinary full nodes | | Identity check | devp2p eth handshake rejects peers with a different network ID or genesis hash | # Transactions and fees # Transactions and fees | Type | Supported | Notes | |---|---|---| | Legacy (EIP-155) | ✅ | Must be signed with chain ID 20778; unprotected (pre-155) transactions are not recommended | | EIP-2930 access list (type 1) | ✅ | `eth_createAccessList` helps build the list | | EIP-1559 dynamic fee (type 2) | ✅ | Recommended | | Blob (type 3) | ❌ | Cancun blob rules are not activated on chain 20778 | | Set-code (type 4, EIP-7702) | ❌ | Rejected at decoding: `transaction type not supported` (measured) | ## Fees - **Base fee** per gas is set by the protocol (EIP-1559) and **burned**. Genesis base fee: 1 gwei; with mostly empty blocks it falls to a few wei (the recorded local testnet shows 7 wei). - **Priority fee** (tip) goes to the GhostRider miner of the block. - Burned fees are counted exactly in `g4_status.fee_burn_wei` and the explorer's `/api/v1/supply`. - AI payments and transfers carry no protocol tax; the founder share comes only from block issuance. Fee rule used by the PQWERAI Windows Wallet and `pqwerai-cli` (a safe default for your apps too): ```text maxPriorityFeePerGas = eth_maxPriorityFeePerGas maxFeePerGas = 2 × latest baseFee + maxPriorityFeePerGas ``` ```bash cast base-fee --rpc-url "$RPC" cast rpc eth_maxPriorityFeePerGas --rpc-url "$RPC" cast rpc eth_feeHistory '"0x4"' '"latest"' '[25,75]' --rpc-url "$RPC" cast estimate 0x000000000000000000000000000000000000dEaD --value 0.01ether --from "$ME" --rpc-url "$RPC" ``` ## Nonces, replacement and the pool - Nonces are per account and strictly sequential. Use `eth_getTransactionCount(addr, "pending")` before signing. - To replace a stuck transaction, resend the same nonce with both fees raised by at least 10 %. - `txpool_status`, `txpool_inspect` and `txpool_contentFrom` show this node's view of pending/queued transactions. ## Signing PQWERAI nodes hold no user keys: `eth_sendTransaction` and `eth_sign` return `unknown account`. Sign in the client (wallet, cast, ethers, viem, web3.py) and submit with `eth_sendRawTransaction`. The Windows Wallet decodes each signed transaction and recovers the sender before broadcasting. # Smart Contracts and Tokens # Smart Contracts and Tokens Start a token project with [Basic token in every language](guides/basic-token-all-languages.md): seven complete fixed-supply ERC-20 sources, a download bundle and one shared deployment walkthrough. PQWERAI supports **EVM and WASM smart contracts** with shared accounts and the Solidity ABI. Solidity, Vyper, Yul, Huff and Fe compile to EVM bytecode. C++ and a supported C# subset compile to WebAssembly for the official WASM VM v1. Start with the [first EVM contract](../getting-started/first-smart-contract.md) or [first WASM contract](wasm/first-contract.md). | Language | Compiler pinned | Status (tested before the chain 20778 launch; same EVM rules on 20778) | Best for | |---|---|---|---| | [Solidity](languages/solidity.md) | solc 0.8.26 | ✅ Tested (Foundry, Wallet Studio) | Most contracts, OpenZeppelin ecosystem | | [Vyper](languages/vyper.md) | 0.4.3 | ✅ Tested (CLI) | Auditable, Pythonic contracts | | [Yul](languages/yul.md) | solc 0.8.26 `--strict-assembly` | ✅ Tested (CLI) | Hand-written low-level code | | [Huff](languages/huff.md) | Huff Neo `hnc` 1.7.1 | Supported in Studio; local conformance tested | Opcode-level optimisation | | [Fe](languages/fe.md) | 26.5.1 | Supported in Studio; pinned pre-1.0 compiler | Typed messages and effects; review compiler-specific limits | | [C++](wasm/cpp.md) | clang 23.1.0 / wasi-sdk 34 | WASM VM v1; check connected-node support | Freestanding integer and buffer-based contracts | | [C#](wasm/csharp.md) | Roslyn 5.9.0 / .NET SDK 10.0.403 + Studio translator | WASM VM v1; supported C# subset | Static methods, unmanaged structs and SDK host calls | The [EVM language comparison](languages/index.md) shows the same contract in five EVM languages with measured gas. The [WASM language guides](wasm/index.md) cover C++ and C#, compiler setup, ABI and storage, deployment and module verification. WASM release acceptance remains separate from feature support. Then explore: - Standards: [ERC-20](guides/erc20.md) · [ERC-721](guides/erc721.md) · [ERC-1155](guides/erc1155.md) - Patterns: [access control and ownership](guides/access-control.md) · [events](guides/events.md) · [payable functions](guides/payable.md) · [Solidity libraries](guides/libraries.md) - [Verification](verification.md) · [Application languages (JS/TS/Python)](application-languages.md) !!! warning "Unaudited examples" Every example on these pages is tutorial code. Compiler success is not a security review. # Application languages (JavaScript, TypeScript, Python) # Application languages **JavaScript, TypeScript and Python are application languages in the supported workflows.** On-chain contracts use EVM bytecode from the [EVM language center](languages/index.md), or WebAssembly built from [C++ and C#](wasm/index.md). Application languages: - read chain state over [JSON-RPC](../reference/json-rpc/index.md) and the [explorer API](../explorer/index.md); - encode calls with a contract's ABI; - sign transactions locally and submit them with `eth_sendRawTransaction`. | Language | Libraries | Guide | |---|---|---| | TypeScript / JavaScript | ethers.js v6, viem 2 | [ethers.js](../tools/ethers.md) · [viem](../tools/viem.md) | | Python | web3.py 7, or the standard library | [web3.py](../tools/web3py.md) · [opcode probe](../blockchain/evm-compatibility.md#probe-a-node-yourself) | | Shell | Foundry `cast` | [Foundry](../tools/foundry.md) | WASM VM v1 is an official required Core feature; the 20778 profile enables it from genesis. Studio supports C++ and a defined C# subset. This does not add on-chain JavaScript, TypeScript or Python runtimes. Follow [Your first WASM contract](wasm/first-contract.md) for the supported authoring workflow and its verification limits. # Access control and ownership # Access control and ownership The tested `TipJar` example combines the three common models. ```solidity title="src/TipJar.sol" --8<-- "patterns/src/TipJar.sol" ``` | Model | Use | In the example | |---|---|---| | `Ownable` | One administrator | `setFee` is `onlyOwner` | | `Ownable2Step` | Ownership transfer that the new owner must accept | `transferOwnership(BOB)` sets `pendingOwner`; `owner` unchanged until `acceptOwnership()` | | `AccessControl` | Several roles, each grantable/revocable | `PAUSER_ROLE` guards `setPaused` | ```bash title="patterns/patterns.sh" --8<-- "patterns/patterns.sh" ``` Recorded output: ```text true 990000000000000000 [9.9e17] # BOB credited 0.99 tPQAI 10000000000000000 [1e16] # owner fee 1 % 1 # one Tipped event refused with AccessControlUnauthorizedAccount (0xe2517d3f) true refused with IsPaused() true true 0 # owner withdrew the fee true 0x000000000000000000000000000000000000bEEF # pendingOwner 0xaAcAcdD40Bcb3Ce31cDd67f8677C05a7d8A8B81b # owner still the old one ``` **Key custody:** keep owner and admin keys out of servers; for anything valuable use a multisig contract as the owner. Renouncing ownership (`renounceOwnership`) is irreversible. # Basic token in every language # Basic token in every language Choose one of seven complete examples below. Each creates an ERC-20 token with **18 decimals**, assigns its entire initial supply to the deploying account, and supports transfers and allowances. Supply is fixed after deployment: there is no additional mint, burn, owner privilege, transfer tax or upgrade function. [Download all seven sources](../../assets/examples/basic-token.zip){ .md-button .md-button--primary } These are editable, unaudited learning examples. Their names and symbols are examples, not official PQWERAI currencies. Deploying one does not create native tPQAI or a token with monetary value. ## Choose a language | Language | VM | Token name / symbol | Compiler | Initial supply | |---|---|---|---|---| | Solidity | EVM | Solidity Coin / SOLC | solc 0.8.26 + OpenZeppelin 5.0.2 | Constructor argument | | Vyper | EVM | Vyper Coin / VYPC | Vyper 0.4.3 | Constructor argument | | Yul | EVM | Yul Coin / YULC | solc 0.8.26, strict assembly | Constructor argument | | Huff | EVM | Huff Coin / HUFC | Huff Neo 1.7.1 | Source constant | | Fe | EVM | Fe Coin / FEC | Fe 26.5.1 | Constructor argument | | C++ | WASM | Wasm Coin / WASMC | wasi-sdk 34, clang 23.1.0 | Constructor argument | | C# | WASM | C# Wasm Coin / CSWC | Roslyn 5.9.0, .NET SDK 10.0.403 + Studio translator | Constructor argument | For **1,000,000 displayed tokens**, use this raw supply: ```text 1000000000000000000000000 ``` That is `1,000,000 × 10^18` base units. All function amounts and constructor inputs here are raw integers. Passing `1000000` as the constructor supply creates only `0.000000000001` displayed tokens. The **Huff** example has **no constructor arguments**. Its `INITIAL_SUPPLY` constant already equals the raw amount above (`0xd3c21bcecceda1000000`). Edit it before compiling to choose a different supply. ## Complete sources Solidity uses OpenZeppelin's ERC-20 implementation. The other examples implement the same public token interface directly. Yul and Huff expose their ABI through the declarations in the source; keep those declarations when pasting. Names and symbols can be edited before compilation; keep the corresponding string lengths and ABI encoding correct when changing the low-level Yul or Huff versions. === "Solidity" ```solidity title="BasicToken.sol" --8<-- "basic-token/BasicToken.sol" ``` === "Vyper" ```python title="BasicToken.vy" --8<-- "basic-token/BasicToken.vy" ``` === "Yul" ```javascript title="BasicToken.yul" --8<-- "basic-token/BasicToken.yul" ``` === "Huff" ```text title="BasicToken.huff" --8<-- "basic-token/BasicToken.huff" ``` === "Fe" ```rust title="BasicToken.fe" --8<-- "basic-token/BasicToken.fe" ``` === "C++" ```cpp title="BasicToken.cpp" --8<-- "basic-token/BasicToken.cpp" ``` === "C#" ```csharp title="BasicToken.cs" --8<-- "basic-token/BasicToken.cs" ``` ## Compile and deploy with Contract Studio 1. Open **Contract Studio** in the [Windows Wallet](../../tools/windows-wallet.md). Choose **Custom contract**, select the language, and paste its complete source above. This walkthrough uses the source editor, separate from the precompiled no-code token wizard in [Create a token](../../getting-started/create-token.md). 2. Install or select the pinned compiler in Studio. See the [EVM language guides](../languages/index.md) or the [C++ setup](../wasm/cpp.md#compiler-setup) and [C# setup](../wasm/csharp.md#compiler-setup). Studio supplies the bundled OpenZeppelin import for Solidity and the `pqwerai.h` / `PqwerAI.Contracts.cs` SDK for C++ / C#. A C# DLL by itself is not a chain deployment artifact. 3. Compile. Confirm the ABI includes the functions listed below. For Solidity select the `SolidityCoin` contract. Keep the source, compiler version, ABI and compiled artifact together. 4. Check the connected chain: public test network **20778**, expected genesis identity and, for C++ / C#, **WASM VM yes**. Use a locally controlled account funded with test tPQAI for fees. 5. For Solidity, Vyper, Yul, Fe, C++ and C#, enter `1000000000000000000000000` as `initialSupply`. Leave constructor arguments empty for Huff. Set attached native value to **0**. 6. Simulate deployment, estimate gas and review the account, network, constructor supply and fee. Sign locally, submit, wait for a successful receipt and save the deployed address. Apply your [finality policy](../../blockchain/finality.md). 7. Read `totalSupply()` and `balanceOf(deployer)`: both must return the raw supply. Read `name()`, `symbol()` and `decimals()` as a second check. Verify [EVM source/artifact identity](../verification.md) or [WASM module identity](../wasm/deployment-and-verification.md) using the matching artifact. The constructor emits `Transfer(zero address, deployer, supply)`. A WASM creation receipt also includes the node's `WasmDeployed(bytes32,uint32)` event; this is a module receipt, not a second mint. ## Try the same operations in every language The deployed address and ABI identify the token regardless of its source language. In Studio's contract console, read-only calls can be queried directly; send a signed transaction for each state change. `eth_call` only simulates an operation and does not persist a transfer or approval. Keep attached tPQAI at zero. | Function | Purpose | |---|---| | `name()`, `symbol()`, `decimals()` | Token metadata; decimals is 18 | | `totalSupply()` | Fixed raw supply | | `balanceOf(address)` | Account balance in base units | | `transfer(to, value)` | Move the caller's tokens; returns `true` | | `approve(spender, value)` | Set a spender's allowance; returns `true` | | `allowance(owner, spender)` | Read the remaining allowance | | `transferFrom(from, to, value)` | Move tokens using the caller's allowance; returns `true` | For a small manual exercise, use three accounts you control: Alice deploys, Bob receives, Carol spends. | Signed by | Transaction / query | Expected result | |---|---|---| | Alice | `transfer(Bob, 300000000000000000000)` | Bob receives 300 tokens | | Bob | `approve(Carol, 100000000000000000000)` | Carol may spend 100 of Bob's tokens | | Carol | `transferFrom(Bob, Carol, 60000000000000000000)` | Carol receives 60; Bob has 240 | | Any | `allowance(Bob, Carol)` | `40000000000000000000` (40 tokens) | | Carol | Try spending 41 more tokens | Reverts: remaining allowance is only 40 | | Bob | `approve(Carol, 0)` | Revokes the remaining allowance | Successful transfers emit `Transfer`; explicit approvals emit `Approval`. Prefer limited allowances. When replacing an existing nonzero allowance, revoke it first and confirm the receipt before granting the new amount. The examples can differ in optional behavior such as whether a maximum-uint256 allowance is consumed; this walkthrough uses ordinary, finite allowances. ## What was tested **Author verification, 23 November 2026:** all seven sources compiled twice with the pinned Studio compilers, producing identical creation bytecode for each language. Every example then passed **35 execution steps** in the node's EVM or WASM engine at Core revision `f5d9ce2c6d67e2cb2ae95b93526b284e6fab9dd3`, matching the Core bundled with wallet 0.8.21. Mint event contents and transfer/approval topics and values were checked. The suite covered metadata, supply, balances, transfers, self-transfers, zero-value transfers, approvals, `transferFrom`, allowance consumption and revocation, insufficient balances/allowances, failed-call storage rollback, zero recipients/spenders, malformed arguments, unknown selectors and attached native value. Negative tests required a contract revert; invalid jumps and out-of-gas failures did not count as a pass. These were disposable VM tests, without broadcasting a deployment to any public chain. They do not establish a security audit, a live deployed address, a completed wallet UI flow or release-gate acceptance. The source bundle contains the exact tested examples. The separate [Foundry tutorial](../../getting-started/create-token.md) retains its existing owner-mintable `PQToken`; it is a different example from these fixed-supply tokens. # Standard ecosystem contracts (Multicall3, Permit2, CREATE2 factory, tWPQAI) # Standard ecosystem contracts Most Ethereum tooling assumes that a handful of contracts exist **at the same address on every EVM chain**. Wallets batch reads through Multicall3, DEXes and aggregators use Permit2 for approvals, deployment tools use the CREATE2 factory to give contracts the same address everywhere, and DeFi expects a wrapped ERC-20 version of the native coin. PQWERAI provides all four (CR-0083), so these tools work without PQWERAI-specific configuration. !!! warning "Chain 20778: deployed 27 November 2026" All four contracts were **deployed on chain 20778** on 27 November 2026 (blocks 187-194); the deployment tool re-read every runtime and compared it with the built artifact (verify PASS). This is an author record, not an independent audit. Check the code at each address yourself with `eth_getCode` or on the [explorer](https://explorer.pqwerai.com) before you rely on it. | Contract | Address on chain 20778 | What it is for | |---|---|---| | Deterministic deployment proxy | `0x4e59b44847b379578588920cA78FbF26c0B4956C` | CREATE2 factory used by Foundry (`forge create --salt`, `CREATE2_FACTORY`), Hardhat Ignition and Safe tooling | | Multicall3 | `0xcA11bde05977b3631167028862bE2a173976CA11` | Batches many `eth_call` reads into one; used by viem, ethers, wagmi, Uniswap and most dapp front ends | | Permit2 | `0x000000000022D473030F116dDEE9F6B43aC78BA3` | Uniswap's signature-based token approvals; used by Uniswap, 1inch, 0x, CowSwap and other routers | | tWPQAI (Wrapped tPQAI) | `0xae14c8C74ff10F7fe43E7ADe4306E5257fdA02b4` | ERC-20 version of the native tPQAI coin, 1:1, WETH9-compatible interface | !!! info "Testnet" Testnet coins carry a "t": tPQAI and tWPQAI have no value. Because the deployments are deterministic, the proxy, Multicall3 and Permit2 addresses are the same on chain 20778 and are expected to be the same on a future mainnet; the mainnet wrapped coin (WPQAI, wrapping mainnet PQAI) is a different build and gets its own address. Chain 20778 has no legacy wrapper: tWPQAI is the only wrapped coin. ## Why the addresses match Ethereum The deterministic deployment proxy and Multicall3 are deployed with their authors' **pre-signed transactions**: a transaction signed once, by a key nobody holds, without a chain id. Anyone can submit it on any chain after funding the one-time deployer address, and the contract lands at the same address as on Ethereum. Permit2 is deployed through the proxy with Uniswap's original salt and creation code, so its address also matches. The deployed runtime bytes are checked against Ethereum mainnet (Permit2 differs only in its chain-id-specific immutables, which are checked through `DOMAIN_SEPARATOR()`). The bytes, their sources and licenses (Unlicense, MIT, MIT) are kept unmodified in `contracts/canonical/upstream/` with a provenance file; `contracts/canonical/build.py --verify-upstream` re-checks every signer and derived address offline. ## tWPQAI tWPQAI holds native tPQAI and issues the same amount of tWPQAI. It has the WETH9 interface, so anything written for WETH works unchanged: | Function | Effect | |---|---| | `deposit()` payable, or plain transfer of tPQAI to the contract | Mint tWPQAI 1:1 to the sender | | `withdraw(uint256 wad)` | Burn `wad` tWPQAI and send `wad` tPQAI back | | `transfer`, `transferFrom`, `approve`, `allowance`, `balanceOf`, `totalSupply` | Standard ERC-20; `approve(spender, type(uint256).max)` is an unlimited allowance | | Events | `Transfer`, `Approval`, `Deposit`, `Withdrawal` (same signatures as WETH9) | Two deliberate differences from WETH9: `withdraw` sends tPQAI with `call` rather than `transfer`, so smart-contract wallets (Safe, account-abstraction wallets) can unwrap; and `totalSupply` counts deposits instead of reading the contract balance, so tPQAI forced into the contract cannot inflate it. There is no owner, upgrade, pause or fee. === "viem" ```ts import { createPublicClient, http, parseAbi } from "viem"; const pqwerai = { id: 20778, name: "PQWERAI Testnet 20778", nativeCurrency: { name: "tPQAI", symbol: "tPQAI", decimals: 18 }, rpcUrls: { default: { http: ["https://rpc-testnet.pqwerai.com"] } }, contracts: { multicall3: { address: "0xcA11bde05977b3631167028862bE2a173976CA11" } }, } as const; const client = createPublicClient({ chain: pqwerai, transport: http() }); const tWPQAI = "0xae14c8C74ff10F7fe43E7ADe4306E5257fdA02b4"; const abi = parseAbi(["function balanceOf(address) view returns (uint256)", "function totalSupply() view returns (uint256)"]); // One RPC request, thanks to Multicall3: const [supply, mine] = await client.multicall({ contracts: [ { address: tWPQAI, abi, functionName: "totalSupply" }, { address: tWPQAI, abi, functionName: "balanceOf", args: ["0xYourAddress"] }, ]}); ``` === "Foundry" ```bash # Deterministic address on every PQWERAI network through the CREATE2 proxy: SALT=0x0000000000000000000000000000000000000000000000000000000000000001 forge create src/MyContract.sol:MyContract --rpc-url https://rpc-testnet.pqwerai.com \ --salt $SALT --private-key $KEY # Wrap 0.1 tPQAI (tWPQAI on 20778): TWPQAI=0xae14c8C74ff10F7fe43E7ADe4306E5257fdA02b4 cast send $TWPQAI "deposit()" --value 0.1ether \ --rpc-url https://rpc-testnet.pqwerai.com --private-key $KEY ``` ## Not yet available | Contract | Status | |---|---| | Safe (multisig) at its canonical addresses | Needs the Safe singleton factory, which Safe deploys per chain on request | | CreateX | Pending a license decision (AGPL-3.0) | Until then, Safe contracts can be deployed through the deterministic deployment proxy at non-canonical addresses. ## Compiler settings Chain 20778 supports `PUSH0` (Shanghai) and Cancun's `TSTORE`/`TLOAD` (EIP-1153) and `MCOPY` (EIP-5656), but not the blob opcodes (`BLOBHASH`, `BLOBBASEFEE`), the EIP-6780 `SELFDESTRUCT` change or anything from Prague onwards. Compile with `evmVersion: "shanghai"` (what the PQWERAI system contracts use), or `"cancun"` if the code uses no blob opcodes and does not depend on `SELFDESTRUCT` semantics. Solidity 0.8.30 and later default to Prague, so set the EVM version explicitly. See [Solidity](../languages/solidity.md). # ERC-1155 multi-tokens # ERC-1155 multi-tokens [ERC-1155](https://eips.ethereum.org/EIPS/eip-1155) manages many token IDs (fungible or unique) in one contract. Deployment, minting and transfer are tested in [Create NFTs](../../getting-started/create-nfts.md). ```solidity title="PQItems.sol" --8<-- "nft/src/PQItems.sol" ``` - `uri(id)` returns a template; clients replace `{id}` with the 64-character lower-case hex ID. - `safeBatchTransferFrom` and `balanceOfBatch` move or read many IDs in one call. - Events: `TransferSingle`, `TransferBatch`, `URI`. !!! warning "Tooling limits on PQWERAI today" The explorer does not decode ERC-1155 events yet. The wallet includes a Studio template; comprehensive Tokens-page balance display is a separate feature. Read balances with `balanceOf(account, id)` until support ships. # ERC-20 tokens # ERC-20 tokens For complete fixed-supply examples in **all seven languages**, use [Basic token in every language](basic-token-all-languages.md). The `PQToken` example below is the separate owner-mintable Foundry tutorial. Fungible tokens follow [ERC-20](https://eips.ethereum.org/EIPS/eip-20) unchanged. Tested end to end in [Create a token](../../getting-started/create-token.md). ```solidity title="PQToken.sol" --8<-- "token/src/PQToken.sol" ``` | Function / event | Notes | |---|---| | `balanceOf`, `totalSupply`, `decimals` | `decimals()` is display-only; on-chain amounts are integers | | `transfer`, `transferFrom` | Emit `Transfer(from, to, value)` | | `approve`, `allowance` | Emit `Approval`; prefer exact amounts — the Windows Wallet warns on unlimited approvals | | Mint / burn | `Transfer` from / to the zero address | ## Support on PQWERAI - **Windows Wallet:** discovers balances, transfers, and warns about native-tPQAI impostors and hidden characters. - **Explorer:** indexes ERC-20 `Transfer` events (`/api/v1/tokens`, `/api/v1/address/{address}`). - **Native tPQAI is not an ERC-20.** The WETH9-style wrapper is tWPQAI; see [standard contracts](canonical-contracts.md). - **Permit (EIP-2612)** works (it only needs `ecrecover` and the chain ID); a Studio wizard is unreleased. # ERC-721 NFTs # ERC-721 NFTs Unique tokens follow [ERC-721](https://eips.ethereum.org/EIPS/eip-721). Tested in [Create NFTs](../../getting-started/create-nfts.md). ```solidity title="PQCollection.sol" --8<-- "nft/src/PQCollection.sol" ``` - `tokenURI(id)` returns `baseURI + id`; host JSON metadata on IPFS or HTTPS. The chain stores only the URI. - `_safeMint`/`safeTransferFrom` revert with `ERC721InvalidReceiver` if a receiving contract lacks `onERC721Received`. - `Transfer(from, to, tokenId)` has `tokenId` indexed; the explorer uses this to index NFT transfers. - The Windows Wallet lists ERC-721 tokens it discovers and transfers them; its Studio *NFT collection* template deploys an equivalent OpenZeppelin collection without code. # Contract events # Contract events ```solidity event Tipped(address indexed from, address indexed to, uint256 amount, uint256 fee); emit Tipped(msg.sender, to, msg.value, fee); ``` - Up to three `indexed` parameters become topics (filterable); the rest is ABI-encoded `data`. - `topic0` is `keccak256("Tipped(address,address,uint256,uint256)")` (not for `anonymous` events). - Emit events **before** external calls (checks-effects-interactions). ## Reading events ```bash cast logs --from-block --to-block --address "Tipped(address indexed,address indexed,uint256,uint256)" --rpc-url "$RPC" ``` PQWERAI limits: | Limit | Value | |---|---| | `eth_getLogs` block range | ≤ 5000 blocks per request by default (`--rpc.logs-max-range`) | | `eth_getFilterLogs` | disabled — use `eth_getLogs` or `eth_getFilterChanges` | | WebSocket `eth_subscribe("logs")` | not available (HTTP only) — poll | | Reorganisations | logs above `g4_status.finalized_height` can be removed; `removed: true` appears in filter results | For history beyond a few thousand blocks, page through ranges or use the [explorer API](../../explorer/index.md). # Solidity library compatibility # Solidity library compatibility | Library type | How it works | On PQWERAI | |---|---|---| | `internal` functions (e.g. `Fees.bps`, OpenZeppelin `Math`) | Inlined into the contract; no deployment | ✅ Tested in `TipJar` | | `public`/`external` library functions | Deployed separately; the contract is linked to the library address | ✅ Standard EVM `DELEGATECALL`; link with `forge create --libraries src/L.sol:L:` | | OpenZeppelin Contracts 5.0.2 | Source-level dependency | ✅ ERC-20/721/1155, Ownable, Ownable2Step, AccessControl, Math tested | | OpenZeppelin ≥ 5.1 | Uses `MCOPY`/`PUSH0` depending on target | Compiles for `cancun`; not tested for this release | Compatibility rules: 1. Compile with an EVM target the chain supports (`cancun` or lower) — see [EVM compatibility](../../blockchain/evm-compatibility.md). 2. Avoid libraries that use `blobhash`, `block.blobbasefee` or EIP-7702 delegation — they cannot work here. 3. Libraries that read `block.prevrandao` for randomness are unsafe on PoW chains. 4. Pin library versions (git tag or lockfile); the Wallet Studio uses a bundled OpenZeppelin 5.0.2 so that compilation needs no network and is reproducible. # Payable functions # Payable functions Native tPQAI behaves exactly like ether in the EVM: `msg.value` is in wei (1 tPQAI = 10^18 wei). ```solidity function tip(address to) external payable { … } // accepts tPQAI with a call receive() external payable { … } // plain transfers with empty calldata ``` - A non-payable function reverts if `msg.value > 0`. - **Pull, don't push.** Credit balances and let recipients `withdraw()`; set state to zero before sending (`TipJar.withdraw`, `ServiceEscrow.withdraw`). A recipient that reverts then cannot block others. - Use `call{value: amount}("")` and check the result; `transfer`/`send` forward only 2300 gas. - The tested [`TipJar`](access-control.md) shows a payable function, a basis-point fee via a library and a pull withdrawal. - `SELFDESTRUCT` can force tPQAI into a contract without calling it; never rely on `address(this).balance` for accounting. # QAI post-quantum testnet token # QAI: post-quantum testnet token !!! warning "Testnet only, valueless" tQAI (the testnet QAI token; on-chain symbol `tQAI`) and tEUR are **valueless test assets** on testnet 20778. tQAI is not money, not a stablecoin and cannot be redeemed for real euros; it is not offered for sale. Nothing in this guide promises a price, a minimum price or a return. !!! note "Economy under redesign (CR-0136)" PQWERAI is removing its own euro token. The tEUR bonding curve and the paused 120% reserve stack below stay on chain as **legacy test contracts** and behave exactly as coded, but they are no longer the target design. Euro and dollar value is planned to come only from external, issuer-authorized stablecoins (USDC, EURC) through a bridge, which is not implemented yet. The new QAI model has not been decided. The post-quantum accounts, keys and recovery described here are unaffected. ## Contracts on testnet 20778 | Contract | Address | | --- | --- | | QAI bonding curve (legacy test contract; **buys paused** since block 5,112, tx `0x6991c8a2…cea2`; sells stay open) | `0xb56aD500C2750D7cDc434e70fA73e39090353fd1` | | Curve QAI token (`tQAI`, 6 decimals; legacy) | `0x52C2839432783637C563322C7D4cb34EBADfB6c3` | | tEUR test euro (`tEUR`, 18 decimals, faucet; legacy) | `0x7D7409F65e2C0286D2C7705A714941A6fc4768Fc` | | 120% stack QAI token (legacy, minting paused) | `0x520AA82aec3a82dF8C9D3F5aFa940245B6E0115B` | | QuantumAccountRegistry | `0x5719E5c0f0D42efa6F14DD3eDF289cFb219d0421` | | ML-DSA-65 / SLH-DSA-192s verifiers | `0xdA4182Fa0a69a57573a03DD5db924533C0589139` / `0x8779Fd4Cd289a652837dd2c4ad052b6DFD9d1d6D` | | QuantumReserve (tPQAI treasury, pinned in genesis) | `0xcebDE02DF19270F4E56423607806AAeC6561A945` | Addresses come from the 20778 deployment record. Public JSON-RPC: `https://rpc-testnet.pqwerai.com`. ## What is different about QAI On most EVM chains a token transfer is authorized by an ECDSA signature: the sender's account signs the transaction. A large enough quantum computer could forge ECDSA signatures. A QAI balance belongs to a **Quantum Smart Account** (a 32-byte account ID), not to an `0x…` address. Every action on a balance needs a signature from a standardized post-quantum scheme: | Key | Algorithm | Used for | | --- | --- | --- | | Operational key | ML-DSA-65 (FIPS 204) | transfers, redemption requests, approvals, routine key rotation | | Recovery key | SLH-DSA-SHAKE-192s (FIPS 205) | replacing a lost or stolen operational key, after a delay | | Messaging key (optional) | ML-KEM-768 (FIPS 203) | encrypting backups and messages to a recipient | The transaction that carries a QAI signature is still an ordinary PQWERAI transaction. Anyone can send it, for example a relayer, and that sender only pays the tPQAI gas. Neither the transaction sender nor any `0x…` address has authority over QAI. QAI has no `approve` or `transferFrom`, and no owner or admin address. !!! note "What is not post-quantum" QAI authorization is post-quantum. The PQWERAI chain as a whole is **not**: ordinary tPQAI transactions (ECDSA), Smartnode votes (Ed25519) and peer-to-peer transport still use classical cryptography. See the security and migration report in the repository (`audit/QAI_PQ_SECURITY_AND_MIGRATION_2026-11-12.md`). ## Keys and the wallet The `qai-wallet` command-line tool (`qai/wallet` in the repository) creates and stores your keys: ```text qai-wallet keygen -kind operational -out op.json -password-file op.pw qai-wallet keygen -kind recovery -out rec.json -password-file rec.pw ``` - Each key is stored encrypted: Argon2id (256 MiB) derives a key from your passphrase, and AES-256-GCM encrypts the key file. Passphrases are read only from files, never from command arguments. - Use **different passphrases**, and keep the recovery key **offline** and separate from the operational key. It exists to rescue the account when the operational key is lost. - Back up the recovery key by sealing it to an ML-KEM-768 key that you keep elsewhere: `qai-wallet seal …` / `qai-wallet open …`. - `qai-wallet destroy -keystore FILE -confirm DESTROY` overwrites and deletes a key file. If no other copy of that key exists, you cannot undo this. The wallet builds every message it signs **locally**, from your inputs plus a pinned `chain.json` (chain ID, genesis hash, registry address). It never signs bytes supplied by a node or a relayer, so they cannot change what you approve. ## Using an account 1. **Create**: `qai-wallet create -chain chain.json -op op.json … -recovery rec.json …` prints your account ID and the arguments for `QuantumAccountRegistry.createAccount`. Both keys prove possession by signing the creation message. 2. **Transfer**: `qai-wallet transfer … -to -amount -nonce -key-version ` prints the arguments for `QAIToken.transfer`. A relayer submits them. If you pay the relayer, the fee and the fee recipient are part of what you sign, so the relayer cannot change them. 3. **Sell back to the curve**: `qai-wallet curve-sell … -curve -amount -min-out -pay-to -nonce -key-version ` prints the arguments for `QAIBondingCurve.sell`. Any relayer can submit them; the tEUR goes to the `-pay-to` address you signed. Every signature is bound to the chain ID, the genesis hash, the registry and the contract it is meant for. It carries your account's next nonce and expires after at most 24 hours. A signature cannot be replayed, reused on another chain or contract, or kept for later use. ## Recovery If you lose your operational key, `qai-wallet recover` signs with your recovery key and with a new operational key. After the account's recovery delay (at least one hour; you choose it when you create the account), anyone can finalize the change. While a recovery is pending, **all ordinary operations of the account are frozen**. If someone steals your recovery key and starts a recovery, cancel it with your operational key (`qai-wallet cancel-recovery`). The account stays frozen for a cooldown period after a cancellation. Then replace the stolen recovery key: this needs your operational key **and** the old recovery key. ## How QAI is issued: the bonding curve QAI exists only when someone pays for it. The curve contract is the token's only minter. | Rule | Value | | --- | --- | | Base curve | 1 tEUR per tQAI at zero supply, +0.10 tEUR for every 1,000,000 tQAI in circulation: `base(s) = 1e12·s + s²/20` tEUR wei, `s` in 6-decimal units | | Floor multiplier `k` | starts at 1.0 (`1e18`); the code never lowers it (contract behaviour, not a price promise) | | Buy `n` | pay `ceil(k·(base(s+n) − base(s)))` + 0.5% fee | | Sell `n` | receive `floor(k·(base(s) − base(s−n)))` − 0.5% fee | | After every trade | `k = max(k, reserve / base(supply))` | Every payment and every fee stays in the curve's reserve and creates no QAI, so each trade raises `k`. The contract quotes sells from `k`; `floorPrice()` returns `k × 1 tEUR`, the quote at zero supply. This describes how the legacy test contract computes its quotes. It is not a price, a floor or a redemption promise: tQAI and tEUR have no monetary value, buys on this curve are paused since block 5,112, and the QAI economy is being redesigned. What nobody can do: - **mint without paying**: there is no other mint path; the founder holds no QAI and has no special key; - **withdraw**: tEUR leaves the curve only when a holder sells; there is no fee pot and no withdrawal function; - **stop sellers**: 2-of-3 ML-DSA-65 governors can only pause *buys*; sells can never be paused, and governors cannot change the formula, `k`, the reserve or anyone's balance. ### Get tEUR and buy QAI tEUR is an ordinary ERC-20 test token: any address can claim 1,000 tEUR once per UTC day. ```bash RPC=https://rpc-testnet.pqwerai.com TEUR=0x7D7409F65e2C0286D2C7705A714941A6fc4768Fc # legacy tEUR on 20778 CURVE=0xb56aD500C2750D7cDc434e70fA73e39090353fd1 # legacy curve on 20778; buys paused since block 5,112, so buy() is refused cast send $TEUR "faucet()" --rpc-url $RPC --private-key $KEY cast send $TEUR "approve(address,uint256)" $CURVE 1000000000000000000000 --rpc-url $RPC --private-key $KEY cast call $CURVE "quoteBuy(uint256)(uint256,uint256)" 1000000 --rpc-url $RPC # cost and fee for 1 tQAI cast send $CURVE "buy(bytes32,uint256,uint256)" $QAI_ACCOUNT_ID 1000000 $MAX_PAY --rpc-url $RPC --private-key $KEY cast call $CURVE "floorPrice()(uint256)" --rpc-url $RPC # k × base price at zero supply, tEUR wei (as computed by the contract) ``` The QAI go to a Quantum Smart Account (`$QAI_ACCOUNT_ID`, created with `qai-wallet create`), never to the `0x` address that paid. `maxPay` protects you if the price moves before your transaction is mined. ### The 120% reserve stack (paused) Before the curve, QAI was designed to be minted only against attested (simulated) customer euros with 120% coverage (`QuantumMintController`, `QuantumReserveVault`, `QuantumRedemptionManager`, `QuantumBurnController`). On chain 20778 it was deployed on 27 November 2026 as a legacy test contract with minting paused; the economy is under redesign. ## Costs | Action | Gas | | --- | --- | | Create account (ML-DSA and SLH-DSA proofs of possession) | ~691 000 (measured before the chain 20778 launch) | | Transfer (relayed, with fee) | ~204 000 (local fixture) | | Buy on the curve | ~200 000 (measured before the chain 20778 launch) | | Sell to the curve (ML-DSA-65 signed) | ~229 000 (measured before the chain 20778 launch) | | Start recovery (SLH-DSA) | ~657 000 (local fixture) | These figures assume the native `pq-verify/v1` precompiles. Without them, verifying ML-DSA in contract code costs about 21.6 million gas per signature, more than a block can hold. # Language center # EVM language center For a complete ERC-20 example in Solidity, Vyper, Yul, Huff, Fe, C++ or C#, use [Basic token in every language](../guides/basic-token-all-languages.md). These five languages target the EVM. For C++ and C# targeting WebAssembly, use the [WASM language guides](../wasm/index.md) and [first WASM contract](../wasm/first-contract.md). Each tab is the same contract — `increment()` (emits `Incremented(uint256)` where the language supports events), `get() returns (uint256)` — so you can compare languages on identical behaviour. Selecting a tab switches every tab group on the site. === "Solidity" ```solidity --8<-- "languages/Counter.sol" ``` === "Vyper" ```python --8<-- "languages/Counter.vy" ``` === "Yul" ```javascript --8<-- "languages/Counter.yul" ``` === "Huff" ```text --8<-- "languages/Counter.huff" ``` === "Fe" ```rust --8<-- "languages/Counter.fe" ``` ## Measured on a local test chain All five were compiled with the pinned toolchains (target `cancun`), deployed, incremented once and read back by the script below on a disposable local testnet. | Language | Runtime bytes | Deployment gas | `increment()` gas | `get()` after one increment | |---|---:|---:|---:|---:| | Solidity 0.8.26 (optimizer 200, no metadata hash) | 288 | 115,466 | 44,587 | 1 | | Vyper 0.4.3 | 207 | 98,394 | 44,431 | 1 | | Yul (solc 0.8.26 `--strict-assembly --optimize`) | 93 | 73,278 | 44,248 | 1 | | Huff Neo 1.7.1 | 98 | 74,312 | 44,252 | 1 | | Fe 26.5.1 (pre-1.0 upstream) | 99 | 77,010 | 43,304 | 1 | `increment()` cost is dominated by the cold `SSTORE` from zero to one (~22,100 gas) plus the 21,000 transaction base; the Solidity and Vyper versions also store an immutable `creator` at deployment. Fe's counter emits no event, which is why its call is cheaper — compare behaviour, not just numbers. ```bash title="languages/build-and-deploy-all.sh" --8<-- "languages/build-and-deploy-all.sh" ``` ## Choosing a language | Need | Choose | |---|---| | OpenZeppelin, audits, largest ecosystem | Solidity | | Fewer footguns, readable code, no inline assembly | Vyper | | Tight control in a few hot paths | Yul (inline in Solidity or standalone) | | Maximal control over every opcode | Huff — only with expert review | | Research on new language designs | Fe — supported but pre-1.0 upstream, never value-bearing | JavaScript, TypeScript and Python are **application** languages on PQWERAI: they build transactions and read state, they do not run on chain ([details](../application-languages.md)). # Fe on PQWERAI # Fe !!! warning "Pre-1.0 language" Since 14 November 2026 Fe is a supported Contract Studio language: the pinned compiler 26.5.1 passes the conformance suite against the chain's own EVM. Fe itself is still pre-1.0 upstream and its syntax changes between releases, and no independent security review has been done. Do not deploy value-bearing Fe contracts. | | | |---|---| | Compiler | Fe 26.5.1 (`149c758`); Windows exe SHA-256 `7fe5339c…85d5f` | | Output | `out/.bin`, `.runtime.bin`, `.abi.json` | | Status | Counter compiles, deploys and runs before the chain 20778 launch (CLI and Contract Studio); same EVM rules on chain 20778. No events in the example. | ## Example ```rust title="Counter.fe" --8<-- "languages/Counter.fe" ``` ## Build and deploy ```bash fe build --standalone Counter.fe # writes out/Counter.bin, out/Counter.runtime.bin, out/Counter.abi.json TX=$(cast send --async --keystore "$KEYSTORE" --password-file "$PASSWORD_FILE" --rpc-url "$RPC" --create "0x$(cat out/Counter.bin)") cast receipt "$TX" contractAddress --rpc-url "$RPC" ``` Measured: 99 runtime bytes, 77,010 deployment gas, 43,304 gas for `increment()`. ## Caveats - Language semantics may change in the next release; pin the compiler and keep the exact version with your sources. - Few auditors and analysis tools support Fe. - The ABI JSON comes from the compiler's `msg` selectors; check it against the selectors you expect. # Huff on PQWERAI # Huff | | | |---|---| | Compiler | Huff Neo `hnc` 1.7.1 (rev `2fe1d0c9`); Windows zip SHA-256 `d5ae8002…de6f4`, exe `21c50d09…5464` | | EVM target | `-e cancun` (the default `osaka` is newer than the chain) | | ABI | From `#define function` / `#define event` declarations | | Status | 🧪 CLI compile, deploy and call tested before the chain 20778 launch (same EVM rules on chain 20778). Wallet Studio Huff support exists only on an unreleased branch. | ## Install Download Huff Neo 1.7.1 from its GitHub releases ([cakevm/huff-neo](https://github.com/cakevm/huff-neo)), verify the SHA-256 above, and put `hnc` on your PATH. ## Example ```text title="Counter.huff" --8 Counter.bin # creation bytecode hnc Counter.huff -r -e cancun | tail -n 1 # runtime bytecode (for verification) TX=$(cast send --async --keystore "$KEYSTORE" --password-file "$PASSWORD_FILE" --rpc-url "$RPC" --create "0x$(cat Counter.bin)") cast receipt "$TX" contractAddress --rpc-url "$RPC" ``` Measured: 98 runtime bytes, 74,312 deployment gas, 44,252 gas for `increment()`. ## Caveats - Huff gives you the stack and nothing else: no type checks, no overflow checks, no ABI decoding. - Every macro must leave the stack balanced; one wrong jump label can make funds unreachable. - Treat Huff contracts as requiring expert review and extensive tests (Foundry can test Huff bytecode). # Solidity on PQWERAI # Solidity | | | |---|---| | Pinned compiler | `0.8.26+commit.8a97fa7a` (Linux binary SHA-256 `d5f23436…49ef`; Windows `537fd8d8…eb67`) | | EVM target | `cancun` (or `london`); never `blobhash()` / `block.blobbasefee` | | Libraries | OpenZeppelin Contracts 5.0.2 (MIT) — the version the Wallet Studio templates use | | Status | ✅ Tested: Foundry deploy/verify/call, ERC-20/721/1155, Wallet Studio | ## Install ```bash curl -L https://foundry.paradigm.xyz | bash && foundryup --install 1.8.5 # Foundry # forge fetches solc 0.8.26 automatically when foundry.toml pins solc_version; offline: FOUNDRY_SOLC=/path/to/solc ``` ## Project structure and config ```toml title="foundry.toml" --8 Counter.abi.json forge inspect Counter gasEstimates # compiler estimates; real gas: see the measured table forge create src/Counter.sol:Counter --broadcast --keystore "$KEYSTORE" --password-file "$PASSWORD_FILE" --rpc-url "$RPC" ``` Plain `solc`: `solc --evm-version cancun --optimize --metadata-hash none --bin --abi Counter.sol -o out`. ## Gas and deployment cost Measured: 115,466 gas to deploy the counter, 44,587 for the first `increment()` ([table](index.md#measured-on-a-local-test-chain)). Cost in tPQAI = gas × (base fee + tip); with a base fee of a few wei, testnet deployment costs are negligible. ## Verification Byte-for-byte runtime comparison, masking immutables: [Verification](../verification.md). ## Security caveats - 0.8.x checked arithmetic reverts on overflow; `unchecked` blocks remove that protection. - Do not use `block.prevrandao`/`block.difficulty` as randomness: on PQWERAI it is the PoW difficulty. - `tx.origin` authentication, unbounded loops over user-controlled arrays, and reentrancy before state updates are the usual sources of loss — use checks-effects-interactions and pull payments (as `ServiceEscrow` does). - solc is GPL-3.0; your contract's license is your choice. Example repository: `developers/examples/first-contract/`, `token/`, `nft/` in the PQWERAI-testnet repository. # Vyper on PQWERAI # Vyper | | | |---|---| | Pinned compiler | `0.4.3+commit.bff19ea2` (Windows exe SHA-256 `4878e251…7c9a`) | | EVM target | `--evm-version cancun` (or `london`) | | Status | ✅ Tested: compile, deploy, call before the chain 20778 launch (CLI; same EVM rules on chain 20778); Wallet Studio Vyper support is on an unreleased branch | ## Install ```bash python3 -m venv .venv && . .venv/bin/activate pip install vyper==0.4.3 vyper --version # 0.4.3+commit.bff19ea2 ``` The pinned Vyper LICENSE contains terms beyond stock Apache-2.0; read it before redistributing the compiler. ## Example ```python title="Counter.vy" --8 Counter.bin vyper -f abi Counter.vy > Counter.abi.json # Vyper generates the ABI TX=$(cast send --async --keystore "$KEYSTORE" --password-file "$PASSWORD_FILE" --rpc-url "$RPC" --create "$(cat Counter.bin)") cast receipt "$TX" contractAddress --rpc-url "$RPC" ``` Measured: 207 runtime bytes, 98,394 deployment gas, 44,431 gas for `increment()`. ## Security caveats - Vyper had compiler bugs in older versions (notably reentrancy-lock miscompilation in 0.2.15–0.3.0); stay on the pinned version and read its advisories. - `@nonreentrant` and bounded loops are language features — use them rather than hand-rolled guards. - Verification works the same way as Solidity (compare runtime bytes; Vyper immutables are appended to runtime code). # Yul on PQWERAI # Yul | | | |---|---| | Compiler | solc 0.8.26 `--strict-assembly` | | EVM target | `--evm-version cancun` | | ABI | **None generated** — you write the dispatcher and declare the ABI yourself | | Status | ✅ Tested: compile, deploy, call | ## Example The `// @abi` comments are the convention the Wallet Studio reads to build a call interface for Yul and Huff. ```javascript title="Counter.yul" --8 Counter.bin TX=$(cast send --async --keystore "$KEYSTORE" --password-file "$PASSWORD_FILE" --rpc-url "$RPC" --create "0x$(cat Counter.bin)") ADDR=$(cast receipt "$TX" contractAddress --rpc-url "$RPC") cast send "$ADDR" "increment()" --keystore "$KEYSTORE" --password-file "$PASSWORD_FILE" --rpc-url "$RPC" cast call "$ADDR" "get()(uint256)" --rpc-url "$RPC" ``` Manual ABI for tools (`Counter.abi.json`): ```json [{"type":"function","name":"increment","inputs":[],"outputs":[],"stateMutability":"nonpayable"}, {"type":"function","name":"get","inputs":[],"outputs":[{"name":"","type":"uint256"}],"stateMutability":"view"}, {"type":"event","name":"Incremented","inputs":[{"name":"value","type":"uint256","indexed":false}],"anonymous":false}] ``` Measured: 93 runtime bytes, 73,278 deployment gas, 44,248 gas for `increment()`. ## Caveats - No overflow checks, no ABI decoding, no reentrancy protection unless you write them. - Selectors and event topics are hard-coded; a typo silently breaks the interface — test every function. - Prefer Yul *inside* Solidity (`assembly { … }`) for a few hot paths over whole-contract Yul. # Contract verification # Contract verification This page covers EVM runtime bytecode. **C++ and C# WASM contracts** use a deployment module hash; follow [WASM deployment and verification](wasm/deployment-and-verification.md). !!! note "No explorer verification service yet" The PQWERAI explorer does not accept or display verified source code. Until it does, verification means anyone can rebuild your published source and get the exact bytes deployed on chain. ## Procedure 1. Publish the source, the exact compiler version (`0.8.26+commit.8a97fa7a`), and all settings (optimizer runs, `evmVersion`, `bytecode_hash`/metadata, remappings, library versions). 2. Rebuild and compare the runtime code with `eth_getCode`, copying only the immutable ranges the compiler reports. ```bash title="verify.sh" --8<-- "first-contract/verify.sh" ``` ```text VERIFIED: 288 runtime bytes match (32 immutable bytes taken from chain) ``` ## Tips - `bytecode_hash = "none"` (or `--metadata-hash none`) removes the CBOR metadata hash, whose value changes with comments and file paths. Without it you must publish the exact metadata JSON as well. - Vyper appends immutables to the end of runtime code; Huff/Yul have no immutables unless you write them. - For libraries, the linked address is part of the bytes; publish it. - The Windows Wallet Studio applies the corresponding EVM bytecode or WASM module-identity check after deployment. # WASM smart contracts # WASM smart contracts Build a fixed-supply ERC-20 with the complete [C++ and C# token examples](../guides/basic-token-all-languages.md), alongside the five EVM versions. PQWERAI supports **WebAssembly contracts alongside EVM contracts**. Contract Studio builds C++ and a defined C# subset into modules for **WASM VM v1** (`wasm-vm/v1`). They use the same accounts, tPQAI balances, contract storage, transactions, receipts and Solidity ABI as EVM contracts. WASM VM v1 is an **official required Core feature**. The public chain **20778** profile enables it from block 0. Use **Check connected chain** in Studio to confirm the connected node supports it before deploying. Connect through the [public testnet RPC](../../blockchain/network-parameters.md) or your own compatible node. Feature support and local tests do not establish public release acceptance. ## Start building 1. Follow [Your first WASM contract](first-contract.md) to compile, simulate, deploy and call a counter. 2. Choose the [C++ guide](cpp.md) or [C# guide](csharp.md) for compiler setup and language limits. 3. Use [ABI, storage and host functions](abi-and-host.md) when adding arguments, events or contract calls. 4. Follow [Deployment and verification](deployment-and-verification.md) to understand artifacts, module identity and errors. ## Which languages run where? | Source language | Output | Current authoring path | |---|---|---| | Solidity, Vyper, Yul, Huff, Fe | EVM bytecode | [EVM language center](../languages/index.md); Fe remains tied to its pre-1.0 compiler pin | | C++ | WebAssembly | Studio, clang from wasi-sdk 34, freestanding SDK header | | C# | WebAssembly | Studio, Roslyn followed by the wallet's IL-to-WASM translator | | C, Rust, Go, AssemblyScript and other WASM targets | No supported Studio adapter in this source revision | A generic `.wasm` file is not enough; a compatible adapter, ABI, imports and validation are required | | JavaScript, TypeScript, Python | Application code outside the node | [Application languages](../application-languages.md) build and submit transactions | C# contracts do not load the .NET runtime on validators. Using wasi-sdk to compile C++ does not provide WASI services: the contract imports the `pqwerai` host interface, with no filesystem or network access. ## Execution model The node validates modules at deployment and meters execution. The supported profile uses integer operations, bounded memory and approved host imports; floating point, SIMD, threads and foreign imports are rejected. The VM memory cap is 16 MiB; Studio's C++ adapter currently chooses a smaller fixed 128 KiB memory. Contract memory is fresh on each invocation. Store persistent values through the storage host functions. EVM and WASM contracts can call each other through the same ABI. Cross-contract calls still require access control, reentrancy protection, return-value checking and gas limits. The guides describe the checked-in Studio implementation. Historical VM and language-conformance runs are separate from verification of these tutorial files; see the [verification limits](deployment-and-verification.md#verification-limits). # WASM ABI, storage and host functions # WASM ABI, storage and host functions WASM contracts use **the Solidity ABI**. The VM enters the exported `call` function and your dispatcher interprets calldata. It does not automatically turn C++ or C# methods into externally callable functions. ## Entry points and ABI declarations | Entry point | C++ | C# | Calldata | |---|---|---|---| | Regular call | `PQW_EXPORT("call") void call()` | `[Export("call")]` static void method | Four-byte selector, then ABI arguments | | Optional initialization | `PQW_EXPORT("deploy") void deploy()` | `[Export("deploy")]` static void method | ABI constructor arguments without a selector | Use `// @abi function ...`, `// @abi event ...`, `// @abi error ...` and `// @abi constructor(...)` comments to provide Studio's interface. A declaration such as `constructor(uint256 initialSupply)` adds a constructor input to the deployment form; your `deploy` implementation must decode and validate its raw argument bytes. The `RequireArgs` helpers include a four-byte selector in their size check, so they are for regular function calls, not constructor calldata. The tutorial's selectors are `0xd09de08a` for `increment()` and `0x6d4ce63c` for `get()`. Return values use standard ABI words. For example, returning the integer 1 means 31 zero bytes followed by `01`. Unknown selectors should revert unless you intentionally implement fallback or receive behavior. ## Validate inputs explicitly The `@abi` declarations describe the interface; they do not enforce `view`, `nonpayable` or argument validation. | Check | C++ helper | C# helper | |---|---|---| | At least `n` argument words after the selector | `pqw::require_args(n)` | `Sdk.RequireArgs(n)` | | Copy an argument word | `pqw::arg_word(i, out32)` | `Sdk.ArgWord(i, out32)` | | Address has zero upper 12 bytes | `pqw::arg_address(i, out32)` | `Sdk.ArgAddress(i, out32)` | | Reject attached tPQAI | `pqw::require_no_value()` | `Sdk.RequireNoValue()` | | Finish with a word | `pqw::return_word(word32)` | `Sdk.ReturnWord(word32)` | | Finish with an ABI boolean | `pqw::return_bool(value)` | `Sdk.ReturnBool(value)` | Check length before copying arguments: missing calldata can read as zero. A clean ABI address check does not reject the zero address; apply your own recipient or access policy. Validate dynamic offsets, lengths, padding and bounds before reading arrays, bytes or strings. The presence of such types in an ABI does not create a dynamic decoder in the contract SDK. ## Storage and memory Storage keys and values are 32-byte words. Addresses are 20 bytes in host calls; in ABI words they occupy the low 20 bytes with 12 leading zero bytes. Contract memory is fresh for every invocation. Use persistent storage for balances, counters and ownership; use transient storage only for transaction-scoped state. For Solidity-compatible mappings, `pqw::mapping_slot(key32, slot, out32)` / `Sdk.MappingSlot` computes `keccak256(key32 || uint256(slot))`. A nested mapping repeats that calculation using the first mapping's result as the next slot. Sharing a storage interface does not automatically make two contracts' layouts identical. ## Host interface All imports below belong to module **`pqwerai`**. Pointers are offsets into contract linear memory, not host addresses. The C++ header prefixes function names with `pqw_`; the C# SDK exposes the methods in `Host`. The table describes the current SDK surface, not an additional general WASI interface. | Import names | C# methods | Purpose and buffer shape | |---|---|---| | `calldata_size`, `calldata_copy` | `CalldataSize`, `CalldataCopy` | Input length; copy into destination using offset and byte count | | `storage_load`, `storage_store` | `StorageLoad`, `StorageStore` | 32-byte key and 32-byte value | | `transient_load`, `transient_store` | `TransientLoad`, `TransientStore` | Transaction-scoped 32-byte keys and values | | `caller`, `address`, `origin` | `Caller`, `Address`, `Origin` | Write a 20-byte address; use caller for immediate-sender authorization | | `callvalue`, `balance` | `CallValue`, `Balance` | Write a 32-byte amount; balance takes a 20-byte address | | `block_number`, `timestamp`, `chain_id`, `gas_left` | `BlockNumber`, `Timestamp`, `ChainId`, `GasLeft` | Integer chain context or remaining gas; timestamp is chain context, not a wall clock | | `keccak256` | `Keccak256` | Hash a byte buffer into a 32-byte destination | | `emit_log` | `EmitLog` | Contiguous 32-byte topics, topic count, data pointer and data length | | `call` | `Call` | 20-byte target, 32-byte value, calldata pointer/length, gas budget; returns success indicator | | `static_call` | `StaticCall` | Target, calldata pointer/length, gas budget; returns success indicator | | `delegate_call` | `DelegateCall` | Delegate using the current account's execution context; returns success indicator | | `return_data_size`, `return_data_copy` | `ReturnDataSize`, `ReturnDataCopy` | Inspect and copy the previous subcall's return or revert data | | `finish`, `revert` | `Finish`, `Revert` | End execution with returned bytes or revert bytes | ## Events and EVM interoperability For a non-anonymous event, topic 0 is `keccak256` of its canonical signature. The tutorial hashes `Incremented(uint256)` and passes that topic with a 32-byte value to `emit_log`. Indexed fields need their own topics; dynamic indexed values use the ABI's hash encoding. Wallets decode receipts using the declared ABI. An EVM caller uses the WASM contract's address and ABI as it would any other contract. A WASM caller ABI-encodes the selector and arguments for the target, then invokes `call` or `static_call`, checks success and validates the return data. Calls can target either VM. Apply checks, state updates and reentrancy protection before external interactions. Bound forwarded gas and return-data copies. Use `delegate_call` only with a deliberately shared layout and trusted target. Use `revert` to abort when a required subcall fails; do not assume a failed subcall automatically aborts its caller. Reverts roll back affected state and logs. Out-of-gas handling is part of VM execution, not a catchable C# exception. ## ERC-20 contracts Studio's C++ and C# ERC-20 examples use a `(uint256 initialSupply)` constructor and mint to the deployer. Their layout uses total supply in slot 0, balances in mapping slot 1 and allowances in mapping slot 2, with standard ABI functions and `Transfer` / `Approval` events. They are tutorial implementations, not OpenZeppelin libraries compiled to WASM. Review zero-address rules, overflow, authorization, allowance changes and hostile calldata before adapting them. See the [ERC-20 guide](../guides/erc20.md) for the application interface. # C++ WASM contracts # C++ WASM contracts Studio compiles freestanding C++ into WebAssembly using clang. The contract uses the injected **`pqwerai.h`** header for storage, calldata, events and calls; it does not link a C++ standard library or a WASI runtime. ## Compiler setup The checked-in Windows toolchain pin is **wasi-sdk 34**, clang **23.1.0**. Extract the complete SDK and choose its `bin/clang++.exe` in Studio. Keep the directory intact: the compiler also needs its linker and headers. The wallet does not install this large SDK through its normal in-app compiler download flow. The executable matching this pin reports `clang version 23.1.0-rc3`. Studio's reviewed archive SHA-256 is `cccb5c323a9b34f0349a9b09e8804a0a7632c68c3310f4b5f437ed57d7e71d8f`; its `clang++.exe` pin is `945cba19ec5c002628bb7d226d21a443198e5da5d9e5430fd2f61b9f143d5309`. These identify the wallet's expected Windows files, not arbitrary clang installations. The compiler settings applied by the current adapter are: | Setting | Purpose | |---|---| | `--target=wasm32`, `-O2`, `-nostdlib` | Compile an optimized freestanding WASM module | | `-fno-exceptions`, `-fno-rtti` | Avoid unsupported runtime dependencies | | `-mbulk-memory`, `-mno-reference-types`, `-mno-multivalue` | Select the adapter's supported feature set | | Linker `--no-entry`, `--strip-all` | Export contract entry points without a process main function | | Linker `-z,stack-size=65536` | Reserve 64 KiB for the stack | | Linker `--initial-memory=131072`, `--max-memory=131072` | Fix linear memory at 128 KiB | These are settings, not a standalone build command. Studio adds its SDK header, attached sources, include paths and dependency checks. Use the [first-contract workflow](first-contract.md) for the complete build. ## Contract structure The [counter source](first-contract.md#2-add-the-source) demonstrates the full structure: - `#include "pqwerai.h"` exposes `pqw_*` host functions and `pqw::` helpers. - `PQW_EXPORT("call") void call()` dispatches regular calls. - An optional `PQW_EXPORT("deploy") void deploy()` initializes persistent state. C++ global constructors do not run; put initialization in this export. - `// @abi` comments declare functions, events, errors and constructor parameters for the wallet. Global variables and linear memory are temporary for each invocation. In the counter, `SLOT` and `VALUE` are buffers; the durable count lives in the account's storage through `pqw_storage_load` and `pqw_storage_store`. ## Attach more source files Use **Attach files** or **Attach folder** for project sources. Studio compiles attached `.cpp` and `.cc` files and makes attached headers available at their relative paths. Allowed system headers are `stdint.h`, `stddef.h`, `stdbool.h`, `limits.h`, `cstdint`, `cstddef` and `climits`. Includes must be literal paths to the SDK header, an allowed system header or an attached file. Absolute paths, paths escaping the project, computed includes, `#include_next`, `#embed` and `__has_include` are refused. The adapter also checks the compiler's dependency file before accepting its output. ## Language limits and arithmetic Use integers, explicit buffers and bounded loops. Avoid floating point, allocation that needs a runtime, exceptions, RTTI, libc calls, file access and network access. A module that compiles but imports foreign runtime functions will fail VM validation. A Solidity ABI `uint256` is a 32-byte word, not a native `uint64_t`. `pqw::get_u64` reads only the low 64 bits. Use the SDK's `add256` and `sub256` helpers and check their success result for full-width arithmetic; `inc256` wraps on overflow. Validate argument lengths, address padding and attached value as described in [ABI and host functions](abi-and-host.md). # C# WASM contracts # C# WASM contracts Studio uses **Roslyn to compile C# to IL**, then its own translator converts supported IL to WebAssembly. Validators execute the WASM module. They do not execute a DLL or start the .NET runtime. ## Compiler setup The Windows pin is **.NET SDK 10.0.403**, containing Roslyn **5.9.0-1.26523.112**. Install or extract the full SDK, then choose `sdk/10.0.403/Roslyn/bincore/csc.dll` in Studio. Keep the SDK's `dotnet` host and reference packs alongside it; copying just `csc.dll` will not provide `System.Runtime.dll`. The pinned Windows SDK archive SHA-256 is `f398979a9cac2dba760771c4e01f16e431dcd6bcfb2213e3e8f5b3d354095cc0`; the compiler DLL pin is `f9ea6e4b51f4ac07b9005fddf3e5a0022d9d60cf95a1c404809de63ba6d0eb3b`. These are the Studio toolchain identities, not a claim about every installed SDK. Studio supplies `PqwerAI.Contracts.cs` and invokes Roslyn with unsafe code, optimization and deterministic compilation enabled. It then translates the resulting library. A successful Roslyn compilation can still fail translation if the code uses unsupported features. ## Contract structure The [counter source](first-contract.md#2-add-the-source) uses `PqwerAI.Contracts`: | Element | Role | |---|---| | `public static unsafe class Counter` | Container for contract methods and pointer-based buffers | | `[Export("call")] public static void Call()` | Regular invocation entry point | | Optional `[Export("deploy")]` static void method | Initialization during creation | | `Host` | Approved VM imports | | `Sdk` | ABI words, selectors, literals, memory helpers and arithmetic | | `// @abi` comments | Wallet-visible function, event, error and constructor declarations | ## Supported C# subset | Supported | Details | |---|---| | Static methods | Calls and recursion, subject to gas and execution bounds | | Integers and enums | `bool`, `byte` through `long`/`ulong`, `char`, integer-backed enums | | Control flow | Branches, loops, `switch` and integer expressions | | Unmanaged structs | Fields, nested structs, constructors, instance methods, properties, fixed buffers, sequential and explicit layout | | References and pointers | `ref`/`out`/`in`, pointer arithmetic, address-of, `sizeof`, `stackalloc` | | Checked arithmetic | Supported overflow and division errors revert; unchecked operations wrap | | Static fields and initializers | Reinitialized for each invocation; cyclic initializer dependencies are rejected | | Literal intrinsics | `Sdk.Utf8`, `Utf8Len`, `Hex`, `HexLen` for compile-time literals | The translator rejects heap objects, managed arrays, strings as runtime values, generics, exceptions and `try`/`catch`/`finally`, floating point, delegates, lambdas, boxing, virtual/interface calls and calls into .NET libraries. A static class container is supported; allocating class instances is not. Keep literal strings in SDK intrinsics. A general string operation or library call is not made available by adding a `using` statement. Attach extra `.cs` files for additional code written within the same subset. ## Persistent state and ABI words `static ulong count` does not persist between transactions. Use `Host.StorageLoad` and `Host.StorageStore` with 32-byte keys and values. Static fields and `stackalloc` buffers are working memory only. `uint256` in the ABI is a 32-byte big-endian value. `Sdk.GetU64` reads only its low 64 bits; `Sdk.PutU64` writes a zero-extended 64-bit value. For full-width arithmetic, use `Sdk.AddU256` / `SubU256` and handle a false result with a revert. C# `checked` does not turn a `ulong` into a 256-bit number. Use `Sdk.RequireArgs`, `Sdk.ArgAddress` and `Sdk.RequireNoValue` to enforce the interface you declare. See [ABI, storage and host functions](abi-and-host.md) for constructor encoding, events and cross-VM calls. # WASM deployment and verification # WASM deployment and verification Use [Contract Studio](first-contract.md) to build the artifact, encode constructor arguments, simulate creation, estimate gas, sign locally and verify the deployed module. Standard JSON-RPC carries the transactions and reads; there is no separate WASM account or wallet balance. ## Creation payload and artifacts The adapter wraps the compiled module using the following byte layout: ```text creation transaction data: ef 57 49 00 | module length (u32, big-endian) | module bytes | ABI constructor arguments WASM module header: 00 61 73 6d 01 00 00 00 stored-code identifying prefix: ef 57 41 00 ``` The module-length field counts only module bytes. Constructor arguments are appended after the module, without a selector. Send creation data with no recipient address. A raw `.wasm` module or a C# DLL is not the complete creation payload. The stored-code prefix identifies a WASM account; it is not itself a source-verification proof. `eth_call` can simulate the exact creation transaction. Studio refuses a WASM deployment when its connected-chain capability check says the VM is unavailable. `eth_estimateGas` estimates the whole transaction, including constructor execution; do not copy EVM tutorial gas measurements into a WASM deployment. ## Verify the module After a successful receipt, Studio checks that `eth_getCode` returns the WASM stored-code marker and locates the contract's **`WasmDeployed(bytes32,uint32)`** deployment log. It compares the recorded module hash with **Keccak-256 of the raw module it compiled**, excluding the creation wrapper and constructor arguments. | Result | Meaning | |---|---| | WASM module verified | Recorded module hash matches the compiled module | | WASM contract present, record missing | Verification is unknown; required deployment logs may be unavailable | | Module differs | Deployment identity does not match the selected artifact | | Code is not WASM | Wrong address, failed deployment or incompatible execution result | Retain the receipt and deployment block. For another verification, query the address's deployment logs and compare the module hash against a reproducible rebuild. Confirm the receipt is still canonical and apply your [finality policy](../../blockchain/finality.md). A matching module hash does not prove constructor arguments, current storage or contract safety. Record those separately. ## Reproduce the build Keep the project source and attachments, SDK version, compiler archive and executable identities, wallet build and translator revision, flags, ABI and constructor arguments. Build twice with the same inputs and compare the raw module bytes and hash. For C#, Roslyn's deterministic flag alone does not pin the IL-to-WASM translator. For C++, keep the complete wasi-sdk toolchain and linker identity. Store the module identity alongside chain ID, genesis identity, address, transaction, block and verification result. Save the Studio project after deployment so these records remain associated with the build. ## Troubleshooting | Symptom | Check and correction | |---|---| | C++ / C# absent from language list | Use a wallet build containing the corresponding Studio adapter | | WASM VM unavailable | Run **Check connected chain**; verify the node and its authenticated chain profile | | `System.Runtime.dll` missing | Select `csc.dll` inside a complete SDK with its reference packs | | C# feature not supported | Rewrite within the supported subset; Roslyn success is only the first compilation stage | | C++ include refused | Attach the file using a project-relative path; use allowed SDK or freestanding headers | | Undefined libc / foreign import | Remove runtime dependencies; the VM provides only its approved host interface | | No functions in console | Add correct `// @abi` declarations and recompile | | Function reverts with empty data | Check selector, argument size and padding, attached value, bounds and explicit revert paths | | Increment appears to disappear | Send a transaction and wait for its receipt; `eth_call` only simulates it | | Count resets between calls | Persist it through storage imports, not static fields or linear memory | | Out of gas | Estimate the exact transaction; bound loops, recursion, copies and subcalls | | Verification is unknown | Retrieve deployment logs from a node retaining them; keep the receipt and module | | Rebuilt module differs | Compare source, SDK, compiler, linker, translator revision and flags | ## Verification limits The checked-in wallet has compiler, ABI, deployment and VM-conformance tests for C++ and C#. Historical test results have their own source pins. For these tutorial files, local verification on 21 November 2026 compiled each language twice with the pinned compiler, confirmed identical module bytes and checked the generated ABI and deployment plan. The modules were 723 bytes (C++) and 1,331 bytes (C#). No live deployment of these tutorial files was performed in that verification. These guides do not establish a new network deployment or independent security audit. Public release acceptance, mixed-version rollout, explorer presentation and independent assurance remain separate requirements. Generic Rust, Go, C or AssemblyScript contracts have no supported Studio authoring workflow in this revision. For the EVM runtime-bytecode procedure, see [Contract verification](../verification.md). # Your first WASM contract # Your first WASM contract For a fixed-supply ERC-20 instead of a counter, use the tested [C++ and C# token examples](../guides/basic-token-all-languages.md). **Result:** a counter with `get()`, `increment()` and an `Incremented(uint256)` event, written in C++ or C#, deployed as a WASM contract and called using the Solidity ABI. **Prerequisites:** the [Windows Wallet](../../tools/windows-wallet.md) with C++/C# Studio support, a compatible 20778 node, a locally controlled account funded with test tPQAI, and the compiler for your chosen language. Install it using the [C++ setup](cpp.md#compiler-setup) or [C# setup](csharp.md#compiler-setup). ## 1. Create a project and check the chain Enable **Advanced mode**, open **Contract Studio** and choose **Custom contract**. Select **C++** or **C#** as the source language. Use **Check connected chain** and confirm `WASM VM yes`, the expected chain ID and the approved genesis identity. A chain ID alone does not authenticate a network. If the language is absent, use a wallet build containing its Studio adapter. If WASM support is absent, connect to the correct compatible node; editing a project's language does not activate a VM on that node. ## 2. Add the source Paste the corresponding source below. Studio supplies `pqwerai.h` or `PqwerAI.Contracts.cs` when compiling; you do not need to fetch a package with that name. === "C++" ```cpp title="Counter.cpp" --8<-- "wasm/Counter.cpp" ``` === "C#" ```csharp title="Counter.cs" --8<-- "wasm/Counter.cs" ``` Both versions use storage slot 0 and a full 32-byte, big-endian counter. The increment wraps modulo 2²⁵⁶; this is a small tutorial, not a checked financial arithmetic library. Both reject attached tPQAI and unknown selectors. The `// @abi` comments populate the wallet's function and event list. They do not generate function bodies, argument validation or a dispatcher. The `call` export handles the selectors explicitly. ## 3. Compile and inspect Choose the compiler file, then **Compile**. For C++ choose the wasi-sdk `clang++.exe`; for C# choose the pinned SDK's `Roslyn/bincore/csc.dll`. Review errors and warnings before proceeding. Confirm that the artifact has the `wasm-vm/v1` target, lists `get()` and `increment()`, and contains deployment bytecode. There are **no constructor arguments** in this counter. A raw Roslyn DLL is an intermediate file; the Studio translator must produce the WASM module before it can be deployed. ## 4. Simulate and deploy Select your test account and send **zero tPQAI value** with the deployment. Simulate the deployment and review the estimated gas, fees and WASM module summary. Deploy signs a normal contract-creation transaction locally; Studio also simulates before signing. Wait for a successful receipt (`status = 0x1`) and record the contract address, transaction hash and block. Check the post-deployment module verification result. An address by itself does not establish a successful, verified deployment. See [how WASM verification works](deployment-and-verification.md#verify-the-module). ## 5. Read, write and read again Open the contract in Studio's console with its generated ABI: | Action | How to execute | Expected result for a fresh counter | |---|---|---| | `get()` | Read with `eth_call` | ABI word containing `0` | | `increment()` | Send a signed transaction with value 0 | Successful receipt with one `Incremented` event whose value is `1` | | `get()` | Read again after the receipt | ABI word containing `1` | An `eth_call` to `increment()` only simulates the write. Send a transaction to persist it. Before treating an application action as final, use the [application finality guidance](../../blockchain/finality.md). Ordinary ABI clients can use the same address and signatures: Foundry, ethers.js, viem and web3.py do not need to understand the contract's source language. Their deployment tooling must use the wrapped WASM creation payload rather than compiling this source as Solidity. ## 6. Save the project Use **Save project** to retain source, ABI, artifact, compiler details, constructor arguments and deployment records in a `pqwerai-studio-project/2` file. Keep attached sources and exact toolchain identities so you can rebuild the module. Changing source after deployment creates a new build; it does not update the contract. Next: [ABI, storage and host functions](abi-and-host.md) · [Deployment errors](deployment-and-verification.md#troubleshooting). # Explorer and Analytics APIs # Explorer and Analytics APIs The PQWERAI explorer (`pqwexplorer`) indexes the chain using read-only JSON-RPC, reconciles its totals exactly with Core, and serves HTML pages plus a read-only JSON API. | | | |---|---| | API | `GET /api/v1/…`, JSON, unauthenticated, read-only — [reference](reference.md) | | Etherscan-compatible API | `GET /api?module=…&action=…` for Etherscan clients (lookups only, no source verification) — [guide](etherscan.md); live on the public explorer; read-only /api rechecked 23 November 2026 | | Schema | [OpenAPI 3.1](../downloads/explorer-openapi.yaml) · [Postman collection](../downloads/pqwerai-postman-collection.json) | | Contract test | `scripts/devhub/explorer_contract_test.py`: 35/35 PASS against a live index of the local testnet | | Storage | PostgreSQL 18 in production since 18 November 2026 (unix socket only, verified copy of every table); SQLite for tests and local runs, same schema | | Public endpoint | `https://explorer.pqwerai.com` (read-only; release 0.12.0, database schema 5; the explorer footer shows the running release), API at `https://explorer.pqwerai.com/api/v1/`; [Etherscan-compatible API](etherscan.md) at `https://explorer.pqwerai.com/api` | | Model pools | [Pools page](https://explorer.pqwerai.com/pools) and `/api/v1/pools`, read from the off-chain pool directories (0.4.0) | ## Coverage | Data | Endpoint | |---|---| | Blocks, transactions (with receipt status and token transfers), accounts | `/blocks`, `/block/{key}`, `/tx/{hash}`, `/address/{address}` | | ERC-20 / ERC-721 tokens | `/tokens` | | Smartnode validators, finality checkpoints | `/validators`, `/checkpoints` | | Exact supply and per-block issuance (67/18/1/9/5 on chain 20778 from block 1, incl. the Quantum Reserve and IPFS storage pool shares) | `/supply`, `/issuance` | | GhostRider mining statistics | `/mining` | | AI-market events (escrow, registry, jobs) | `/ai/events` | | Indexer health, freshness, chain identity, alarms | `/status` | Semantics (freshness, reorganisations, pagination, errors): [Data semantics](semantics.md). ## Run it locally ```bash pip install -r explorer/requirements.txt cd explorer python -m pqwexplorer all --rpc http://127.0.0.1:8545 --db sqlite:explorer.db \ --genesis /etc/pqwerai/network/genesis.json --bind 127.0.0.1 --port 8089 curl -s http://127.0.0.1:8089/api/v1/status python -m pqwexplorer reconcile --rpc http://127.0.0.1:8545 --db sqlite:explorer.db # exit 0 only if exact ``` To use PostgreSQL as the public deployment does, pass `--db "postgresql:///pqwexplorer?host=/var/run/postgresql"`. `python -m pqwexplorer copy --source sqlite:explorer.db --db ` moves an index into an empty database and keeps nothing unless every table matches by row count and content digest. The explorer source is in the PQWERAI-testnet repository (`explorer/`); it is not yet published separately. # Etherscan-compatible API # Etherscan-compatible API The explorer answers the Etherscan API at `/api` for chain **20778**, so tools that already speak Etherscan can read PQWERAI: transaction and token history, balances, logs, block rewards, contract ABIs of the registered PQWERAI contracts, and a read-only JSON-RPC proxy. !!! warning "Read-only" Served at `https://explorer.pqwerai.com/api` since explorer 0.7.0 (CR-0094 part C); the public explorer serves chain 20778 since 28 November 2026. A local explorer serves the same API at `http://127.0.0.1:8089/api` ([Explorer](index.md#run-it-locally)). **Source code verification is not supported.** On the public endpoint the proxy refuses `POST /api` with HTTP 405 (a local explorer answers `verifysourcecode` with `NOTOK`), so `npx hardhat verify` and `forge verify-contract` fail. Use [byte-for-byte verification](../contracts/verification.md). | | | |---|---| | Base URL | `https://explorer.pqwerai.com/api` (public, read-only) · local `http://127.0.0.1:8089/api` | | Chain | `chainid=20778` (optional, Etherscan API v2 style; any other value is rejected) | | API key | not required; `apikey` is accepted and ignored | | Method | `GET` only | | Rate limit | enforced by the reverse proxy (same zone as `/api/v1`: 10 requests/s per IP, burst 40); HTTP 429 when exceeded | | CORS | `Access-Control-Allow-Origin: *` (added by the reverse proxy) | | Data | the reorganisation-safe index plus cached read-only node calls; nothing is ever written to the node | ## Response format Exactly Etherscan's envelope. Every number is a decimal string (`getLogs` and `proxy` use `0x` hex, as Etherscan). ```json {"status": "1", "message": "OK", "result": "1000000000000000000"} {"status": "0", "message": "NOTOK", "result": "Error! Invalid address format"} {"status": "0", "message": "No transactions found", "result": []} ``` Errors are HTTP 200 with `status` `"0"`; only an internal failure (database or node outage) is HTTP 503, with the same envelope and `"result": "Error! Temporarily unavailable"`. The `proxy` module answers with JSON-RPC envelopes (`{"jsonrpc": "2.0", "id": 1, "result": …}` or `"error": {…}`). Lists accept `page` (from 1), `offset` (page size, at most 10,000; `getLogs` 1,000) and `sort=asc|desc`, with `page × offset ≤ 10,000` like Etherscan. `startblock`/`endblock` (and `fromBlock`/`toBlock`) take decimal, `0x` hex or `latest`. ## Supported actions | Module | Action | Source | Notes | |---|---|---|---| | `account` | `balance`, `balancemulti` (≤ 20) | node `eth_getBalance` at the indexed tip block | `tag=latest` only | | `account` | `txlist` | indexed transactions | Etherscan fields and order; see [fields](#fields-that-can-be-empty) | | `account` | `tokentx` | indexed ERC-20 `Transfer` logs | by `address` and/or `contractaddress` | | `account` | `tokennfttx` | indexed ERC-721 `Transfer` logs | `tokenID`, `tokenDecimal` `"0"` | | `account` | `getminedblocks` | indexed blocks + issuance journal | `blockReward` explained [below](#block-rewards) | | `contract` | `getabi`, `getsourcecode` | registered PQWERAI contracts | ABI lists **events only**; `SourceCode` is always `""` | | `contract` | `getcontractcreation` (≤ 5) | indexed contract creations | direct creations only (no traces) | | `transaction` | `getstatus`, `gettxreceiptstatus` | indexed receipt status | revert reasons are not indexed (`"Reverted"`) | | `block` | `getblockreward` | indexed blocks + issuance journal | `uncles` is always `[]` | | `block` | `getblocknobytime` | indexed block timestamps | `closest` = `before` or `after` | | `logs` | `getLogs` | indexed logs | `address` and/or `topic0`–`topic3`, `topicX_Y_opr` = `and` or `or` (default `and`, applied left to right); without an address at most 2,000 blocks per call | | `stats` | `ethsupply` | exact supply (`/api/v1/supply` `total_supply_wei`) | minted − base-fee burn − slashing burn | | `proxy` | `eth_blockNumber`, `eth_getBlockByNumber`, `eth_getTransactionByHash`, `eth_getTransactionReceipt`, `eth_call`, `eth_getCode`, `eth_gasPrice`, `eth_estimateGas` | node, read-only, cached 3 s | `eth_call`/`eth_estimateGas` calldata ≤ 64 KiB | Not served, each answering `NOTOK` with the reason: `txlistinternal` (PQWERAI Core serves no trace API, so internal calls are not indexed), `token1155tx` (ERC-1155 is not indexed), `verifysourcecode` and the other verification actions (no compiler pipeline), `ethprice` (testnet coins have no price) and `eth_sendRawTransaction` (send transactions to the public RPC `https://rpc-testnet.pqwerai.com`). Any other action answers `"Error! Missing Or invalid Action name"`. The complete list with parameters is the `x-etherscan-api` section of the [OpenAPI file](../downloads/explorer-openapi.yaml). ### Fields that can be empty `txlist` returns `nonce`, `gas`, `input`, `cumulativeGasUsed` and `methodId` from a table added in explorer schema 3. Transactions indexed before that upgrade show `""` for these five fields until the operator runs the optional backfill (`python -m pqwexplorer backfill-tx-extra`). `functionName` is always `""`: the explorer bundles event ABIs, not function ABIs. `gasPrice` is the effective gas price paid. `tokentx`/`tokennfttx` return `input` as `"deprecated"`, as Etherscan does. ### Block rewards PQWERAI pays PoW issuance once per 32-block epoch: the settlement block `P+1` (`P` a multiple of 32) credits the 32 producers of blocks `P-31 … P` an equal `floor(PoW / 32)` each, and the producer of block `P` also the remainder. `blockReward` is that share, read exactly from the on-chain issuance journal, plus the block's priority fees. It is `0` (plus fees) until the epoch is settled. Base fees are burned and not included. Smartnode (PoS), founder, Quantum Reserve and IPFS shares are not block rewards; see [`/api/v1/issuance`](reference.md). ## Examples ```bash API=https://explorer.pqwerai.com/api # or http://127.0.0.1:8089/api for a local explorer curl -s "$API?chainid=20778&module=account&action=balance&address=0xYourAddress" curl -s "$API?module=account&action=txlist&address=0xYourAddress&page=1&offset=25&sort=desc" # ModelRegistry / AIJobMarket addresses are published after their deployment on chain 20778 curl -s "$API?module=logs&action=getLogs&address=$MODEL_REGISTRY&fromBlock=0&toBlock=latest" curl -s "$API?module=contract&action=getabi&address=$AI_JOB_MARKET" curl -s "$API?module=proxy&action=eth_blockNumber" ``` ## Tool configuration !!! note "Snippets not executed" The snippets below follow each tool's documented Etherscan configuration; the tools themselves were not run against `explorer.pqwerai.com`. The API is covered by the explorer tests and was probed live after deployment. ### Hardhat (`@nomicfoundation/hardhat-verify`) Lookups work; `npx hardhat verify` fails because the public endpoint refuses its `POST /api` (HTTP 405). ```ts title="hardhat.config.ts" const config: HardhatUserConfig = { // ... solidity and networks.pqwerai as on the Hardhat page etherscan: { apiKey: { pqwerai: "not-needed" }, // any non-empty value; the explorer ignores it customChains: [ { network: "pqwerai", chainId: 20778, urls: { apiURL: "https://explorer.pqwerai.com/api", browserURL: "https://explorer.pqwerai.com", }, }, ], }, }; ``` ### Foundry ```toml title="foundry.toml" [etherscan] pqwerai = { key = "not-needed", url = "https://explorer.pqwerai.com/api", chain = 20778 } ``` `cast` commands that read from Etherscan (for example `cast source --chain 20778`) use the `getsourcecode` lookup; because no PQWERAI contract is verified, they report that the source is not verified. `forge verify-contract` is not supported. ### ethers v6 `EtherscanProvider` ```ts import { EtherscanProvider, Network } from "ethers"; class PqwerAIExplorer extends EtherscanProvider { getBaseUrl(): string { return "https://explorer.pqwerai.com"; } // ethers appends /api?... } const explorer = new PqwerAIExplorer(new Network("pqwerai", 20778n)); console.log(await explorer.getBlockNumber()); ``` Use the public RPC (`https://rpc-testnet.pqwerai.com`) with a `JsonRpcProvider` to send transactions: the explorer proxy does not accept `eth_sendRawTransaction`. # Explorer REST API reference # Explorer REST reference Served by `explorer/pqwexplorer/web.py` from the indexed, reorganisation-safe database. Every endpoint is `GET`, unauthenticated and read-only. This schema is the contract tested by `scripts/devhub/explorer_contract_test.py`; an endpoint absent from it does not exist. **Canonical chain identity.** `GET /status` returns `chain_id` and `genesis`; clients must pin both. **Freshness.** Data comes from the indexed tip (`indexed_tip`). `lag_blocks = node_head - indexed_tip`. Account balances (`/address/{address}`) are read from the node at the indexed tip block (`balance_at_block`), so they are consistent with the indexed history beside them; everything else is indexed. `/status` reports `explorer_version` and the database `schema_version`. **Protocol events.** `/events` returns the logs of the registered PQWERAI contracts (`/contracts`) decoded with the event ABIs generated from their published sources, per module (`ai`, `qai`, `pq`, `ipfs`, and `pate` = GhostTurbo permissions). A decoded event shows what a contract emitted. It is not a verification of the contract, of QAI reserves or of any post-quantum signature. Events whose parameters cannot be canonicalised from source are not decoded. **Supply.** `total_supply_wei` = minted - base-fee burn - slashing burn (the node's counter as last observed; `slash_burn_wei` is null before the first observation). It includes locked stake, the Quantum Reserve and the founder treasury: the explorer does not publish a circulating-supply figure. `circulating_wei` is retained for compatibility and equals `total_supply_wei`. **Reorganisations.** The indexer replaces non-finalized blocks when a heavier branch wins (records in `reorgs_handled`). A reorganisation below the recorded finalized checkpoint is never applied: the indexer records a `finality_violation` alarm (`/status.alarms`) and stops. Treat data above `finalized_height` as reversible. **Pagination and size limits.** `/blocks`, `/issuance`, `/checkpoints` and `/ai/events` accept a backward cursor: `limit` (1 to a hard maximum: 100, 200, 100, 500) and `before_block` (exclusive). Without parameters they return the same newest-first windows as before (25, 50, 100, 500). To fetch the next page pass the last item's block number (`observed_head` for checkpoints) as `before_block`; for `/ai/events` also pass its `log_index` as `before_log_index` so events sharing a block are never skipped. An empty array ends the walk. `/events` paginates the same way as `/ai/events` (default 100, maximum 500) and filters by `module` and `address`. Cursor parameters on endpoints that do not paginate return `400`; unrelated query parameters are ignored. Address transactions and token transfers (50 each) and mining statistics (last 64 blocks) are not paginated. **Amounts.** All wei/gwei amounts that can exceed 2^53 are decimal strings. **Errors.** `400` with `{"error": ""}` for malformed path values, `404` with `{"error": "not found"}` for unknown resources and routes. **Etherscan-compatible API.** `GET /api?module=…&action=…` (also `/api/`, outside this `/api/v1` server) answers in Etherscan's envelope `{"status": "1"|"0", "message": "OK"|"NOTOK"|…, "result": …}` with decimal-string numbers, so Etherscan clients (Hardhat/Foundry lookups, ethers `EtherscanProvider`, portfolio trackers) can read chain 20778. `chainid` (Etherscan API v2) must be `20778` when given; `apikey` is ignored. Every supported `module.action`, its parameters, data source and limits are listed under `x-etherscan-api` in this file and contract-tested against `explorer/pqwexplorer/etherscan.py`. Source verification, internal transactions, prices and ERC-1155 are not served (`NOTOK` with the reason). Base URL: `https://explorer.pqwerai.com/api/v1` (public, read-only) or `http://127.0.0.1:8089/api/v1` for a local explorer. The examples use the local address. [Download OpenAPI 3.1](../downloads/explorer-openapi.yaml){ .md-button } [Postman collection](../downloads/pqwerai-postman-collection.json){ .md-button } | Endpoint | Summary | |---|---| | [`GET /status`](#get-status) | Chain identity, indexer freshness, finality and alarms | | [`GET /blocks`](#get-blocks) | Indexed blocks, newest first (cursor-paginated; default 25) | | [`GET /block/{key}`](#get-block-key) | One block by decimal number, 0x-hex number or 32-byte hash | | [`GET /tx/{hash}`](#get-tx-hash) | One transaction with receipt status and decoded token transfers | | [`GET /address/{address}`](#get-address-address) | Live balance, mined blocks, latest 50 transactions and 50 token transfers | | [`GET /supply`](#get-supply) | Exact issuance counters at the indexed tip (20778 - 67% PoW / 18% Smartnodes / 1% founder / 9% Quantum Reserve / 5% IPFS storage pool from block 1) | | [`GET /issuance`](#get-issuance) | Per-block issuance, newest first (cursor-paginated; default 50) | | [`GET /mining`](#get-mining) | GhostRider mining statistics over the latest 64 blocks | | [`GET /hashrate`](#get-hashrate) | Estimated network hashrate over time, with the miner addresses of the period | | [`GET /validators`](#get-validators) | Latest Smartnode validator snapshot (as returned by g4_validators) | | [`GET /ghost/status`](#get-ghost-status) | GhostShield availability, collateral totals, slash burn and network participation by state over time | | [`GET /ghost/smartnodes`](#get-ghost-smartnodes) | Latest Smartnode lifecycle snapshot (ghostshield_smartnodes), consensus data | | [`GET /ghost/smartnode/{id}`](#get-ghost-smartnode-id) | One Smartnode (stable id or key id) with its persisted lifecycle history and guarantees | | [`GET /ghost/guarantees`](#get-ghost-guarantees) | Guarantees from the GuaranteeOpened / GuaranteeReleased logs of the guarantee account, enriched by the live snapshot | | [`GET /ghost/penalties`](#get-ghost-penalties) | Accepted evidence, slashed Smartnodes and slash burn history (consensus data) | | [`GET /ghost/pulse`](#get-ghost-pulse) | GhostPulse health of the node the explorer queries - a local observation, NOT consensus data | | [`GET /ghost/v2/status`](#get-ghost-v2-status) | GhostShield v2 totals (escrow, allocated, free, paid), sponsorship counts by status, collateral records and history | | [`GET /ghost/v2/collaterals`](#get-ghost-v2-collaterals) | Every GhostShield v2 collateral record at the latest snapshot (at most 256) | | [`GET /ghost/v2/collateral/{id}`](#get-ghost-v2-collateral-id) | One Smartnode's collateral record (stable or current key id) with sponsorships, offers, exposure, floor, reputation, lifecycle and decoded history | | [`GET /ghost/v2/sponsorships`](#get-ghost-v2-sponsorships) | Live sponsorships (offered, active, revoking, winding) at the latest snapshot | | [`GET /ghost/v2/sponsorship/{id}`](#get-ghost-v2-sponsorship-id) | One sponsorship by id (from the latest snapshot) with its decoded history | | [`GET /ghost/v2/events`](#get-ghost-v2-events) | Decoded logs of the GhostShield v2 account, newest first | | [`GET /ghost/v2/claims`](#get-ghost-v2-claims) | Payment assurance claims - open claims, settlements and claim history (active on chain 20778 from block 1) | | [`GET /ghost/v2/claim/{id}`](#get-ghost-v2-claim-id) | One claim - the open record while pending, its outcome (paid, cured, waived) and settlement split from the logs | | [`GET /ghost/v2/wallet/{address}`](#get-ghost-v2-wallet-address) | A wallet's sponsor, offers received, GhostTurbo eligibility, owned collateral records and decoded history | | [`GET /ghost/v2/eligibility/{address}`](#get-ghost-v2-eligibility-address) | GhostTurbo eligibility of a wallet (ghostshield_eligibility), live and provisional above the finalized checkpoint | | [`GET /ghost/v2/turbo/{hash}`](#get-ghost-v2-turbo-hash) | GhostTurbo status of a transaction (ghostturbo_status); never canonical finality | | [`GET /checkpoints`](#get-checkpoints) | Observed finalized/justified checkpoints, newest first (cursor-paginated; default 100) | | [`GET /tokens`](#get-tokens) | Detected ERC-20 / ERC-721 contracts, with their transfer activity | | [`GET /ai/events`](#get-ai-events) | AI-market contract events decoded by signature, newest first (cursor-paginated; default 500) | | [`GET /events`](#get-events) | Decoded events of the registered PQWERAI contracts, newest first (cursor-paginated; default 100) | | [`GET /contracts`](#get-contracts) | Registered protocol contracts and system accounts of this chain, with the deployment evidence cited | | [`GET /deployments`](#get-deployments) | Deployment state of this chain's protocol contracts, including the ones still pending a deployment | | [`GET /features`](#get-features) | Readiness of the Ghost technologies by state (implemented, integrated, configured, enabled, independently validated) | | [`GET /provenance`](#get-provenance) | Source, method, unit, update frequency and class (on-chain, node-reported, indexed, estimated) of every overview metric | | [`GET /pools`](#get-pools) | Model pools published by the pool directories (off-chain), with shared memory and self-measured speed | ## `GET /status` { #get-status } Chain identity, indexer freshness, finality and alarms. | Status | Body | |---|---| | 200 | `Status` | ```bash curl -s http://127.0.0.1:8089/api/v1/status ``` ??? info "Response fields" | Field | Type | Notes | |---|---|---| | `explorer_version` | string | Version of the explorer package serving this API | | `schema_version` | integer | Version of the database schema (forward-only migrations) | | `chain_id` * | integer \| null | | | `genesis` * | string \| null | | | `indexed_tip` * | integer | | | `node_head` * | integer \| null | | | `lag_blocks` * | integer \| null | | | `client` * | string \| null | | | `finalized_height` * | integer \| null | | | `finalized_hash` * | string \| null | | | `justified_height` * | integer \| null | | | `reorgs_handled` * | integer | | | `alarms` * | array | | ## `GET /blocks` { #get-blocks } Indexed blocks, newest first (cursor-paginated; default 25). - Query parameter `before_block` — Exclusive upper bound; pass the last item's block number (observed_head for checkpoints) (minimum 0) - Query parameter `limit` — Page size (default 25) (minimum 1, maximum 100, default 25) | Status | Body | |---|---| | 200 | array of `BlockSummary` (max 100) | ```bash curl -s http://127.0.0.1:8089/api/v1/blocks ``` ??? info "Response fields" | Field | Type | Notes | |---|---|---| | `number` * | integer | | | `hash` * | string | | | `miner` * | string | | | `ts` * | integer | Unix seconds | | `difficulty` * | string | | | `tx_count` * | integer | | | `gas_used` * | integer | | ## `GET /block/{key}` { #get-block-key } One block by decimal number, 0x-hex number or 32-byte hash. - Path parameter `key` — pattern `^([0-9]+|0x[0-9a-fA-F]+)$` | Status | Body | |---|---| | 200 | `Block` | | 400 | `Error` — {"error": "…"} | | 404 | `Error` — {"error": "…"} | ```bash curl -s http://127.0.0.1:8089/api/v1/block/ ``` ??? info "Response fields" | Field | Type | Notes | |---|---|---| | `number` * | integer | | | `hash` * | string | | | `parent` * | string | | | `miner` * | string | | | `ts` * | integer | | | `difficulty` * | string | | | `gas_used` * | integer | | | `gas_limit` * | integer | | | `base_fee` * | string | | | `tx_count` * | integer | | | `state_root` * | string | | | `minted` * | string | Lifetime minted wei at this block | | `pow` * | string | | | `pos` * | string | | | `founder` * | string | | | `fee_burn` * | string | | | `txs` * | array | | | `issued_in_block_wei` | string | Absent for block 0 | | `founder_in_block_wei` | string | Absent for block 0 | | `reserve_in_block_wei` | string | Quantum Reserve share credited in this block; absent for block 0 | | `ipfs_in_block_wei` | string | IPFS reward pool share (0 before the ipfs-reward/v1 fork); absent for block 0 | ## `GET /tx/{hash}` { #get-tx-hash } One transaction with receipt status and decoded token transfers. - Path parameter `hash` — pattern `^0x[0-9a-fA-F]{64}$` | Status | Body | |---|---| | 200 | `Transaction` | | 400 | `Error` — {"error": "…"} | | 404 | `Error` — {"error": "…"} | ```bash curl -s http://127.0.0.1:8089/api/v1/tx/ ``` ??? info "Response fields" | Field | Type | Notes | |---|---|---| | `hash` * | string | | | `block` * | integer | | | `idx` * | integer | | | `from` * | string | | | `to` * | string \| null | | | `contract` * | string \| null | Created contract address | | `value` * | string | | | `gas_used` * | integer | | | `gas_price` * | string | | | `status` * | integer | | | `input_bytes` * | integer | | | `logs` * | integer | | | `events` | array | Decoded protocol events emitted by this transaction | | `ghostshield_v2` | object | Present only for a transaction to the GhostShield v2 system account (0x5E0660Cc96b62435FA020E885467aBcC145e10d1): `calldata` decoded from opcode and RLP(args) as Core encodes it (`op`, `opcode`, `args`, `fixed_gas`, `gas_note`: the fixed opcode gas is not the full cost, every operation also pays 2,100 per storage word read and 5,000 per word written, metered at execution; `error` and `expected_code` when Core would reject the calldata itself), the transaction's decoded v2 `events` and, for a failed transaction, `failure` = {`code` (GS2:E_*), `meaning`, `basis`}. The code is re-simulated on the parent block state (eth_call), so the exact in-block reason can differ; `basis` says so. | | `token_transfers` * | array | | ## `GET /address/{address}` { #get-address-address } Live balance, mined blocks, latest 50 transactions and 50 token transfers. - Path parameter `address` — pattern `^0x[0-9a-fA-F]{40}$` | Status | Body | |---|---| | 200 | `Address` | | 400 | `Error` — {"error": "…"} | ```bash curl -s http://127.0.0.1:8089/api/v1/address/ ``` ??? info "Response fields" | Field | Type | Notes | |---|---|---| | `address` * | string | | | `balance_wei` * | string \| null | Balance at the indexed tip block; null if the node is unreachable | | `balance_at_block` | integer \| null | Block the balance was read at (the indexed tip) | | `label` | object \| null | Set when the address is a registered protocol contract or system account | | `blocks_mined` * | integer | | | `is_founder` * | boolean | | | `txs` * | array | | | `token_transfers` * | array | | ## `GET /supply` { #get-supply } Exact issuance counters at the indexed tip (20778 - 67% PoW / 18% Smartnodes / 1% founder / 9% Quantum Reserve / 5% IPFS storage pool from block 1). | Status | Body | |---|---| | 200 | `Supply` | ```bash curl -s http://127.0.0.1:8089/api/v1/supply ``` ??? info "Response fields" | Field | Type | Notes | |---|---|---| | `at_block` | integer | | | `minted_wei` | string | | | `genesis_supply_wei` | string | | | `issued_since_genesis_wei` | string | | | `pow_issued_wei` | string | | | `pos_issued_wei` | string | | | `founder_issued_wei` | string | | | `fee_burn_wei` | string | | | `reserve_issued_wei` | string | | | `ipfs_issued_wei` | string | | | `ipfs_reward_fork_block` | integer \| null | | | `policy_bps` | object | | | `slash_burn_wei` | string \| null | Slashing burn as last observed from the node; null if never observed | | `slash_burn_observed_head` | integer \| null | | | `total_supply_wei` | string | minted - fee burn - slashing burn | | `circulating_wei` | string | Deprecated name; equals total_supply_wei (not a circulating-supply figure) | | `founder_address` | string \| null | | ## `GET /issuance` { #get-issuance } Per-block issuance, newest first (cursor-paginated; default 50). - Query parameter `before_block` — Exclusive upper bound; pass the last item's block number (observed_head for checkpoints) (minimum 0) - Query parameter `limit` — Page size (default 50) (minimum 1, maximum 200, default 50) | Status | Body | |---|---| | 200 | array of `IssuanceRow` (max 200) | ```bash curl -s http://127.0.0.1:8089/api/v1/issuance ``` ??? info "Response fields" | Field | Type | Notes | |---|---|---| | `block` * | integer | | | `issued_wei` * | string | | | `pow_wei` * | string | | | `pos_wei` * | string | | | `founder_wei` * | string | | | `reserve_wei` | string | Quantum Reserve share | | `ipfs_wei` | string | IPFS reward pool share (0 before the ipfs-reward/v1 fork) | ## `GET /mining` { #get-mining } GhostRider mining statistics over the latest 64 blocks. | Status | Body | |---|---| | 200 | `Mining` | ```bash curl -s http://127.0.0.1:8089/api/v1/mining ``` ??? info "Response fields" | Field | Type | Notes | |---|---|---| | `window_blocks` | integer | Blocks whose work is counted (the oldest block of the window only starts the clock) | | `span_s` | integer | Seconds the window covers | | `mean_interval_s` | number | | | `work` | string | Summed difficulty of the window's blocks (decimal); one unit is one expected hash | | `hashrate_estimate` | number | work / span_s, an estimate (since 0.5.0; before, the tip difficulty / mean interval, which moved 2x per block) | | `hashrate_rel_error` | number \| null | Approximate relative standard error | | `miners` | object | Blocks found per miner address in the window | | `miner_work_bps` | object | Share of the window's work per miner address | ## `GET /hashrate` { #get-hashrate } Estimated network hashrate over time, with the miner addresses of the period. - Query parameter `range` — Time span ending at the indexed head (default 7d). Periods are 15 min, 2 h, 6 h, or about 1/120 of the chain's age for `all`. (default 7d) | Status | Body | |---|---| | 200 | `Hashrate` | | 400 | `Error` | ```bash curl -s http://127.0.0.1:8089/api/v1/hashrate ``` ??? info "Response fields" | Field | Type | Notes | |---|---|---| | `range` * | string | | | `label` * | string | | | `bucket_seconds` * | integer \| null | Length of one period (null for `all` before enough blocks are indexed) | | `at_block` * | integer \| null | Indexed head the series was computed at | | `from_ts` * | integer \| null | Unix time the series starts | | `to_ts` * | integer \| null | Unix time of the indexed head | | `method` * | string | How the estimate is made and what it does not show | | `points` * | array | Oldest first | | `summary` * | object | Empty when there are no points | | `miners` * | array | Up to 15 miner addresses ordered by work found in the range (block difficulty varies up to 16x, so work and block shares differ) | ## `GET /validators` { #get-validators } Latest Smartnode validator snapshot (as returned by g4_validators). - Query parameter `sort` — Order: stake, delegated stake, most recently seen epoch, or id (CR-0108) - Query parameter `status` — Only active, or only not active, validators (default all) | Status | Body | |---|---| | 200 | array of `Validator` | ```bash curl -s http://127.0.0.1:8089/api/v1/validators ``` ??? info "Response fields" | Field | Type | Notes | |---|---|---| | `id` * | string | | | `owner` * | string | | | `key` * | string | | | `pending_key` | boolean | | | `stake_gwei` * | integer | | | `delegated_gwei` | integer | | | `activation_epoch` | integer | | | `last_seen_epoch` | integer | Last epoch with recorded participation (liveness) | | `status` * | string | | ## `GET /ghost/status` { #get-ghost-status } GhostShield availability, collateral totals, slash burn and network participation by state over time. - Query parameter `n` — (minimum 1, maximum 500) | Status | Body | |---|---| | 200 | `object` | ```bash curl -s http://127.0.0.1:8089/api/v1/ghost/status ``` ## `GET /ghost/smartnodes` { #get-ghost-smartnodes } Latest Smartnode lifecycle snapshot (ghostshield_smartnodes), consensus data. - Query parameter `sort` — - Query parameter `state` — | Status | Body | |---|---| | 200 | `object` | ```bash curl -s http://127.0.0.1:8089/api/v1/ghost/smartnodes ``` ## `GET /ghost/smartnode/{id}` { #get-ghost-smartnode-id } One Smartnode (stable id or key id) with its persisted lifecycle history and guarantees. - Path parameter `id` — pattern `^0x[0-9a-fA-F]{64}$` | Status | Body | |---|---| | 200 | `object` | | 404 | `Error` | ```bash curl -s http://127.0.0.1:8089/api/v1/ghost/smartnode/ ``` ## `GET /ghost/guarantees` { #get-ghost-guarantees } Guarantees from the GuaranteeOpened / GuaranteeReleased logs of the guarantee account, enriched by the live snapshot. - Query parameter `sort` — - Query parameter `status` — | Status | Body | |---|---| | 200 | `object` | ```bash curl -s http://127.0.0.1:8089/api/v1/ghost/guarantees ``` ## `GET /ghost/penalties` { #get-ghost-penalties } Accepted evidence, slashed Smartnodes and slash burn history (consensus data). | Status | Body | |---|---| | 200 | `object` | ```bash curl -s http://127.0.0.1:8089/api/v1/ghost/penalties ``` ## `GET /ghost/pulse` { #get-ghost-pulse } GhostPulse health of the node the explorer queries - a local observation, NOT consensus data. - Query parameter `n` — (minimum 1, maximum 1000) | Status | Body | |---|---| | 200 | `object` | ```bash curl -s http://127.0.0.1:8089/api/v1/ghost/pulse ``` ## `GET /ghost/v2/status` { #get-ghost-v2-status } GhostShield v2 totals (escrow, allocated, free, paid), sponsorship counts by status, collateral records and history. - Query parameter `n` — (minimum 1, maximum 500) | Status | Body | |---|---| | 200 | `object` | ```bash curl -s http://127.0.0.1:8089/api/v1/ghost/v2/status ``` ## `GET /ghost/v2/collaterals` { #get-ghost-v2-collaterals } Every GhostShield v2 collateral record at the latest snapshot (at most 256). | Status | Body | |---|---| | 200 | `object` | ```bash curl -s http://127.0.0.1:8089/api/v1/ghost/v2/collaterals ``` ## `GET /ghost/v2/collateral/{id}` { #get-ghost-v2-collateral-id } One Smartnode's collateral record (stable or current key id) with sponsorships, offers, exposure, floor, reputation, lifecycle and decoded history. - Path parameter `id` — pattern `^0x[0-9a-fA-F]{64}$` | Status | Body | |---|---| | 200 | `object` | | 400 | `Error` — {"error": "…"} | ```bash curl -s http://127.0.0.1:8089/api/v1/ghost/v2/collateral/ ``` ## `GET /ghost/v2/sponsorships` { #get-ghost-v2-sponsorships } Live sponsorships (offered, active, revoking, winding) at the latest snapshot. - Query parameter `status` — | Status | Body | |---|---| | 200 | `object` | ```bash curl -s http://127.0.0.1:8089/api/v1/ghost/v2/sponsorships ``` ## `GET /ghost/v2/sponsorship/{id}` { #get-ghost-v2-sponsorship-id } One sponsorship by id (from the latest snapshot) with its decoded history. - Path parameter `id` — pattern `^[0-9]{1,19}$` | Status | Body | |---|---| | 200 | `object` | | 400 | `Error` — {"error": "…"} | ```bash curl -s http://127.0.0.1:8089/api/v1/ghost/v2/sponsorship/ ``` ## `GET /ghost/v2/events` { #get-ghost-v2-events } Decoded logs of the GhostShield v2 account, newest first. - Query parameter `stable_id` — - Query parameter `wallet` — - Query parameter `sponsorship_id` — (minimum 0) - Query parameter `limit` — (minimum 1, maximum 500) - Query parameter `before_block` — Exclusive upper bound; pass the last item's block number (observed_head for checkpoints) (minimum 0) | Status | Body | |---|---| | 200 | `object` | | 400 | `Error` — {"error": "…"} | ```bash curl -s http://127.0.0.1:8089/api/v1/ghost/v2/events ``` ## `GET /ghost/v2/claims` { #get-ghost-v2-claims } Payment assurance claims - open claims, settlements and claim history (active on chain 20778 from block 1). | Status | Body | |---|---| | 200 | `object` | ```bash curl -s http://127.0.0.1:8089/api/v1/ghost/v2/claims ``` ## `GET /ghost/v2/claim/{id}` { #get-ghost-v2-claim-id } One claim - the open record while pending, its outcome (paid, cured, waived) and settlement split from the logs. - Path parameter `id` — pattern `^[0-9]{1,19}$` | Status | Body | |---|---| | 200 | `object` | | 400 | `Error` — {"error": "…"} | ```bash curl -s http://127.0.0.1:8089/api/v1/ghost/v2/claim/ ``` ## `GET /ghost/v2/wallet/{address}` { #get-ghost-v2-wallet-address } A wallet's sponsor, offers received, GhostTurbo eligibility, owned collateral records and decoded history. - Path parameter `address` — pattern `^0x[0-9a-fA-F]{40}$` | Status | Body | |---|---| | 200 | `object` | | 400 | `Error` — {"error": "…"} | ```bash curl -s http://127.0.0.1:8089/api/v1/ghost/v2/wallet/ ``` ## `GET /ghost/v2/eligibility/{address}` { #get-ghost-v2-eligibility-address } GhostTurbo eligibility of a wallet (ghostshield_eligibility), live and provisional above the finalized checkpoint. - Path parameter `address` — pattern `^0x[0-9a-fA-F]{40}$` - Query parameter `block` — (minimum 1) | Status | Body | |---|---| | 200 | `object` | | 400 | `Error` — {"error": "…"} | ```bash curl -s http://127.0.0.1:8089/api/v1/ghost/v2/eligibility/ ``` ## `GET /ghost/v2/turbo/{hash}` { #get-ghost-v2-turbo-hash } GhostTurbo status of a transaction (ghostturbo_status); never canonical finality. - Path parameter `hash` — pattern `^0x[0-9a-fA-F]{64}$` | Status | Body | |---|---| | 200 | `object` | | 400 | `Error` — {"error": "…"} | ```bash curl -s http://127.0.0.1:8089/api/v1/ghost/v2/turbo/ ``` ## `GET /checkpoints` { #get-checkpoints } Observed finalized/justified checkpoints, newest first (cursor-paginated; default 100). - Query parameter `before_block` — Exclusive upper bound; pass the last item's block number (observed_head for checkpoints) (minimum 0) - Query parameter `limit` — Page size (default 100) (minimum 1, maximum 100, default 100) | Status | Body | |---|---| | 200 | array of `Checkpoint` (max 100) | ```bash curl -s http://127.0.0.1:8089/api/v1/checkpoints ``` ??? info "Response fields" | Field | Type | Notes | |---|---|---| | `observed_head` * | integer | | | `finalized_height` * | integer | | | `finalized_hash` * | string | | | `justified_height` * | integer | | | `justified_hash` * | string | | ## `GET /tokens` { #get-tokens } Detected ERC-20 / ERC-721 contracts, with their transfer activity. - Query parameter `sort` — Order: most transfers (usage), most receiving addresses (popularity), most recent transfer (activity), or newest contract (CR-0108) - Query parameter `kind` — Token standard filter (default all) | Status | Body | |---|---| | 200 | array of `Token` | ```bash curl -s http://127.0.0.1:8089/api/v1/tokens ``` ??? info "Response fields" | Field | Type | Notes | |---|---|---| | `address` * | string | | | `kind` * | string | | | `first_block` * | integer | | | `name` | string \| null | Optional ERC-20 metadata as published by the token; null if absent | | `symbol` | string \| null | | | `decimals` | integer \| null | | | `transfers` | integer | Indexed Transfer events of this contract (since 0.8.0) | | `receivers` | integer | Distinct recipient addresses ever seen (not current holders) | | `last_transfer_block` | integer \| null | Block of the latest indexed Transfer | ## `GET /ai/events` { #get-ai-events } AI-market contract events decoded by signature, newest first (cursor-paginated; default 500). - Query parameter `before_block` — Exclusive upper bound; pass the last item's block number (observed_head for checkpoints) (minimum 0) - Query parameter `limit` — Page size (default 500) (minimum 1, maximum 500, default 500) - Query parameter `before_log_index` — With before_block, resume inside that block below this log index (/ai/events and /events only) (minimum 0) | Status | Body | |---|---| | 200 | array of `AiEvent` (max 500) | ```bash curl -s http://127.0.0.1:8089/api/v1/ai/events ``` ??? info "Response fields" | Field | Type | Notes | |---|---|---| | `block` * | integer | | | `log_index` * | integer | Log position in the block; cursor tie-breaker (added with pagination) | | `event` * | string | | | `contract` * | string | | | `tx` * | string | | | `topics` * | string | JSON-encoded topic list as stored | | `data` * | string | | ## `GET /events` { #get-events } Decoded events of the registered PQWERAI contracts, newest first (cursor-paginated; default 100). - Query parameter `before_block` — Exclusive upper bound; pass the last item's block number (observed_head for checkpoints) (minimum 0) - Query parameter `limit` — Page size (default 100) (minimum 1, maximum 500, default 100) - Query parameter `before_log_index` — With before_block, resume inside that block below this log index (/ai/events and /events only) (minimum 0) - Query parameter `module` — Only events of this module (ai, qai, pq, ipfs, pate = GhostTurbo permissions) - Query parameter `address` — Only events emitted by this contract address | Status | Body | |---|---| | 200 | array of `ProtocolEvent` (max 500) | | 400 | `Error` — {"error": "…"} | ```bash curl -s http://127.0.0.1:8089/api/v1/events ``` ??? info "Response fields" | Field | Type | Notes | |---|---|---| | `block` * | integer | | | `log_index` * | integer | | | `module` * | string | ai, qai, pq, ipfs, pate = GhostTurbo permissions (or unknown when only the signature matched) | | `contract` * | string \| null | Contract name; null when the emitter is unregistered and the signature is shared | | `event` * | string | | | `address` * | string | Emitting contract | | `tx` * | string | | | `exact` * | boolean | True when the emitter is a registered deployment; false when identified by signature only | | `args` * | object | Decoded parameters by name. Integers are decimal strings; a value that could not be decoded is an object with a _raw member. | ## `GET /contracts` { #get-contracts } Registered protocol contracts and system accounts of this chain, with the deployment evidence cited. | Status | Body | |---|---| | 200 | array of `Contract` | ```bash curl -s http://127.0.0.1:8089/api/v1/contracts ``` ??? info "Response fields" | Field | Type | Notes | |---|---|---| | `address` * | string | | | `contract` * | string \| null | | | `module` * | string | | | `label` * | string \| null | | | `kind` * | string | | | `evidence` * | string \| null | Repository path of the deployment record the address was taken from | | `status` | string \| null | Added in API 1.7.0: reserved = fixed address, contract not deployed yet; no code (API 1.9.0) = listed deployment without code at the indexed head | ## `GET /deployments` { #get-deployments } Deployment state of this chain's protocol contracts, including the ones still pending a deployment. | Status | Body | |---|---| | 200 | `object` | ```bash curl -s http://127.0.0.1:8089/api/v1/deployments ``` ??? info "Response fields" | Field | Type | Notes | |---|---|---| | `chain_id` * | integer \| null | | | `contracts` * | array | | | `pending` * | array | | ## `GET /features` { #get-features } Readiness of the Ghost technologies by state (implemented, integrated, configured, enabled, independently validated). | Status | Body | |---|---| | 200 | `object` | ```bash curl -s http://127.0.0.1:8089/api/v1/features ``` ??? info "Response fields" | Field | Type | Notes | |---|---|---| | `schema` * | string | | | `source` * | string | | | `verified_on` * | string | | | `states` * | array | | | `features` * | array | | ## `GET /provenance` { #get-provenance } Source, method, unit, update frequency and class (on-chain, node-reported, indexed, estimated) of every overview metric. | Status | Body | |---|---| | 200 | `object` | ```bash curl -s http://127.0.0.1:8089/api/v1/provenance ``` ??? info "Response fields" | Field | Type | Notes | |---|---|---| | `schema` * | string | | | `classes` * | object | | | `metrics` * | array | | ## `GET /pools` { #get-pools } Model pools published by the pool directories (off-chain), with shared memory and self-measured speed. - Query parameter `sort` — Order: contributing members, members online, total tok/s, average tok/s, shared VRAM, 24 h uptime (CR-0108) - Query parameter `status` — Only pools open to join, or only pools serving (default all) | Status | Body | |---|---| | 200 | `Pools` | ```bash curl -s http://127.0.0.1:8089/api/v1/pools ``` ??? info "Response fields" | Field | Type | Notes | |---|---|---| | `configured` * | boolean | False when this explorer has no pool directory configured | | `available` * | boolean | False when no directory answered and no recent answer is cached | | `source` * | string \| null | Directory that answered | | `stale` * | boolean | | | `age_seconds` * | integer \| null | | | `totals` * | object | Sums over the listed pools (empty when unavailable) | | `pools` * | array | | # Explorer data semantics # Explorer data semantics ## Canonical chain identity `GET /api/v1/status` returns `chain_id` and `genesis` (hash). Pin both; an explorer for another network will differ. `client` is the node's `web3_clientVersion`. ## Freshness | Field | Meaning | |---|---| | `indexed_tip` | Highest block in the explorer database | | `node_head` | Head reported by the node right now (null if unreachable) | | `lag_blocks` | `node_head − indexed_tip` | Indexed data (blocks, transactions, tokens, issuance, events) is as of `indexed_tip`. `/address/{address}.balance_wei` is read live from the node at `latest`. ## Reorganisations and finality - The indexer follows the heaviest chain; when a heavier branch replaces non-finalized blocks it rewrites them and records the reorganisation (`reorgs_handled`). - A reorganisation **below** the recorded finalized checkpoint is never applied: the indexer raises a `finality_violation` alarm (visible in `/status.alarms`) and stops indexing. That would indicate a consensus fault. - Treat everything above `finalized_height` as reversible. ## Pagination and size limits API v1 has **no cursor or page parameters**; query strings are ignored. Each list is a fixed newest-first window: | Endpoint | Window | |---|---| | `/blocks` | 25 blocks | | `/issuance` | 50 blocks | | `/checkpoints` | 100 observations | | `/ai/events` | 500 events | | `/address/{address}` | 50 transactions + 50 token transfers | | `/mining` | statistics over 64 blocks | For complete history use JSON-RPC (`eth_getLogs` in ≤ 5000-block ranges) or run your own explorer database. ## Amounts and types Wei and gwei values that may exceed 2^53 are **decimal strings**. Block numbers, timestamps (Unix seconds), gas and counts are integers. Addresses in responses are lower-case. ## Errors | HTTP | Body | When | |---|---|---| | 400 | `{"error": ""}` | Path value not decimal or 0x-hex | | 404 | `{"error": "not found"}` | Unknown block/transaction, unknown route | Every response carries `Content-Type: application/json; charset=utf-8`, `X-Content-Type-Options: nosniff` and a restrictive `Content-Security-Policy`. # Getting Started # Getting Started Every journey below is a sequence of shell scripts stored in `developers/examples/`. The pages include those files verbatim, and `scripts/devhub/run_examples.sh` executes the same files against a real PQWERAI node before each documentation release (for this release before the chain 20778 launch; a re-run on chain 20778, live since 27 November 2026, is still to be recorded). The latest results are in [Source provenance](../resources/provenance.md). For **C++ and C#**, follow [Your first WASM contract](../contracts/wasm/first-contract.md). That guide uses Contract Studio; its verification limits are described separately from the shell journeys below. | Journey | You will | Time | Status | |---|---|---|---| | [Blockchain quickstart](blockchain-quickstart.md) | Check the chain ID, read a block, create an account, send tPQAI, wait for BFT finality | 10 min | Tested | | [Verify wallet and get test coins](verify-wallet.md) | Discord verification, native/manual signing and faucet | 10 min | Candidate integration; supporting wallet and service required | | [First smart contract](first-smart-contract.md) | Compile, deploy, verify and call a Solidity contract with Foundry | 10 min | Tested | | [Create a token](create-token.md) | Deploy an OpenZeppelin ERC-20 (Wallet Studio or Foundry) | 10 min | Tested | | [Create NFTs](create-nfts.md) | ERC-721 and ERC-1155: metadata, minting, transfers | 15 min | Tested | | [Mine from the Windows wallet](wallet-mining.md) | Start the bundled native node, choose the mining threads and mine tPQAI | 15 min | Wallet guide (0.8.13 screens); live 24-thread run before the chain 20778 launch | | [Become a miner](become-a-miner.md) | Run GhostRider mining and read confirmed rewards | 20 min | Rewards check tested; node setup is the operator guide | | [Set up a Smartnode](smartnode.md) | Keys, registration, staking, delegation, voting and custody | 30 min | Key generation and registry reads tested | | [Earn the IPFS storage reward](ipfs-storage-reward.md) | Bond, pin manifest content with Kubo and prove it each round (v2) | 30 min | 5 % share credited on 20778 from block 1; pool contract deployed (block 143); no storage operator on 20778 yet; agent tested on a rehearsal chain | | [Create or join a model pool](model-pool.md) | Read the pool directories, join `bonsai-2-community` or create a pool for one model | 15 min | Wallet guide; directory reads checked against the live directories | | [AI provider quickstart](ai-provider.md) | GhostLLM runtime boundary, opt-in policy, usage records, settlement | 30 min | Experimental, not a public service | | [Build an AI payment application](ai-payment-app.md) | Quote, fund, propose, accept, finalize, withdraw and refund on `ServiceEscrow` | 20 min | Tested | Every journey whose status says *Tested* runs from scripts. The wallet guides follow the wallet's screens and are checked by hand. ## Before you start !!! warning "Testnet" PQWERAI testnet 20778 is a test network: tPQAI, tEUR and tQAI have no value and mainnet does not exist. A public JSON-RPC endpoint serves reads and raw signed transactions: `https://rpc-testnet.pqwerai.com` (chain ID 20778; the endpoint serves it since 28 November 2026). The [testnet airdrop](https://pqwerai.com/airdrop/) sends 1 tPQAI per IP address every 24 hours; for more, run your own node (see [Install a node](../nodes/install.md) or the Windows Wallet's *Node* page). tEUR for the [QAI curve](../contracts/guides/qai-post-quantum.md) comes from its own on-chain faucet. Tools used by the journeys: | Tool | Version tested | Notes | |---|---|---| | PQWERAI Core (`pqwerai-core`, `pqwerai-cli`) | Core `a679d60a1` (chain 20778 build) | Linux x86-64; Windows x64 native (bundled in the wallet) | | Foundry (`forge`, `cast`) | 1.8.5 | [foundry.paradigm.xyz](https://getfoundry.sh) | | solc | 0.8.26 | Pinned; forge downloads it when `solc_version = "0.8.26"` is set | | Python | 3.9+ | Standard library only in the examples | | curl, openssl | any | | Every journey starts by loading the same environment file: ```bash title="env.sh" --8<-- "env.sh" ``` # Build an AI payment application # Build an AI payment application This journey drives the real `ServiceEscrow` contract (revenue policy v3) through a complete paid job and a refund, with three separate keys. It is the contract the PQWERAI AI market uses; on the testnet each market deploys its own instance, so your application must be configured with the escrow address it trusts. **Prerequisites:** `env.sh`, Foundry 1.8.5, solc 0.8.26 (`SOLC=solc`), three keystores (payer funded with ≥ 0.002 tPQAI plus gas, provider funded for gas, arbiter unfunded), and `ServiceEscrow.sol` (below). ```mermaid stateDiagram-v2 [*] --> Funded: fund(quote, providerSig) Funded --> Proposed: propose(receipt, tokens) [provider] Proposed --> Accepted: accept [payer] Proposed --> Disputed: dispute [payer or provider] Accepted --> Disputed: dispute [payer, within challenge window] Disputed --> Accepted: resolve(approvedCharge) [arbiter] Accepted --> Settled: finalize [anyone, after window] Funded --> Refunded: refundExpired [after service window] Proposed --> Refunded: refundExpired Disputed --> Refunded: refundExpired [arbiter silent] ``` ## The contract ??? example "ServiceEscrow.sol (MIT) — full source" ```solidity --8 640000000000000 [6.4e14] # provider credit = 640 tokens × 1e12 wei 360000000000000 [3.6e14] # payer credit = unused budget true # provider withdraw true # payer withdraw true # refund job funded 10000000000000 [1e13] # payer credit after refundExpired ``` ## Integrating from an application === "Signing the quote (provider side)" ```bash QHASH=$(cast call "$ESCROW" "quoteHash((bytes32,address,address,bytes32,uint256,uint256,uint64,uint32))(bytes32)" "$QUOTE") cast wallet sign "$QHASH" --keystore provider.json --password-file provider.pw # EIP-191 over the 32-byte hash ``` === "ethers.js v6 (not executed for this release)" ```js // provider: sign the quote hash returned by escrow.quoteHash(quote) const sig = await providerWallet.signMessage(ethers.getBytes(quoteHash)); // payer: fund exactly maxTokens * pricePerToken await escrow.connect(payer).fund(quote, sig, { value: quote.maxTokens * quote.pricePerToken }); ``` Wait for BFT finality of the `Settled` transaction before treating a payment as irreversible ([finality](../blockchain/finality.md)). Index `Funded`, `Proposed`, `Changed` and `Paid` events, or read the explorer's [`/api/v1/ai/events`](../explorer/reference.md). ## Errors (revert reasons) | Reason | Meaning | |---|---| | `job reused` | Job id already funded | | `identity` | Sender is not the quote's payer, or provider/model is zero | | `expired` | Quote expired or service window outside 1..100000 blocks | | `budget` | `msg.value` ≠ maxTokens × pricePerToken | | `untrusted quote` / `noncanonical` / `signature` | Signature not by the provider, high-s, or wrong length | | `usage` | Receipt reused, zero, or tokens > maxTokens | | `state` / `late` | Call not allowed in the current state or after the deadline | | `not expired` | `refundExpired` before the deadline | | `empty` | Nothing to withdraw | # AI provider quickstart # AI provider quickstart !!! warning "Experimental test-network service" The wallet manages local model downloads and startup (wallet 0.9.0 for chain 20778); public model gateways and pool directories are available. Paid requests have been exercised by one operator; the AI market contracts are deployed on chain 20778, but no independent provider is registered there yet. Independent provider/hardware acceptance remains open. Signed usage is a claim, not proof of computation; no AI activity mints block rewards. For the normal desktop setup, follow [AI Sharing](../wallet/ai-sharing.md). The operator-oriented policy and generic ServiceEscrow integration below describe a separate profile. The wallet's current paid route is [AIJobMarket](../wallet/paid-ask.md), not the generic escrow ABI. ## Boundaries ```mermaid flowchart LR U[Application / wallet] -- OpenAI-compatible HTTP on loopback --> M[GhostLLM runtimeseparate process] M -- signed usage record --> P[Provider agent] P -- propose usage --> E[(ServiceEscrowon chain)] U -- fund / accept / dispute --> E N[PQWERAI nodeconsensus + EVM] --- E M -. never inside .- N ``` - **AI never runs inside consensus.** A stopped or compromised GhostLLM runtime cannot stop nodes from validating blocks. - Prompts and responses never go on chain; only quote hashes, receipt commitments and amounts do. - Inference only: paid training, training grants and training rewards are out of scope for this testnet. ## 1. Run the GhostLLM runtime locally The project pins the GhostLLM runtime (0.78.x) and a GGUF model by SHA-256; the supervisor verifies publisher/product/ native-file hashes before starting it with `--local-model-only`, isolates its data directory and disables analytics, default plugins and prompt disk caching. That manual operator profile requires installing pinned files yourself. The wallet managed flow downloads verified approved bundles through public IPFS HTTPS gateways. Wallets and clients reach the runtime only on literal loopback: `http://127.0.0.1:/v1` (OpenAI-compatible). ## 2. Opt in with a provider policy The Windows Wallet's **AI Sharing** page (Advanced mode) writes the same policy the runtime client uses: | Setting | Meaning | |---|---| | Inference / hosting consent | Nothing is served until you opt in | | GPU, CPU, power, temperature, bandwidth limits | Admission checks before each job (not physical limits) | | Hours (UTC) | When the node accepts work | | Minimum price | Lowest `pricePerToken` you will quote | | Payout address | Settlement address (separate from mining and validator keys) | | Give AI sharing priority over mining | On by default (wallet with CR-0053). While AI sharing serves, or the PC works in a model pool, and the built-in node mines, the node and its GhostRider helper run at the lowest Windows CPU priority, so mining only uses CPU time AI sharing leaves free. Normal priority returns when AI sharing stops. Current Windows wallets use the native node, without WSL | "Ask the model" sends a local test request and shows an **unverified, not payable** usage observation. ## 3. Usage records and settlement 1. The provider signs a **quote** (job id, payer, provider, model id, max tokens, price per token, expiry, service window) bound to chain ID 20778 and the escrow address. 2. The payer funds the job in [`ServiceEscrow`](../ai/service-escrow.md) with exactly `maxTokens × pricePerToken`. 3. After serving, the provider proposes usage with a receipt commitment (hash of its signed usage record). 4. The payer accepts or disputes; a trusted arbiter resolves disputes; unaccepted jobs refund after the window. 5. Funds are paid by pull withdrawal. Revenue policy v3: the provider receives the remainder after deployment-configured payees; the testnet default has no payees, so the provider receives 100 %. The full flow is executable in [Build an AI payment application](ai-payment-app.md). ## Limits you must design for - Finality: an escrow allocation in a non-finalized block can be reorganised away. Deliver irreversible goods only after the settlement block is BFT-finalized. - Arbiter and payer acceptance are trust assumptions; signed usage authenticates the provider's report, not its truth. - Multi-operator routing, accountable hardware measurement and model-poisoning evaluation remain open work ([known gaps](../resources/gaps.md)). # Become a miner # Become a miner (GhostRider) PQWERAI blocks are sealed by **GhostRider proof of work** computed by a pinned native helper (`pqwerai_hash_worker`). Mining is CPU-only. Every node verifies the helper's SHA-256 and refuses any other binary. **Prerequisites:** a synced PQWERAI node ([Install a node](../nodes/install.md)), Linux x86-64 or Windows x64 (wallet 0.8.11+, no WSL), an address for rewards whose key is **not** stored on the mining host. ## 1. Choose how to run the node === "VPS / Linux service" Edit `/etc/pqwerai/core.env` (installed by the release package): ```bash PQWERAI_MINE=true PQWERAI_ETHERBASE=0xYourRewardAddress # key kept elsewhere (hardware wallet, offline machine) ``` ```bash sudo systemctl restart pqwerai-core journalctl -u pqwerai-core -f | grep -i -E "sealed|mined|GhostRider" ``` === "Windows Wallet" *Node* page → **Join PQWERAI testnet 20778** (wallet 0.9.0 or later) (installs the native Core that ships with the wallet) → **Mine with this node**. Rewards go to the selected wallet account. === "Direct command" ```bash pqwerai-core --datadir ./data --genesis genesis.json \ --helper ./pqwerai_hash_worker \ --helper-sha256 3a54f0bb461f296b606c9386c68ebf37514a703e5dbff3de4c4a5828637099a8 \ --difficulty 64 --expect-genesis-hash \ --mine --etherbase 0xYourRewardAddress ``` `--difficulty` must equal the network's base difficulty (64 for testnet 20778, see [network parameters](../blockchain/network-parameters.md)). All flags: [Core CLI](../tools/core-cli.md). ## 2. How difficulty and rewards work - Target block interval 3–7 s. Difficulty doubles after a block ≤ 2 s and halves after a block ≥ 8 s, clamped to [base, 16 × base]. Above roughly 1024 hashes per 3 s of aggregate hash rate, blocks come faster than the band. - Fork choice: greatest total difficulty; the node never reorganises below the BFT-finalized checkpoint. - Each epoch's new issuance is split **67 % to miners, 18 % to active Smartnode validators, 1 % to the founder treasury, 9 % to the Quantum Reserve and 5 % to the IPFS storage pool** on chain 20778 from block 1, credited per epoch by validator vote participation. Transfers, gas fees and AI payments are never taxed. The base fee is burned; the priority fee goes to the miner. There is no supply cap. - Rewards are exact integers kept by consensus; `g4_status` exposes the lifetime counters. ## 3. Inspect confirmed rewards ```bash title="mining/check-rewards.sh" --8<-- "mining/check-rewards.sh" ``` Expected output (local testnet, numbers differ): ```text head 4501 finalized 4448 pow_issued_wei 1.475139 tPQAI pos_issued_wei 0.368785 tPQAI founder_issued_wei 0.018625 tPQAI fee_burn_wei 0.001109 tPQAI minted_wei 1019143.862550 tPQAI 1.512361080541570015 20 ``` `minted_wei` includes the genesis allocations; `pow/pos/founder` are issuance since genesis. Treat rewards in blocks above `finalized_height` as reversible. The explorer shows per-block issuance at [`/api/v1/issuance`](../explorer/reference.md). ## Mining in a pool To mine with XMRig through a pool instead of running your own node, see [Pool mining with XMRig](../mining/pool-mining.md). ## Operational guidance - Do not run AI hosting on the cores you mine with (`cpu_affinity` in the AI configuration). - Keep the reward key off the server; a compromised miner should only lose electricity. - A node with a different genesis, chain ID or helper hash cannot peer or will refuse to start — that is intended. ## Troubleshooting | Symptom | Cause | |---|---| | `--mine requires --etherbase` | Set `PQWERAI_ETHERBASE` / `--etherbase` | | `helper SHA-256 mismatch` | Wrong or modified helper binary — use the release package | | Blocks found but reorganised away | Another miner's heavier branch won before finality; normal below the finalized checkpoint | | `eth_getWork` returns `no mining work available yet` | The legacy external-miner interface is not how GhostRider mining works; mine inside the node, or use `--miner.external` with `eth_getG1Work` ([pool mining](../mining/pool-mining.md)) | | Stock XMRig shares all rejected | XMRig writes the GhostRider nonce at bytes 76–80, which must be zero here; build it with the PQWERAI patch ([pool mining](../mining/pool-mining.md)) | # Blockchain quickstart # Blockchain quickstart **Prerequisites:** a reachable PQWERAI node (local node on `127.0.0.1:8545` or an endpoint from the network operator), [Foundry](../tools/foundry.md) 1.8.5, `curl`, `openssl` and Python 3. **Environment constraints:** private testnet only; amounts are tPQAI. ```bash mkdir pqwerai-quickstart && cd pqwerai-quickstart # save env.sh from the Getting Started page here, then: export PQWERAI_RPC=http://127.0.0.1:8545 # or the endpoint you were given . ./env.sh ``` ## 1. Check the network Never sign anything for an endpoint that reports another chain. The PQWERAI testnet chain ID is **20778** (`0x512a`). ```bash title="quickstart/check-network.sh" --8 --value 20ether --keystore --rpc-url "$RPC"`. ## 4. Send a test transaction ```bash title="quickstart/send-transaction.sh" --8<-- "quickstart/send-transaction.sh" ``` ```text tx: 0x3d4ab2e584d4b8260dceaff66ff4f3a99b7f310e2764dcf062f0fc7cfe39cf69 true included in block 4389 19.989999999999832000 ``` ## 5. Wait for finality A receipt means the transaction is in the current canonical chain. On PQWERAI a block becomes irreversible when a BFT checkpoint at or above it is finalized by more than 2/3 of the Smartnode stake ([details](../blockchain/finality.md)). ```bash title="quickstart/wait-finality.sh" --8<-- "quickstart/wait-finality.sh" ``` ```text finalized (checkpoint 4416) ``` In the tested run this took about 8 minutes (two 32-block epochs at 3–7 s per block). ## Common errors | Symptom | Cause | Fix | |---|---|---| | `not chain 20778` | Wrong endpoint or a different network | Use a PQWERAI testnet node; never override the chain ID check | | `Connection refused` on `127.0.0.1:8545` | Node not running, or RPC on another port | `pqwerai-health`, or check `PQWERAI_RPC_PORT` in `/etc/pqwerai/core.env` | | HTTP `401 unauthorized` | Remote node uses `--rpc.token-file` | Add `-H "Authorization: Bearer …"` (curl) or use a local node | | `insufficient funds for gas * price + value` | Account not funded | Fund it (step 3) | | `nonce too low` | Another transaction from the same account was mined | Re-run; cast fetches the next nonce | | Finality loop never ends | Less than 2/3 of validator stake online; PoW continues but finality stalls | Check `g4_status`; the network operator must restore validator quorum | | `unknown account` | You called `eth_sendTransaction`; the node holds no keys | Sign locally (cast, wallet) — PQWERAI never unlocks accounts on nodes | # Create NFTs # Create NFTs (ERC-721 and ERC-1155) | Standard | Use it for | Tooling on PQWERAI | |---|---|---| | ERC-721 | Unique items, one owner per token ID | Foundry/Hardhat (tested); Windows Wallet Studio *NFT collection* template; wallet shows and transfers ERC-721 | | ERC-1155 | Many token types in one contract (fungible and unique) | Foundry examples and the current wallet Studio ERC-1155 template. A template/ABI flow does not imply full balance/event decoding in Tokens or the explorer | ## Metadata The chain stores only a URI. Host JSON metadata and images on IPFS (content-addressed, preferred) or HTTPS. ```json title="metadata-1.json" --8/1`). - ERC-1155: `uri(id)` returns a template with `{id}`; clients substitute the 64-character lower-case hex ID (`…/0000…0007.json`). ## Contracts === "ERC-721" ```solidity title="src/PQCollection.sol" --8/1" true 0x000000000000000000000000000000000000bEEF # ownerOf(1) after transfer … true true 60 # ERC-1155 balance of id 7 (me) 40 # ERC-1155 balance of id 7 (recipient) "ipfs:///{id}.json" ``` ## Notes and errors - `_safeMint` / `safeTransferFrom` call `onERC721Received` / `onERC1155Received` when the recipient is a contract; a contract without the hook makes the transfer revert (`ERC721InvalidReceiver`, `ERC1155InvalidReceiver`). - Minting is owner-only in these examples (`OwnableUnauthorizedAccount` otherwise). - The explorer indexes ERC-721 transfers; ERC-1155 `TransferSingle`/`TransferBatch` are not decoded yet ([known gaps](../resources/gaps.md)). # Create a token # Create a token (ERC-20) Want editable fixed-supply code in another language? [Basic token in every language](../contracts/guides/basic-token-all-languages.md) includes Solidity, Vyper, Yul, Huff, Fe, C++ and C#. Its constructors use raw base units; the separate wizard and owner-mintable Foundry example below retain their own settings. Two routes produce a standard ERC-20 on chain 20778. Both use **OpenZeppelin Contracts 5.0.2** and **solc 0.8.26**. === "PQWERAI Wallet Studio (no code)" 1. Install the [PQWERAI Windows Wallet](../tools/windows-wallet.md) for chain 20778 (0.9.0 or later) and connect it to a node. 2. Open **Studio** → *Contract type: Token (ERC-20)*. 3. Fill *Name and symbol*, *Supply*, optional *Features*, and the *Owner* (defaults to the selected account). 4. **Review** shows every parameter, the fee and the chain ID; confirm with your password. 5. **Verify and track**: the wallet compares the deployed runtime with its shipped artifact byte-for-byte, reads back name, symbol, supply and owner, and adds the token to *Tokens*. The token template is precompiled (deterministic, zero warnings), so no compiler is needed. Studio can also deploy custom Solidity pasted from an editor or AI assistant; that code is labelled *unaudited*. === "Foundry" **Prerequisites:** the quickstart account and `env.sh`; the [first contract](first-smart-contract.md) setup. ```bash title="install-openzeppelin.sh" --8<-- "token/install-openzeppelin.sh" ``` ```solidity title="src/PQToken.sol" --8<-- "token/src/PQToken.sol" ``` ```bash title="deploy-token.sh" --8<-- "token/deploy-token.sh" ``` Expected output: ```text "Tutorial Token" 1000000000000000000000000 [1e24] true 250000000000000000000 [2.5e20] 999750000000000000000000 [9.997e23] true 251000000000000000000 [2.51e20] ``` ## Design notes - **Decimals.** OpenZeppelin defaults to 18. Amounts on chain are integers: `250 TUT = 250 × 10^18`. - **Supply policy.** This example has an owner-only `mint`. Remove it (and `Ownable`) for a fixed supply. - **Ownership.** See [Access control and ownership](../contracts/guides/access-control.md) for two-step transfer and roles. - **Wallet display.** The Windows Wallet discovers ERC-20 balances from `Transfer` events and warns about tokens that impersonate native tPQAI or use hidden characters in their names. - **Explorer.** The explorer indexes ERC-20 transfers ([`/api/v1/tokens`](../explorer/reference.md)); it does not read token names or verify source yet. ## Common errors | Error | Cause | |---|---| | `OwnableUnauthorizedAccount(0x…)` | `mint` called by an account that is not the owner | | `ERC20InsufficientBalance` | Transfer larger than the sender's balance | | `Constructor argument count mismatch` | `--constructor-args` placed before other options | | `Source "@openzeppelin/…" not found` | Library not installed, or `remappings` missing in `foundry.toml` | # First smart contract # First smart contract This tutorial uses Solidity and the EVM. To create a contract in **C++ or C#**, follow [Your first WASM contract](../contracts/wasm/first-contract.md). **Prerequisites:** the [quickstart](blockchain-quickstart.md) account (funded) and `env.sh`, Foundry 1.8.5. **Result:** a `Counter` contract deployed, verified byte-for-byte and called. ## 1. Project layout ```text first-contract/ ├── foundry.toml └── src/Counter.sol ``` ```toml title="foundry.toml" --8 24,576 bytes (EIP-170). Split the contract or use libraries | Next: [Create a token](create-token.md) · [Language center](../contracts/languages/index.md) # Genesis Program and Mainnet Joinlist # Genesis Program and Mainnet Joinlist The Genesis Program is the community programme of the PQWERAI test network (chain 20778; the GenesisBadge contract is deployed, but the programme service is not running on 20778 yet, so it starts empty). You sign in with Discord, join the **Mainnet Joinlist**, link a testnet wallet and complete testnet tasks; each task is verified from evidence and shown on your dashboard at [pqwerai.com/joinlist/](https://pqwerai.com/joinlist/). !!! warning "Testnet only" tPQAI, tEUR and tQAI have no monetary value and will not be converted to mainnet coins. Points and badges record testnet participation only. The joinlist does not guarantee admission, priority or any allocation. Mainnet is not scheduled. **Status:** public health and aggregate-statistics APIs are reachable (23 November 2026); this review did not complete Discord OAuth, wallet linking or tasks end to end. See the [feature status](../resources/feature-status.md) ledger, entry *Genesis Program and Mainnet Joinlist*. ## 1. Sign in with Discord The site asks Discord for the `identify` permission only (your Discord user ID and display name). It cannot read your messages, servers or email. One registration per Discord account. ## 2. Link a wallet Linking proves you control an address by signing a short message (EIP-191 `personal_sign`). It is free and sends no transaction. PQWERAI never asks for a seed phrase or private key. - **MetaMask** (connected to chain 20778, see [MetaMask](../tools/metamask.md)): press *Link with MetaMask* and sign. - **Foundry**: choose *Sign with another wallet*, request the message and sign it locally: ```bash cast wallet sign --interactive "" ``` Paste the `0x…` signature back. The message expires after 10 minutes and works once. Published wallet releases do not offer this message-signing flow. Native signing/Discord connection exists on a separate development branch; it is not a released feature. ## 3. Testnet tasks | Task | Evidence you submit | Checked how | |---|---|---| | Get tPQAI from the faucet | faucet transaction hash | on chain: sent by the faucet to your linked wallet | | Send a testnet transaction | transaction hash | on chain: sent from your linked wallet | | Deploy a smart contract | contract-creation transaction hash | on chain: creates a contract, from your wallet | | Call a smart contract | transaction hash | on chain: calls an address with code, from your wallet | | Mine a GhostRider block | block number | on chain: block reward address is your wallet | | Run a synced full node | enode ID + height | moderator | | Run a testnet Smartnode | validator address + setup | moderator | | AI-sharing test | job or pool ID + provider address | moderator | | Accepted bug report or contribution | link | moderator | On-chain evidence must be successful, on chain 20778, at least 12 blocks deep and newer than the programme start. A transaction or block counts once across all registrations. Guides: [become a miner](become-a-miner.md), [wallet mining](wallet-mining.md), [Smartnode](smartnode.md), [AI provider](ai-provider.md), [first smart contract](first-smart-contract.md). ## 4. Your data The dashboard has *Download my data* and *Delete my registration*; the optional news opt-in is separate and can be switched off at any time. The full privacy notice is at [pqwerai.com/genesis/privacy/](https://pqwerai.com/genesis/privacy/). # Earn the IPFS storage reward # Earn the IPFS storage reward !!! warning "Chain 20778: share active from block 1, pool contract deployed, no operator yet" The **5 % IPFS storage share is part of the chain 20778 genesis**: `ipfs-reward/v1` is bound in the genesis profile and applies from **block 1**, the first settlement, with no fork flag on any node. Each epoch's issuance is split **67 % PoW / 18 % Smartnodes / 1 % founder / 9 % Quantum Reserve / 5 % IPFS storage pool**, credited once per 32-block epoch according to Smartnode vote participation (an epoch without votes credits nothing). The pool address is fixed: `0xf4286aEB5865B9Ea6d620595E9E72707B0134EB5` = CREATE(`0x7b20435DE366181F009b24BD25045Eb4fEf89252`, nonce 0). The IPFS reward v2 pool contract was **deployed in block 143** as that deployer's nonce-0 transaction (27 November 2026); the share credited before then accrued to the address. No storage operator runs on chain 20778 yet, and nothing has been claimed. Public model downloading needs no bond or enrollment; these rules concern reward participation only (see [public distribution](../ai/model-distribution.md)). Operators of IPFS **Kubo** nodes, alone or in an **IPFS Cluster**, keep network content available: model weights, contract artifacts and the documentation. From block 1, every settled epoch sends **5 % of block issuance** to the IPFS reward pool, taken from the PoW share of the 72/18/1/9 base split. The split is therefore **67 % PoW / 18 % Smartnodes / 1 % founder / 9 % Quantum Reserve / 5 % IPFS**; no extra supply is created. ## How it works: bonded proof of access (v2) 1. The pool keeps a **manifest** of the content the network needs: each entry is a CID, its size and the Merkle root of its bytes in 1 KiB chunks. 2. You **bond** tPQAI, **register** your node and **declare** which manifest entries you pin. The declaration counts from the next round. 3. Every round the pool **challenges** random 1 KiB chunks of what you declared. The choice comes from the block hash at the start of the round, so nobody knows it in advance. 4. Your agent reads those chunks **from your own Kubo node** and sends them with a Merkle path before the deadline. The contract checks them against the manifest root. 5. After the round, it is **settled**: every operator who proved receives a share by proven bytes. Late, missing or wrong answers are **slashed** from the bond. The earlier v1 design (proof of pinning without a bond, `protocol/IPFS_REWARD_V1.md`) is not used on chain 20778. ## Design parameters (IPFS reward v2) These are the parameters of the v2 contract and specification (`protocol/IPFS_REWARD_V2.md`). The pool is deployed on chain 20778; read the values from the contract to confirm them before you bond. | Parameter | Value | |---|---| | Pool | `0xf4286aEB5865B9Ea6d620595E9E72707B0134EB5` on chain 20778: deployed in block 143 as the deployer's nonce-0 transaction | | Rounds | **192 blocks** (about 30 minutes) | | Proof deadline | **4 blocks** after the round's seed block (about 35 seconds) | | Challenges | at least 8 per proof, and every holding is challenged every round (at most 32) | | Bond | 1 tPQAI per identity + 0.1 tPQAI per declared GiB | | Penalty | 5 % of the bond for a miss, rising with each consecutive miss; jailed after 3 in a row | | Unbonding and payout changes | take effect 48 rounds (about a day) later | | Earning replicas | at most 3 provers per content earn weight; extra provers share it | | Identity gate | none (`directory = 0`): the bond is the only one | | Curator | publisher key; manifest changes wait 9,300 blocks (about a day) and start the round after | ## What you will need - A Kubo node with its RPC API on `127.0.0.1:5001`, pinning manifest content (an IPFS Cluster peer can do the pinning; the reward is per Kubo node). - An operator key with tPQAI for the bond and gas, and a payout address (can be a wallet address you keep offline). - Python 3 with `eth-account`, `eth-abi` and `cryptography`, and a Core RPC endpoint on chain 20778. ## Run the agent (after the pool is deployed) ```bash # what a manifest entry looks like (the curator publishes these on the pool) python -m storage.ipfs_reward manifest --kubo http://127.0.0.1:5001 --cid # bond, register, declare manifest entry 0, then answer every round within the deadline, settle and claim python -m storage.ipfs_reward agent-v2 --rpc --pool 0xf4286aEB5865B9Ea6d620595E9E72707B0134EB5 \ --key-file ~/.pqwerai/ipfs-operator.key --payout --holdings 0 \ --bond-margin-bps 2000 --keeper # leave: move part of the bond to unbonding, or exit completely; withdraw after the unbonding delay python -m storage.ipfs_reward unbond-v2 --rpc --pool --key-file --amount python -m storage.ipfs_reward unbond-v2 --rpc --pool --key-file --exit python -m storage.ipfs_reward withdraw-v2 --rpc --pool --key-file ``` The agent refuses to declare content whose Merkle root its Kubo node cannot reproduce, answers each challenge with bytes read from Kubo at that moment, and never prints the key. `--bond-margin-bps 2000` keeps the bond 20 % above the requirement. `--keeper` also slashes other operators' unaccounted misses (slashes go to the reward carry, never to the curator). The agent polls every 2 seconds by default: keep it close to a fast Core RPC, because the deadline is only 4 blocks. !!! warning "Proof of access, not proof of unique storage" v2 proves fast, reliable access to the declared bytes and makes failures expensive. It does not prove the bytes sit on your own disk: a node that can fetch the challenged chunks fast enough from elsewhere still passes. Bonds and rewards are tPQAI with no monetary value. ## Limits - Every identity needs its own bond, and the replica cap limits what copies of one content can earn. - The round seed can still be re-rolled by the miner of the seed block withholding it (documented residual risk). - The pool contract is unaudited test-network code (author review only). - On chain 20778 no storage operator or agent has run yet. # Create or join a model pool # Create or join a model pool A **model pool** runs **one exact model** (one version, one set of weights) across several PCs. When the model plus working memory fits, a PC holds the **whole model** and the mesh routes complete requests among nodes. Otherwise the runtime assigns layer stages across PCs. Split memory remains separate, and the slowest stage/network limits performance. Directory membership alone is not runtime readiness. !!! warning "What works today" The directories, the relay, pool power, heartbeats and reputation penalties ran before the chain 20778 launch; on testnet 20778 the directory (`pools-testnet.pqwerai.com`) and the relay (`relay.pqwerai.com:3340`) are live, and the official pool, **bonsai-2-community**, was created on 28 November 2026 and has no members yet. Running one model split across several *independent* GPU PCs is **not verified yet**, and pool members are **not paid on chain** yet. Creating and joining are signed messages to the directories: no transaction, no fee. ## Where pools live | Directory | URL | |---|---| | pools-testnet | `https://pools-testnet.pqwerai.com` | | pools-testnet2 | `https://pools-testnet2.pqwerai.com` (no DNS on 20778 yet; use pools-testnet) | The directories replay the same signed pool log and reach the same state. The explorer shows them on its [Pools page](https://explorer.pqwerai.com/pools). ## Read the directories (any tool) These read-only routes need no key: ```bash curl -s https://pools-testnet.pqwerai.com/v1/pools # every pool, with capacity, terms and power curl -s https://pools-testnet.pqwerai.com/v1/pools/ # one pool curl -s "https://pools-testnet.pqwerai.com/v1/pools//log?after=0" # its signed operation log curl -s https://pools-testnet.pqwerai.com/v1/models # models that have pools curl -s https://pools-testnet.pqwerai.com/v1/models//reputation # members' strikes for a model ``` Writes (`POST /v1/ops`) are signed pool operations, normally sent by the wallet. ## Join a pool with the wallet 1. Install the wallet for 20778 (0.9.1; its built-in official pool list for 20778 is updated in a later build). Open **Pools** from the sidebar or command palette. 2. Under **Your PC shares**, pick the compute backend (CUDA, ROCm or Vulkan) and the memory to share in GiB, then press **Refresh**. With *CPU only*, the PC can join, but the current split runtime gives layers only to graphics cards. 3. Pick a model and a pool, for example **bonsai-2-community** (Bonsai 2 2B, open to graphics cards with 2 GiB or more, price 0). Pools have no member limit (CR-0097), so any number of PCs can join; the wallet's "machines" count is the number of members seated now. 4. Read the pool's **Commitment** and **Penalties** lines, then press **Join with this PC**. An open pool admits a matching graphics card without waiting for its coordinator. 5. Press **Work in this pool** to start the runtime; serving requires loaded stages or whole-model nodes, and **Stop working** to pause. **Verify pool log** checks the signed log yourself. ## Create a pool 1. On **Pools**, select the model and press **Create a pool for this model**. 2. Fill in **Pool name**, **Model layers**, **Price per output token (wei)**, **Your coordinator fee** (at most 20 %) and the **Minimum commitment** in hours (0 = none). 3. Optionally tick **Open pool** so any graphics card with at least 2 GiB joins without your approval. 4. Press **Sign and create**. Your PC becomes the pool's first machine, and the pool is bound to that exact model version and weights. ## Commitment and penalties (reputation, no deposit) | Rule | Value in the wallet's form | |---|---| | Heartbeat | every 5 minutes, signed by the member's node key | | Offline | silent for more than 15 minutes while on duty → reputation strike `offline` | | Removal | silent for more than max(1 hour, 4 × offline grace) → removed from the pool automatically (state `left`); the seat opens and the wallet offers to rejoin | | Leaving early | `leave` before the minimum commitment → strike `early_leave` | | Forfeit | a struck member loses its share of that topology epoch (100 %); the others get it | | Rejoin | allowed 1 hour after leaving | Strikes follow your wallet across pools of the same model (see the `reputation` route). There is no bond or deposit yet; an on-chain bond is planned. Full rules: `architecture/POOL_POWER_AND_PENALTIES.md` in the repository. ## Limits - The split of one request across independent GPU PCs, proof of computation and pooled on-chain settlement are open. - Pool power figures are measured and signed by each member's own node; the directories check their consistency, not their truth. - See [Model Pools](../wallet/pools.md) in the Wallet Manual and [AI network](../ai/index.md) for the wider design. # Set up a Smartnode # Set up a Smartnode Smartnodes are stake-backed validators. They do **not** produce blocks (GhostRider miners do); they sign checkpoint votes every 32-block epoch, and a checkpoint signed by more than 2/3 of the epoch set's effective stake becomes final. On testnet 20778 validators earn 18 % of each epoch's issuance for active duties (67 % PoW, 1 % founder, 9 % Quantum Reserve, 5 % IPFS storage pool), credited in proportion to vote participation. Registration, delegation, claims, key rotation, exit and withdrawal are part of the G4 registry from genesis. Slashing (25 % of stake burned for proven double or surround votes) is implemented; registry top-up and the stage-aware surround-vote fix are bound in the chain 20778 genesis profile from block 0, so validators pass no rule or fork flag. A validator silent for 12 checkpoints is force-exited (not slashed). !!! warning "What was tested for this page" Key generation and the registry/finality reads below were executed against the local testnet. Registration, delegation and exit were **not** re-run for this documentation release because a registered validator that does not sign reduces finality participation on the shared test network; those commands come from the operator guide and the Windows Wallet's tested Smartnode page. ## 1. Requirements and custody - A host that runs a synced node and **exactly one** signer per validator key, ever. Two signers with the same key will equivocate and be slashed. - An **owner** account (secp256k1, holds the stake, receives rewards) — keep it in a wallet, not on the validator host. - A **BFT key** (Ed25519) generated on the validator host. Only its `public` field ever leaves the host. - The signer's anti-equivocation journal must never be restored from an old backup (the backup tool skips it on purpose). ## 2. Generate the validator key (on the validator host) ```bash title="smartnode/keygen-and-inspect.sh" --8 -password-file owner.pw \ sn-register -from 0xOwner -keyfile sn-key.json -stake 32 ``` Genesis validators instead send their public key and payout address to the network owner before the genesis ceremony. The Windows Wallet offers the same flow under *Smartnodes → Register* (Advanced mode). ## 4. Run the signer (voting) ```bash sudo systemctl enable --now pqwerai-validator@ # key + password in /etc/pqwerai/validator// (0600) ``` The signer fetches the next checkpoint link (`g4_link`), signs it, and submits it to its own node with `g4_submitVote`. The node verifies the signature against the epoch validator set, rejects replays and stale votes, and relays a certificate once a quorum exists. These are [operator interfaces](../reference/json-rpc/operator.md): never expose them publicly. ## 5. Delegation, rewards, rotation, exit ```bash pqwerai-cli … sn-delegate -from 0xDelegator -id -amount 5 # min 0.001 tPQAI pqwerai-cli … sn-undelegate -from 0xDelegator -id -amount 5 pqwerai-cli … sn-claim -from 0xOwner -id pqwerai-cli … sn-rotate -from 0xOwner -id -keyfile new-key.json # then restart the signer pqwerai-cli … sn-exit -from 0xOwner -id pqwerai-cli … sn-withdraw -from 0xOwner -id # only after unbonding + finality pqwerai-cli … sn-slash -from 0xAnyone -vote-a -vote-b # report double/surround votes ``` Registry operations are ordinary transactions to the registry system account (gas 150,000 each); see [Registry operations](../smartnodes/registry-operations.md). ## 6. Finality health - `g4_status.finalized_height` should advance every one or two epochs. - With less than 2/3 of stake signing, PoW blocks continue but finality stalls until quorum returns. - Candidate `liveness/v1` genesis profile (experimental, active on the local testnet): validators that carry no vote for K consecutive checkpoints are force-exited (not slashed); `g4_status.liveness_ejected_validators` counts them. ## Common errors | Error | Cause | |---|---| | `vote does not authenticate against the checkpoint validator set` | Key not in the epoch set yet (activation delay) or wrong key | | `stale vote: target at or below the finalized checkpoint` | Signer behind; harmless | | withdraw refused | Unbonding not complete or withdrawable epoch not yet finalized | | signer refuses to sign | Its journal detected a would-be double or surround vote — do not delete the journal | # How to verify your PQWERAI wallet and get test coins # How to verify your PQWERAI wallet and get test coins Wallet verification proves that a wallet belongs to your Discord account. You approve a free message signature; it sends no transaction and costs no gas. After verification, an enabled Discord faucet resolves your linked address automatically. Test coins on chain **20778** have no monetary value. !!! warning "Availability" Automatic connection and the native `sign-message` commands are candidate features in this source branch. They require a wallet build containing signing protocol 1 and the matching enabled Discord service at `https://pqwerai.com/discord-wallet/`. Existing downloads may not contain them. If Discord does not offer **Connect PQWERAI Wallet**, use its manual signing flow with a supported EVM wallet. This guide does not announce a release or deployment. The website faucet remains a separate way to obtain test coins. ## Start in Discord 1. Join from the [official website](https://pqwerai.com/), read the community rules and register for the testnet. 2. Run `/verify-wallet` or press **Verify Wallet**. If prompted, explicitly accept the rules and register. 3. Choose **Connect PQWERAI Wallet** when offered, or **Sign manually**. 4. Check the wallet address and the Discord user ID in the complete challenge. Approve only a request you started. 5. Wait for server confirmation. Eligible participation points are awarded only once; they are not tokens. A request lasts **10 minutes**. Starting another challenge cancels the previous open workflow. A signature is bound to one Discord account, wallet address, chain, website and nonce. One wallet can belong to only one Discord account, and the existing 30-day wallet transfer cooldown still applies. ## Windows with the wallet installed Install a supporting **MSI** from the [official wallet page](https://pqwerai.com/wallet/). The MSI registers `pqwerai://` links for your Windows user. In the private connection page, choose **Open PQWERAI Wallet** and allow the browser to open the app if it asks. The browser cannot reliably determine whether the app is installed. Select the account you intend to verify. The wallet retrieves the challenge from the fixed official HTTPS service. Review the complete message, source, purpose, account, UTF-8 byte count and message hash. **Reject** cancels; **Approve** leads to the local keystore password prompt. A previously unlocked wallet still requires explicit approval. No message is signed merely by opening the application. The wallet sends only the signature to the verification service. You do not need to paste it. The backend checks it before linking the wallet and assigning the **Verified Wallet** role. Return using the page's **Return to Discord** link. If the role update is pending, refresh status; do not sign again solely to repair the role. ## Linux with the native CLI installed A supporting Linux x64 archive includes `install-desktop.sh`. On an XDG desktop, run that script from the extracted package, read its installation path and type `INSTALL` to opt in. It installs under your user data directory and registers the `pqwerai` scheme. It needs `xdg-mime` and a desktop terminal; no administrator rights are needed. Existing keystores are not moved. The connection link opens an interactive terminal. Select the correct local account, read the complete review, type `APPROVE` and enter the masked keystore password. Native links use `PQWERAI_KEYSTORE` when set; otherwise they use the wallet data folder's `keystore` directory. Configure that folder before launching the browser if your keys live elsewhere. A CLI command normally using `./pqwerai-keystore` may therefore need an explicit keystore path. Headless sessions and desktops without working protocol handlers should sign manually. ## Portable wallets and unsupported desktops Extracting a portable archive does not register a protocol handler. Choose **Sign manually**, enter your public wallet address and download `challenge.txt`. Keep its contents unchanged. In a supporting Windows wallet, enable Advanced mode and open **Console**. Select the intended account; `$me` resolves only the account argument. ```text title="Integrated wallet Console" --8<-- "wallet-signing/console.txt" ``` Approve the message dialog, enter your password and copy the resulting `0x` signature into Discord's existing signature modal, or into the private connection page if that page issued the challenge. You can also sign a short message with `-message "MESSAGE"`; use the downloaded file for multiline Discord challenges. On Windows CLI use `pqwerai-wallet-cli.exe`; on Linux use `./pqwerai-wallet-cli`. Put `-keystore DIR` before the command and replace `ADDRESS` and `SIGNATURE` with public values. Use the keystore containing the account whose address Discord displays. Portable Windows keys normally live under the extracted `wallet-data/keystore`. ```text title="Windows or Linux CLI command arguments" --8<-- "wallet-signing/cli.txt" ``` The CLI displays a review on stderr and requires an `APPROVE` line before asking for the password. In a terminal, password entry is masked. Do not put a password in command arguments, a script, chat or a screenshot. Sign and verify work offline without PQWERAI Core or an RPC connection. `verify-message` prints `valid=true` (exit 0) or `valid=false` (exit 1). Only signing needs the encrypted keystore and its password. `-file` preserves the file's exact UTF-8 bytes, including a BOM, line endings and trailing whitespace; invalid UTF-8 and messages over 16 KiB are rejected. Editors can change those bytes. Download again instead of repairing a failed challenge by hand. Do not use a shell's `$me` variable as a substitute for a public CLI address. ## MetaMask and other EVM wallets In the private connection page, choose **Use MetaMask**, select the account and inspect the wallet's personal message signing prompt. Reject any unexpected request. The page asks for `personal_sign` over the exact UTF-8 challenge, then submits the signature to the same backend. It never requests a seed, private key, password or transaction approval. A browser wallet extension must actually be available in that browser. Alternatively, use Discord's **Sign manually** option and sign the unchanged challenge with a wallet supporting [EIP-191 personal messages](https://eips.ethereum.org/EIPS/eip-191). Foundry users can select an existing encrypted local account and pass the exact file bytes as hex. Replace `LOCAL_ACCOUNT` with your local Foundry account name; enter the password only in its local prompt, then paste the signature into Discord. ```bash title="Foundry on a POSIX shell" --8<-- "wallet-signing/foundry.sh" ``` Foundry interprets `0x` messages as bytes and applies the personal-message prefix by default; its `--from-file` option is for typed JSON data. See the [Foundry signing reference](https://foundry-rs.github.io/foundry/cast/cmd/wallet/enum.WalletSubcommands.html). Do not use raw-hash or typed-data signing. Never paste a key into a website or Discord. ## Wallet not installed or using mobile Discord Use [Download PQWERAI Wallet](https://pqwerai.com/wallet/) for supported desktop builds. If the native app does not open, the page exposes **Sign manually**, browser-wallet signing, downloads and troubleshooting. An old wallet reporting an unknown command or unsupported protocol needs an update containing this feature. On mobile, open the private link in a browser that supports your EVM wallet, or copy the unchanged challenge to a supported wallet and return its signature to Discord. Desktop protocol activation is not a mobile installation check. Keep private connection links to yourself; request a fresh one if a link was shared or expired. ## Get test coins after verification Run `/faucet` or press **Get Test Coins**. When enabled, the bot uses your linked address and applies eligibility, 24-hour member/address limits and the faucet's global budgets. Its server-to-server HMAC allowance authorizes the claim. **You do not sign another wallet message.** The response includes the transaction hash and explorer link. If you started `/faucet` while unverified, verification offers **Continue faucet request**. Press it to continue your saved intent; verification alone does not distribute coins. Intent expires after 15 minutes and cannot be continued for a different linked account. A rejected or uncertain payout is not evidence that you should sign again. If Discord faucet claiming is disabled, use the [website faucet](https://pqwerai.com/airdrop/). Wallet signing cannot enable a disabled service. The website solves a short browser **proof of work**, accepts a public address and retains its own per-IP/address limits and daily cap. That proof of work is distinct from wallet ownership verification and the bot HMAC. The website Genesis Program has a separate login and database; its wallet linking does not automatically verify a Discord wallet. ## Troubleshooting | What happened | What to do | |---|---| | No app opens | Allow the browser's external-app prompt, install a supporting MSI or opt into Linux desktop registration; use manual signing if unavailable. | | Wrong account or request already bound | Reject and start a new `/verify-wallet` request. A bound request cannot switch addresses. | | Expired, cancelled or replayed request | Start a new request in Discord. Reusing a signature does not renew it. | | Wrong password | Enter it only inside your local wallet. You may retry an unexpired bound request; review and approve again. | | Invalid signature | Use the requested account and unchanged challenge file; avoid rich-text copy/paste and raw-hash signing. | | Network interrupted after signing | Refresh the page or **Refresh status** in Discord first. The service may already have committed verification. | | Role pending | The wallet is linked, but Discord role assignment has not succeeded. Refresh later or ask the team to check role permissions. | | Wallet already linked elsewhere | Follow the account policy and cooldown; creating extra accounts does not bypass it. | | Faucet unavailable or uncertain payout | Use its status/error guidance; an uncertain claim remains protected against duplicate payout. Signing again does not remove limits. | The connection never needs your seed phrase, private key, wallet password or funds. A full message review is still necessary: a message signature can authorize actions in other applications even though it is not a transaction. # Mine from the Windows wallet # Mine from the Windows wallet This guide is the no-terminal way to mine. The [Become a miner](become-a-miner.md) guide covers the command line and the exact reward accounting. !!! info "Wallet guide, checked by hand" The steps below use the wallet's own screens, so `scripts/devhub/run_examples.sh` cannot execute them. They follow the 0.8.13 user interface. A 24-thread live run with the same Core mined 42 blocks in a row on 18 November 2026, before the chain 20778 launch (`audit/evidence/2026-11-18-parallel-mining/`). | You need | Why | |---|---| | Windows 10/11 x64, the PQWERAI Wallet for chain 20778 (0.9.0 or later; earlier releases cannot join 20778) | The wallet bundles the native node, so WSL is not needed, and mines on every CPU thread | | An account in the wallet | Block rewards go to the selected account | | Disk space for the chain and a stable connection | Your node downloads and verifies every block | ## 1. Install and check the download Get the MSI or the portable ZIP from the [download center](https://pqwerai.com/downloads/) and compare its SHA-256 with the release `SHA256SUMS` (`Get-FileHash ` in PowerShell). The wallet is not code-signed, so Windows SmartScreen may warn. Installing over an older version keeps your keys and settings. ## 2. Start your own node 1. Open **Network → My node** (the *Node* page). 2. Choose **Run my own node** and **Start**. The wallet starts its bundled `pqwerai-core` with RPC on `127.0.0.1` only, checks its SHA-256 pins, and connects to it once chain ID 20778 and the genesis hash match. 3. Wait until the node shows it is **synced**. A fresh node first downloads the chain from the network's bootnodes. ## 3. Choose the mining threads Under **GhostRider mining**, set **Mining threads**: - `0` uses every logical processor (the default). - A smaller number leaves CPU for other work. Each thread is one GhostRider hash worker on its own nonce range; block validity does not change. Press **Apply (restarts the node)**. ## 4. Mine Tick **Mine with this node**. The status line shows when the node is mining. Rewards go to the selected account: miners share **67 %** of each epoch's issuance plus priority fees (see [Rewards and issuance](../mining/rewards-and-issuance.md)). Rewards are tPQAI with no monetary value. If you also share AI computing, the [AI Sharing](../wallet/ai-sharing.md) page can make the node and the hash helper drop to idle CPU priority while AI work runs. ## Check the result - The account balance in the wallet rises as your blocks settle. - In the [explorer](https://explorer.pqwerai.com/), blocks you sealed show your account as the miner. - From a terminal: `developers/examples/mining/check-rewards.sh` reads the confirmed rewards of an address (see [Become a miner](become-a-miner.md)). ## Limits - On chain 20778 the project's own miner hosts are the only always-on miners, so one many-thread PC can find many blocks in a row. Difficulty adapts within seconds (×2 if a gap is 2 s or less, ÷2 if it is 8 s or more). - Pool mining through XMRig is tested on a disposable chain only; no public mining pool runs. - The wallet's native node is a follower and miner. Smartnode signing needs a registered validator key ([Set up a Smartnode](smartnode.md)). # GhostRider Mining # GhostRider Mining | | | |---|---| | Algorithm | GhostRider, computed by the pinned native helper `pqwerai_hash_worker` (Linux x86-64; Windows x64 `pqwerai-hash-worker.exe` bundled in wallet 0.8.11+) | | Helper pin | SHA-256 `3a54f0bb461f296b606c9386c68ebf37514a703e5dbff3de4c4a5828637099a8`, committed in the genesis | | Block interval | 3–7 s target band | | Difficulty | Base 64, adaptive: ×2 after a block ≤ 2 s, ÷2 after ≥ 8 s, clamped to [base, 16 × base] | | Fork choice | Greatest total difficulty; ties keep the local head; never below the BFT-finalized checkpoint | | Reward share | 67 % of each epoch's issuance on chain 20778 from block 1 (the 72 % base share minus the 5 % IPFS storage pool share, bound in the genesis) + priority fees | | Threads | One hash worker per thread on separate nonce ranges since Core f5d9ce2c6: `-miner.threads N` on the CLI, **Mining threads** in wallet 0.8.13 (`0` = all logical processors); block validity is unchanged | Start mining: [Mine from the Windows wallet](../getting-started/wallet-mining.md), [Become a miner](../getting-started/become-a-miner.md) (solo, command line) or [Pool mining with XMRig](pool-mining.md). Reward accounting: [Rewards and issuance](rewards-and-issuance.md). ## Design boundaries - **Genesis binding:** genesis `extraData` commits to the GhostRider profile (base difficulty, adaptive flag, helper SHA-256, stream mode and the finality profile). A node with another helper or profile cannot follow the chain. - **Mining ≠ AI.** Mining, EVM execution and AI inference are separate processes. AI work never earns block rewards. - **Known limit:** the 16 × base clamp bounds how much aggregate hash rate the difficulty algorithm absorbs; above roughly 1024 hashes per 3 s blocks arrive faster than the band. A revised difficulty rule is a candidate, not active. - **External miners and pools:** the legacy `eth_getWork`/`eth_submitWork` interface is registered but is not how GhostRider mining operates. A node started with `--mine --miner.external` publishes GhostRider jobs through `eth_getG1Work` / `eth_submitG1Work` instead. The G1 stratum bridge and a two-line XMRig patch turn this into pool mining: [Pool mining with XMRig](pool-mining.md) (tested on a disposable chain; no public pool runs). # Pool mining with XMRig # Pool mining with XMRig !!! warning "Tested on a disposable chain only" The pool software below passed an end-to-end test on a disposable six-node harness (15 November 2026, before the chain 20778 launch). No public PQWERAI pool is running. Anyone may run one; this page shows how. Solo mining inside the node is described in [Become a miner](../getting-started/become-a-miner.md). Pool mining lets many CPUs share one node's block rewards in proportion to their work. ```text XMRig (patched) ──stratum──▶ g1_stratum_bridge.py ──eth_getG1Work / eth_submitG1Work──▶ pqwerai-core --miner.external many miners shares checked, per-miner loopback RPC + bearer token builds the block, difficulty, share log reward → -etherbase │ ▼ pool_payout.py ──signed tPQAI transfers──▶ miners' addresses ``` ## Why stock XMRig does not work GhostRider on PQWERAI hashes an 80-byte input: | Bytes | Content | | --- | --- | | 0–4 | `G1GR` | | 4–36 | parent block hash | | 36–68 | commitment to the header | | 68–76 | nonce, 8 bytes big-endian | | 76–80 | must be zero (consensus) | XMRig writes its 4-byte GhostRider nonce at bytes 76–80, the Raptoreum layout. The hash function is the same, but a stock miner's shares can never be valid here. The patch `mining/stratum/xmrig-6.26.0-pqwerai-g1.patch` (in the PQWERAI repository) changes two lines of XMRig 6.26.0: - nonce offset 76 → **72**: the miner varies bytes 72–76; the pool gives each connection its own bytes 68–72; - donation level 1 % → **0 %**, so the miner never connects to XMRig's donation pool. No fork and no consensus change are needed. Existing Raptoreum pool software does not work as is. ## For miners ```bash curl -L -o xmrig-6.26.0.tar.gz https://github.com/xmrig/xmrig/archive/refs/tags/v6.26.0.tar.gz sha256sum xmrig-6.26.0.tar.gz # 5005144e78571f26586410c2b2ede2b0c72afe22f97f1708ea24cfb253c3939b tar xzf xmrig-6.26.0.tar.gz && cd xmrig-6.26.0 patch -p1 < xmrig-6.26.0-pqwerai-g1.patch # from mining/stratum/ in the PQWERAI repository mkdir build && cd build cmake .. -DWITH_HWLOC=OFF -DWITH_TLS=OFF -DWITH_OPENCL=OFF -DWITH_CUDA=OFF && make -j"$(nproc)" ./xmrig-notls -o POOL_HOST:3333 -u 0xYourPayoutAddress.rig1 -p x --donate-level=0 ``` - The login is your **payout address** (optionally `.workername`). Its key stays off the mining machine. - Do **not** pass `-a gr`: that selects XMRig's Raptoreum client, which speaks another protocol. - XMRig is GPL-3.0. Only the patch is in the PQWERAI repository; whoever distributes a built binary must also provide its source. ## For pool operators 1. Run a synced node in external-mining mode, with the pool address as the reward address: ```bash pqwerai-core ... --mine --miner.external --etherbase 0xPoolAddress ``` In this mode the node does not seal blocks itself. It publishes one job at a time through `eth_getG1Work` and accepts solutions through `eth_submitG1Work`, both behind the node's RPC bearer token, and verifies every solution again before sealing. 2. Run the bridge on the same host: ```bash python3 mining/stratum/g1_stratum_bridge.py \ --node-rpc http://127.0.0.1:8545 --token-file /etc/pqwerai/rpc.token \ --helper /path/to/release/pqwerai_hash_worker \ --listen 0.0.0.0:3333 --public --require-address \ --share-difficulty 64 --share-seconds 10 \ --share-log /var/lib/pqwerai-pool/shares.jsonl --stats /var/lib/pqwerai-pool/stats.json ``` | Behaviour | Detail | | --- | --- | | Share check | Every share is recomputed with the same GhostRider helper as the Core; invalid, duplicate and low-difficulty shares are rejected | | Variable difficulty | Per connection, every 30 s, aiming at one share per `--share-seconds`, at most ×2 or ÷2 per step | | Share log | One JSON line per accepted share: time, payout address, difficulty | | Safety | Node RPC must be loopback; a non-loopback listen address needs `--public` | 3. Pay miners with `pool_payout.py`: ```bash pool_payout.py init --rpc http://127.0.0.1:8545 --token-file rpc.token --pool 0xPoolAddress --state payout.json pool_payout.py round --rpc http://127.0.0.1:8545 --token-file rpc.token --share-log shares.jsonl \ --state payout.json --fee-percent 1 --min-payout 0.1 # dry run: prints the plan pool_payout.py round ... --pool-key-file pool.key --send # pays ``` Rewards reach the pool address once per 32-block epoch, plus transaction fees in each block ([Rewards and issuance](rewards-and-issuance.md)). So a round measures the pool's income from balances: `income = balance(B′) − balance(B) + everything the pool address sent in blocks B+1…B′` `B′` is the head minus `--confirmations` (default 64). The income minus the fee is split over the work (sum of share difficulties) logged between the timestamps of `B` and `B′`. Amounts below `--min-payout` carry over to the next round. Each payout is signed and written to the state file before it is broadcast, so a rerun after a crash sends the same transactions again and never pays twice. Use the pool address for nothing else: any other spending would be counted as income. ## Test result Disposable six-node harness, base difficulty 64, two patched XMRig processes: blocks mined only through the bridge, all six nodes on the same head, every share recomputed, no invalid share, and a payout round that paid each miner exactly its credited amount. Details and pins: `audit/evidence/2026-11-15-g1-stratum/` in the repository. ## Limits - **Hash rate and difficulty:** the difficulty is clamped to 16 × base (1,024 on chain 20778). A pool with more than roughly 340 GhostRider hashes per second keeps the difficulty at that ceiling, and blocks come faster than the 3–7 s band. A revised difficulty rule is a candidate, not active ([GhostRider mining](index.md)). - No TLS in the bridge: put a TLS terminator (for example stunnel) in front of a public port. - One node per bridge. After a block is found the node drops the job, so later candidates for it are rejected. - Rewards are reversible until the block is final; keep `--confirmations` above the finality delay. # Rewards and issuance # Rewards and issuance | Rule | Value | |---|---| | Split of each epoch's new issuance | **67 %** GhostRider miners · **18 %** active Smartnode validators (for authenticated duties) · **1 %** founder treasury · **9 %** Quantum Reserve · **5 %** IPFS storage pool, from block 1 (the first settlement; block 0 has no issuance) on chain 20778. This is the 72/18/1/9 base split with 5 points of the PoW share going to the [IPFS storage pool](../getting-started/ipfs-storage-reward.md) `0xf4286aEB5865B9Ea6d620595E9E72707B0134EB5`, bound in the genesis profile (no fork flag); its contract was deployed there in block 143 (no storage operator on 20778 yet). The disposable 1337 fixture keeps 79.2 / 19.8 / 1 | | When it is credited | At each epoch settlement (every 32 blocks), in proportion to validator vote participation: an epoch without vote participation issues nothing, the PoW share included | | Founder share | Carved out of the same issuance — no extra supply, never charged on transfers, gas or AI payments | | Supply cap | None (uncapped by policy) | | Base fee | Burned (`fee_burn_wei`) | | Priority fee | To the block's miner | | AI service revenue | Separate: paid by customers through escrow, never minted ([revenue policy](../ai/revenue-policy.md)) | The issuance *schedule* on the testnet is an Ethereum-derived local reference; read actual amounts from the counters below instead of assuming a fixed block reward. ## Exact counters Consensus keeps lifetime counters in a system account; `g4_status` returns them as decimal strings of wei: | Field | Meaning | |---|---| | `minted_wei` | Total supply minted including genesis allocations | | `pow_issued_wei` | Issued to miners | | `pos_issued_wei` | Issued to validators | | `founder_issued_wei` | Issued to the founder treasury | | `reserve_issued_wei` | Issued to the Quantum Reserve | | `ipfs_issued_wei` | Issued to the IPFS storage pool (5 % of each settled epoch on chain 20778 from block 1) | | `fee_burn_wei` | Base fees burned | ```bash title="mining/check-rewards.sh" --8<-- "mining/check-rewards.sh" ``` The explorer reads the same counters at every block hash, so per-block issuance and supply are exact: [`/api/v1/supply`](../explorer/reference.md#get-supply), [`/api/v1/issuance`](../explorer/reference.md#get-issuance). The explorer reports **total supply** = `minted − base-fee burn − slashing burn` (slashing may be unknown before its first observation). Locked stake and treasuries remain included. Compatibility field `circulating_wei` equals total supply, not free-float/circulating supply. # Node Operations and Infrastructure # Node Operations and Infrastructure | Task | Page | |---|---| | Requirements, install, configure, firewall, start | [Install a node](install.md) | | Expose JSON-RPC to wallets safely (TLS, token, rate limits) | [RPC exposure and security](rpc-security.md) | | Metrics, alerts, backup/restore, upgrades and rollback | [Monitoring, backup, upgrades](operations.md) | | All `pqwerai-core` flags | [Core CLI and flags](../tools/core-cli.md) | | Mining | [Become a miner](../getting-started/become-a-miner.md) | | Validator signer | [Set up a Smartnode](../getting-started/smartnode.md) | Principles: every host runs the same pinned release; bootstrap nodes have no consensus privileges; RPC stays on loopback; secrets are referenced by path and never placed in config files; validator keys live on exactly one host. # Internal agents and community inference # Internal agents and community inference The project has six internal roles: **Network Monitor, Security, Economic, Compute Scheduler, Training Coordinator and Developer**. Model suggestions pass deterministic guards and signed capability policies. A model cannot widen its authority. Agent actions, chain validation and economic governance are separate systems. ## Latest recorded deployment The 22 November author record reports a six-role supervisor and durable peer-message collaboration, plus a separate Discord status bridge. Peer allegations are checked against fresh local observations. Failed work retries before message expiry; missing responses produce incomplete assessments. Discord receives fixed status codes/counts, not raw logs, prompts, addresses or keys. Reporting grants no Discord control over the agents. | Role | Boundary | |---|---| | Network Monitor | Observe health and propose operations; no automatic resync or restart authority | | Security | Supervised observations/proposals; existing standalone guarded firewall enforcement is separate | | Economic | Observe policy/caps; waiting community inference cannot move funds or trigger reserve rules | | Compute Scheduler | Advisory proposals, not measured delivery proof or permission to buy inference | | Training Coordinator | Verify approved content/integrity under policy; no reward minting | | Developer | Proposals under the deployed policy; no automatic CI execution grant in that supervisor profile | ## Official free pool: waiting The later 22 November free-community record supersedes the earlier local-model backend description. The six roles continue deterministic checks in **rules-only waiting mode** for **bonsai-2-community**. No paid, other-pool or local model fallback is configured. Public directory reads on 23 November showed no active serving epoch for that pool. A reachable, approved inference gateway is also required before community inference can run. The separate free-only prototype binds requests/responses to client, role, model, weights and expiry; it has replay protection, quotas, bounded input/output and a real local guard. It is not active official-pool inference, an independent security audit or an economic grant. Do not infer live AI decisions from successful supervisor ticks. These implementations live on separate development branches. No agent runtime or policy is deployed by this docs update. The Genesis sign-in service and native-wallet Discord signing are different integrations. # Exchange, custody and wallet-provider integration # Exchange, custody and wallet-provider integration PQWERAI is an EVM chain. Native tPQAI transfers are ordinary Ethereum-style transactions signed with secp256k1 and EIP-155, so an integration that already supports "another EVM chain" (Ethereum, BNB Chain, Ethereum Classic, Base…) needs **configuration, not new code**, with the differences listed on this page. !!! warning "Testnet" This page describes public testnet **20778** (live since 27 November 2026). Testnet coins carry a "t": tPQAI has no value and must not be listed for trading. Mainnet parameters (chain id, genesis, endpoints) will be published separately. ## Network identity | Item | Value | |---|---| | Chain id / network id | `20778` (EIP-155 chain id; `eth_chainId` = `0x512a`) | | Genesis block hash | `0xe7c41635510f505a98776ca3a198730e0cc120cd10039069006be334f41f3db6` (genesis v3, Core `a679d60a1`) | | Native coin | tPQAI (testnet ticker; the mainnet coin will be PQAI), 18 decimals (smallest unit "wei", as on Ethereum) | | Wrapped coin (ERC-20) | tWPQAI `0xae14c8C74ff10F7fe43E7ADe4306E5257fdA02b4`, deployed 27 November 2026 (no legacy wrapper on 20778), see [standard contracts](../contracts/guides/canonical-contracts.md) | | Public RPC (read + `eth_sendRawTransaction`) | `https://rpc-testnet.pqwerai.com` (serves chain 20778 since 28 November 2026) | | Explorer | `https://explorer.pqwerai.com` | | Multicall3 | `0xcA11bde05977b3631167028862bE2a173976CA11` (deployed 27 November 2026) | Always pin **both** the chain id and the genesis hash: a chain id alone does not identify a network. ## Keys and addresses - secp256k1 keys, Ethereum addresses (20 bytes, `0x` + hex), EIP-55 checksums. Any Ethereum key library, HSM or MPC engine that signs Ethereum transactions signs tPQAI transactions. - HD wallets: no PQWERAI-specific SLIP-44 coin type is registered. Use coin type **60** (`m/44'/60'/0'/0/n`), as most EVM chains do; replay protection comes from the chain id, not the derivation path. - Post-quantum accounts (ML-DSA) exist only for the tQAI test token and are not used for native tPQAI. ## Transactions and fees | Item | PQWERAI 20778 | |---|---| | Accepted transaction types | `0x0` legacy (EIP-155), `0x1` access list (EIP-2930), `0x2` dynamic fee (EIP-1559) | | Not accepted | `0x3` blob (EIP-4844), `0x4` set-code (EIP-7702) | | Fee model | EIP-1559: the base fee is burned, the priority fee goes to the block producer | | Base fee | starts at 1 gwei at genesis and follows EIP-1559; a native transfer costs 21,000 gas | | Block gas limit | 15,000,000 | | Block interval | target 3–7 s ([network parameters](../blockchain/network-parameters.md)); measure it on the live chain with the [explorer](https://explorer.pqwerai.com) | Set `maxFeePerGas` to at least twice the current base fee plus your priority fee, as on Ethereum. ## Confirmations and finality PQWERAI combines proof-of-work blocks with BFT checkpoints signed by Smartnodes (validators). 1. **Credit deposits only at BFT finality**: a block is final when `blockNumber ≤ g4_status.finalized_height` and its hash equals the canonical hash at that height. Nodes never reorganise below that checkpoint. See [finality](../blockchain/finality.md). 2. **The `safe` and `finalized` block tags work on the public RPC only.** `rpc-testnet.pqwerai.com` and `rpc-testnet2.pqwerai.com` resolve both to the verified Smartnode finalized checkpoint (CR-0094). Your own Core node returns `finalized block not found` for them, so an exchange node should keep using `latest` plus `g4_status`. 3. If validators are offline, PoW blocks continue but `finalized_height` stops. Pause deposit crediting rather than falling back to a confirmation count; alert when `latest − finalized_height` grows beyond your threshold. ## Detecting deposits | Deposit kind | How to detect | |---|---| | Native tPQAI sent by a normal account | Transaction `to` = deposit address, receipt `status = 0x1`, value from the transaction | | tWPQAI and other ERC-20 tokens | `Transfer(address,address,uint256)` logs of the token contract, `eth_getLogs` (range limit 5,000 blocks per request) | | Native tPQAI sent **by a contract** (internal transfer) | Not visible through RPC tracing yet: PQWERAI Core does not expose `debug_trace*` / `trace_*`. Reconcile with `eth_getBalance` at the block, or ask depositors to use tWPQAI or a direct transfer | **Rewards arrive without a transaction.** Mining, Smartnode, founder, Quantum Reserve and IPFS-pool rewards are credited by consensus at settlement blocks (every 32 blocks, block `32e + 1`), with no transaction and no log. Never use a deposit or hot-wallet address as a mining `etherbase` or validator payout address. If you must, reconcile balances by `eth_getBalance` deltas rather than by summing transactions. ## Running your own node Run your own node for deposit and withdrawal processing. The public RPC is rate-limited and only for reads and transaction submission. Requirements: - the `pqwerai-core` binary for the current release and the pinned GhostRider hash helper; - **no hard-fork or rule flags**: on chain 20778 every former fork rule (registry top-up, the stage-surround slashing fix, EIP-6780, WASM locals metering, GhostShield v2 with payment-assurance claims from block 1, and the IPFS storage reward from block 1) is bound in the genesis profile, so nodes pass none of them. Core `a679d60a1` or later is required; older Cores refuse this genesis, and a conflicting rule flag is refused at start-up; - `-expect-genesis-hash` set to the genesis hash above, `-difficulty 64`, and the bootnodes of the network bundle's `bootnodes.txt` (five public nodes since the 2026-11-27 launch; a signed seed manifest for chain 20778 is not published yet). Keep the RPC on loopback or behind your own authenticated proxy (see [RPC exposure](rpc-security.md)). Do **not** enable `-rpc.allow-unprotected-txs` on a node that handles customer funds: it exists only so operators can submit the keyless canonical deployments, and it would let replayable transactions in through your RPC. ## Known differences from Ethereum (summary) | Area | Difference | Status | |---|---|---| | Finality tags | public RPC: `safe` = `finalized` = Smartnode finalized checkpoint; own Core node: errors, use `g4_status` | Public RPC done (CR-0094); Core planned | | Tracing | no `debug_trace*` / `trace_*` namespace | Planned (operator opt-in) | | EVM version | up to Cancun's `TSTORE`/`MCOPY`; no blobs, no EIP-6780, nothing from Prague | Upgrade planned | | Explorer API | no Etherscan-compatible `?module=…&action=…` API yet | Planned | | Rewards | credited without transactions at settlement blocks | By design | # Install a node # Install a node (Ubuntu) | | Minimum | Recommended | |---|---|---| | OS | Ubuntu 22.04 or 24.04 LTS, x86-64 | 24.04 LTS | | CPU | 2 vCPU (AVX2 helps GhostRider) | 4+ vCPU for mining | | RAM | 4 GB | 8 GB | | Disk | 40 GB SSD (archive node) | 100 GB | | Network | public IPv4, TCP 30303 | + UDP 30303 for discovery | ## 1. Download and verify Obtain the release tarball and the network folder (`genesis.json`, `genesis.json.profile.json`, `GENESIS_MANIFEST.json`, `bootnodes.txt`) from the network operator over a trusted channel. ```bash # = pqwerai-v8-0.1.0-public-testnet, the chain 20778 node bundle (Core a679d60a1); not on a public download page yet, so get it from the network operator and check this hash sha256sum -linux-amd64.tar.gz # must equal 3ed1a27f236be3e128f1c992ca65f88c541b2d1220709b78cb7320bd01e37d05 tar -xzf -linux-amd64.tar.gz cd -linux-amd64 && sha256sum -c SHA256SUMS ``` Builds are reproducible: two independent builds of the same commit produce bit-identical binaries. SHA-256 of the Core a679d60a1 binaries (Linux bundle files and the native Windows builds bundled in the wallet): | File | SHA-256 | |---|---| | `pqwerai-v8-0.1.0-public-testnet-linux-amd64.tar.gz` | `3ed1a27f236be3e128f1c992ca65f88c541b2d1220709b78cb7320bd01e37d05` | | `bin/pqwerai-core` (Linux) | `cd704b268753feccb5364aac8a1a9d76f658f13c298c991c0765acc5dc7af84f` | | `bin/pqwerai-cli` (Linux) | `90a39ec1901e556bcfe63a2bc703632a1de02aac685d7cfa71918f4016c5ff7c` | | `bin/pqwerai_hash_worker` (Linux, pinned in the genesis profile) | `3a54f0bb461f296b606c9386c68ebf37514a703e5dbff3de4c4a5828637099a8` | | `pqwerai-core.exe` (Windows) | `9a9a7f718e31c0f8ebd29f997f6109987fc2597f6e6e17487aedd694a2513c41` | | `pqwerai-cli.exe` (Windows) | `e5250a332f08b29dc618ff8a052013c4f5283ea8e2e6f01233323fb06a1f6d2d` | | `pqwerai-hash-worker.exe` (Windows) | `2fd87b73b22239b47d4d9f09fc2bd9e62623e634d539f84c1fb7cd6b6f57626c` | The genesis files must match too: `genesis.json` `fcc415773df127442c22fc8a8cc2cee6a33302702f35654fa31905c737b7be8b`, `genesis.json.profile.json` `c0633fa93a1b01945d6b98d5ba544631f5e8b1e7086b90125ebe5b8d658255e7` (genesis v3, `0xe7c41635510f505a98776ca3a198730e0cc120cd10039069006be334f41f3db6`). Every former fork rule is bound in that profile, so the node needs no rule or fork flag; older Cores refuse this genesis. ## 2. Install ```bash sudo ./share/vps/install.sh ../-linux-amd64.tar.gz /path/to/network ``` Creates the `pqwerai` and `pqwerai-signer` users, `/opt/pqwerai/releases/` with `/opt/pqwerai/current`, `/var/lib/pqwerai` (0700), `/etc/pqwerai`, systemd units, journald limits and logrotate, and verifies the genesis files against the manifest. ## 3. Configure `/etc/pqwerai/core.env` ```bash PQWERAI_DATADIR=/var/lib/pqwerai/core PQWERAI_P2P_PORT=30303 PQWERAI_NAT=extip:203.0.113.10 # your public IP so peers can dial back PQWERAI_MAXPEERS=25 PQWERAI_DISCOVERY=true # seeded from /etc/pqwerai/network/bootnodes.txt PQWERAI_RPC_ADDR=127.0.0.1 # never bind RPC publicly; use the TLS proxy PQWERAI_RPC_PORT=8545 PQWERAI_PASE_WORKERS=0 # 0 = canonical serial (default); 2..64 = GhostFlow, consensus-neutral #PQWERAI_PASE_GENERAL=true # GhostFlow also runs contract blocks (needs workers 2..64) #PQWERAI_PASE_PROFILE=cost-aware # always set with GENERAL: picks serial or parallel per batch PQWERAI_MINE=false #PQWERAI_ETHERBASE=0x… # rewards address; keep its key off the server PQWERAI_VERBOSITY=3 ``` ### Parallel execution (optional) GhostFlow executes a block's transactions in parallel and always produces the same block as serial execution, so turning it on or off never affects consensus. It only pays on a machine with spare cores (8 or more): on small servers, or servers that also mine, leave `PQWERAI_PASE_WORKERS=0`. To enable it (Core `54c4ed638` or later), set all three: ```bash PQWERAI_PASE_WORKERS=8 # about the number of free cores PQWERAI_PASE_GENERAL=true PQWERAI_PASE_PROFILE=cost-aware ``` The cost-aware profile measures locally whether parallel execution is cheaper for each batch and otherwise runs it serially; in our local harness it reached 3–4× on CPU-heavy blocks and about serial speed on simple transfers. Plain general GhostFlow without the profile is slower than serial on simple transfers. Blocks with fewer than 64 transactions always run serially. Check it with `curl -s -d '{"jsonrpc":"2.0","id":1,"method":"pase_status","params":[]}' -H 'Content-Type: application/json' http://127.0.0.1:8545`. ## 4. Firewall ```bash sudo /opt/pqwerai/current/share/vps/firewall/ufw.sh --discovery [--ssh-from ] [--https] ``` Opens only P2P (and 80/443 with `--https` for the RPC proxy). Ports 8545 (RPC), 9545 (metrics) and signer traffic are never public. ## 5. Start and check ```bash sudo systemctl enable --now pqwerai-core pqwerai-exporter pqwerai-health # chain 20778, manifest genesis, peers > 0, advancing head pqwerai-cli -rpc http://127.0.0.1:8545 status sudo systemctl stop pqwerai-core # graceful: up to 180 s to flush ``` A node refuses to start on a datadir created for another genesis, and cannot peer with nodes of another chain. ## Windows The Windows wallet ships the native Windows Core (`node` folder of the MSI and portable ZIP). Wallet 0.9.0 for chain 20778 bundles a Windows build of Core `a679d60a1`. Its *Node* page installs it after checking its SHA-256, joins testnet 20778 and can mine. WSL is not used. ## Current release identities The tarball names above describe the operator install layout, not a newly published standalone Linux Core download. Each wallet release carries the corresponding source archive of its bundled Windows Core. The Core source snapshot used by the RPC inventory and the separately selected research Core are different identities. Use hashes for the exact platform/package; never substitute an old Linux helper hash for the Windows helper. The canonical genesis already exists and must be preserved: do not rerun a genesis ceremony to install an upgrade. See [current status](../resources/current-status.md). # Monitoring, backup and upgrades # Monitoring, backup and upgrades ## Monitoring `pqwerai-exporter` serves Prometheus metrics on `127.0.0.1:9545/metrics`. Scrape over an SSH tunnel or VPN, or allow one monitoring IP (`ufw.sh --metrics-from `). Shipped alert rules (`monitoring/alerts.yml`): | Alert | Meaning | |---|---| | `PqwChainStalled` | Head not advancing | | `PqwFinalityStalled`, `PqwFinalityLagHigh` | Finalized checkpoint not advancing / far behind head | | `PqwPeerIsolation` | Too few peers | | `PqwSignerOffline` | Validator signer not voting | | `PqwPersistentFork`, `PqwReorgDeep`, `PqwWrongChain` | Fork or identity problems | | `PqwIssuanceMismatch` | Issuance counters disagree with expectations | | `PqwDiskNearlyFull`, `PqwMemoryLow`, `PqwRpcErrorSpike` | Host health | | `PqwAIProviderDown` | Optional AI provider service down | ### Internal agents The 19 November per-role deployments were followed by a six-role supervisor and Discord status bridge on 22 November. A later owner-selected community profile leaves all six roles in **rules-only waiting mode** for the official free pool, without paid/local/other-pool fallback. See [Internal agents](agents.md) for policy boundaries, source/deployment distinctions and the latest dated record. Agent models never determine block validity. ## Backup and restore ```bash sudo /opt/pqwerai/current/share/vps/bin/pqwerai-backup create /srv/backups # stops, archives, restarts sudo /opt/pqwerai/current/share/vps/bin/pqwerai-backup restore /srv/backups/pqwerai-core--.tar.zst ``` Restore verifies the checksum and that the archive belongs to this network's genesis. **Validator signer journals are deliberately excluded** — restoring a stale journal can cause a slashable double vote. ## Upgrade and rollback ```bash sudo pqwerai-release install pqwerai-v8-testnet-rc2-linux-amd64.tar.gz sudo pqwerai-release activate # restarts, health-checks, auto-rolls back on failure sudo pqwerai-release rollback # previous release pqwerai-release list ; pqwerai-release current ``` The datadir is never modified by the release tool. A release that changes `protocol_version` needs a coordinated, announced activation height — read the release notes first. # RPC exposure and security # RPC exposure and security ## Defaults that protect you - The node binds JSON-RPC to `127.0.0.1:8545`. Binding any other address requires `--rpc.token-file` (bearer token ≥ 16 bytes, compared in constant time); otherwise the node refuses to start. - `personal`, `admin`, `debug`, `miner`, `clique` and `engine` are **not compiled into the RPC server** (probed: `-32601`). - The node holds no user keys: signing RPCs return `unknown account`. - Request bodies are capped at 4 MiB; slow clients are bounded by read/write/idle timeouts. ## Offering a public wallet endpoint Use the shipped nginx proxy (`vps/proxy/nginx-pqwerai-rpc.conf`), never the raw port: ```bash sudo apt-get install -y nginx certbot python3-certbot-nginx sudo cp /opt/pqwerai/current/share/vps/proxy/nginx-pqwerai-rpc.conf /etc/nginx/sites-available/pqwerai-rpc # set server_name sudo ln -s /etc/nginx/sites-available/pqwerai-rpc /etc/nginx/sites-enabled/ && sudo certbot --nginx -d ``` | Limit | Value | |---|---| | Transport | HTTPS (TLS 1.2+), `POST /` only | | Body | 256 KiB at the proxy | | Rate | 20 requests/s per IP, burst 40; 20 concurrent connections per IP | | Timeouts | 10 s body, 30 s upstream | | Logging | access log without bodies | ## Methods a public proxy should not forward The [operator interfaces](../reference/json-rpc/operator.md) — `eth_getWork`, `eth_submitWork`, `eth_submitHashrate`, `g4_submitVote`, `g4_link`, `g4_context`, `pqwerai_peerHealth` — are registered on the node. `g4_submitVote` is signature-verified and rate-limited, but a public endpoint has no reason to accept validator traffic; validators submit to their own node. Consider an allowlist of the [public methods](../reference/json-rpc/index.md). ## For endpoint users Pin chain ID 20778 and the manifest genesis hash, never send keys or passwords to an endpoint, and do not trust one endpoint for finality — compare `g4_status.finalized_hash` across operators or run a node. # API playground # API playground **Read-only by design.** Only methods classified *public read-only* in the reviewed [RPC policy](reference/json-rpc/index.md) appear here. The playground never asks for keys, seed phrases or bearer tokens and cannot submit transactions, votes or mining work. Public RPC endpoints now exist, but the conservative default environment still shows **recorded examples**, clearly labelled with their recording time and block height. Loading the method inventory… ## Environments | Environment | What happens | |---|---| | Recorded examples | No network request. Shows the real response recorded from a disposable local testnet, with its timestamp and head. | | My local node | Your browser sends the request to `http://127.0.0.1:8545`. Browsers block this from an https page unless you open a local copy of the docs; PQWERAI Core sends no CORS headers. | | Custom endpoint | Your browser sends the request to the URL you enter, only for read-only methods. Use endpoints you trust; do not paste tokens into URLs. | The generated curl, JavaScript, Python and ethers.js snippets are the reliable way to run a request against any node. # JSON-RPC reference # JSON-RPC reference PQWERAI Core speaks Ethereum JSON-RPC 2.0 over HTTP `POST /`. Every method on these pages was extracted from the Core source and then confirmed registered on a running node; recorded responses are real outputs of a running node. Nothing here is a mock. | Inventory | Value | |---|---| | Methods served (source ∩ live) | **72** | | Public methods | 60 | | Operator / unsupported / disabled | 12 | | Core source revision | `bad4a06ea6c334e0b646ff1871b721704157dad9` | | Live client | `CoreGeth/linux-amd64/go1.26.8` | | Inventory generated | 2026-11-28T06:03:13+00:00 | | Namespace | Purpose | |---|---| | [eth](eth.md) | Chain data, accounts, calls, gas and fees, transactions, logs and filters | | [net](net.md) | Network ID and peers | | [web3](web3.md) | Client version, Keccak-256 | | [txpool](txpool.md) | Pending/queued transaction inspection | | [g4](g4.md) | PQWERAI finality, Smartnode registry, issuance counters | | [Operator interfaces](operator.md) | Mining, validator voting, diagnostics, unsupported and disabled methods | | [Errors and limits](errors.md) | Error codes, size and range limits | ## Transport and limits - Default bind `127.0.0.1:8545`; a non-loopback bind requires `--rpc.token-file` (bearer token ≥ 16 bytes, constant-time compare). - Request body limit 4 MiB at the node; public proxies apply 256 KiB, 20 requests/s per IP (burst 40). - HTTP only (no WebSocket): `eth_subscribe` is not available; poll with filters or block numbers. - `eth_getLogs` range ≤ `--rpc.logs-max-range` (default 5000 blocks); `eth_getFilterLogs` is disabled. - Batch requests follow go-ethereum semantics. ## Machine-readable - [rpc-methods.json](../../downloads/rpc-methods.json) — full inventory with classes, sources and recorded examples - [pqwerai-openrpc.json](../../downloads/pqwerai-openrpc.json) — OpenRPC 1.2.6 document of the public methods - [Postman collection](../../downloads/pqwerai-postman-collection.json) # JSON-RPC errors and limits # Errors and limits | Code | Meaning | Typical cause | |---|---|---| | `-32700` | Parse error | Body is not valid JSON | | `-32600` | Invalid request | Missing `jsonrpc`/`method`, wrong shape | | `-32601` | Method not found | Method or namespace not served (e.g. `personal_*`, `admin_*`, `debug_*`) | | `-32602` | Invalid params | Wrong count or type, e.g. `missing value for required argument 0` | | `-32000` | Server error | Execution/validation failure: `unknown account`, `nonce too low`, `insufficient funds`, revert | | `3` | Execution reverted | `eth_call`/`eth_estimateGas` revert with ABI-encoded reason in `data` | | HTTP 401 | Unauthorized | Missing or wrong bearer token on a token-protected node | | HTTP 413 | Payload too large | Body above the node (4 MiB) or proxy (256 KiB) limit | | HTTP 429 | Too many requests | Public proxy rate limit | ## Errors recorded on a live node | Request | Response | |---|---| | `eth_getBlockByNumber` `["latest"]` | `{"code": -32602, "message": "missing value for required argument 1"}` | | `eth_getFilterLogs` `["0x1"]` | `{"code": -32000, "message": "eth_getFilterLogs is disabled; use eth_getLogs (bounded range) or eth_getFilterChanges"}` | | `eth_getWork` `[]` | `{"code": -32000, "message": "no mining work available yet"}` | | `eth_sendRawTransaction` `["0x00"]` | `{"code": -32000, "message": "typed transaction too short"}` | | `eth_sendTransaction` `[{"from": "0x4014d3651e6ac0107720cf74c3062053787912e0", "to": "0x4014d3651e6ac01` | `{"code": -32000, "message": "unknown account"}` | | `eth_sign` `["0x4014d3651e6ac0107720cf74c3062053787912e0", "0x00"]` | `{"code": -32000, "message": "unknown account"}` | | `g4_context` `[0, 1]` | `{"code": -32000, "message": "invalid checkpoint link"}` | # JSON-RPC: eth namespace # eth namespace Ethereum-compatible chain, account, transaction, fee, call and log methods served by PQWERAI Core. 48 public methods. Operator, disabled and unsupported methods of this namespace are listed in [Operator interfaces](operator.md). `$RPC` is your node URL (see [quickstart](../../getting-started/blockchain-quickstart.md)). | Method | Access | Summary | |---|---|---| | [`eth_accounts`](#eth_accounts) | Public · read-only | Returns the collection of accounts this node manages. | | [`eth_blockNumber`](#eth_blocknumber) | Public · read-only | Returns the block number of the chain head. | | [`eth_call`](#eth_call) | Public · read-only | Executes the given transaction on the state for the given block number | | [`eth_chainId`](#eth_chainid) | Public · read-only | Is the EIP-155 replay-protection chain id for the current Ethereum chain config | | [`eth_coinbase`](#eth_coinbase) | Public · read-only | Is the address that mining rewards will be sent to (alias for Etherbase). | | [`eth_createAccessList`](#eth_createaccesslist) | Public · read-only | Creates an EIP-2930 type AccessList for the given transaction | | [`eth_estimateGas`](#eth_estimategas) | Public · read-only | Returns the lowest possible gas limit that allows the transaction to run successfully at block `blockNrOrHash` | | [`eth_etherbase`](#eth_etherbase) | Public · read-only | Is the address that mining rewards will be sent to. | | [`eth_feeHistory`](#eth_feehistory) | Public · read-only | Returns the fee market history. | | [`eth_fillTransaction`](#eth_filltransaction) | Public · read-only | Fills the defaults (nonce, gas, gasPrice or 1559 fields) on a given unsigned transaction, and returns it to th | | [`eth_gasPrice`](#eth_gasprice) | Public · read-only | Returns a suggestion for a gas price for legacy transactions. | | [`eth_getBalance`](#eth_getbalance) | Public · read-only | Returns the amount of wei for the given address in the state of the given block number | | [`eth_getBlockByHash`](#eth_getblockbyhash) | Public · read-only | Returns the requested block | | [`eth_getBlockByNumber`](#eth_getblockbynumber) | Public · read-only | Returns the requested canonical block | | [`eth_getBlockReceipts`](#eth_getblockreceipts) | Public · read-only | Returns the block receipts for the given block hash or number or tag. | | [`eth_getBlockTransactionCountByHash`](#eth_getblocktransactioncountbyhash) | Public · read-only | Returns the number of transactions in the block with the given hash. | | [`eth_getBlockTransactionCountByNumber`](#eth_getblocktransactioncountbynumber) | Public · read-only | Returns the number of transactions in the block with the given block number. | | [`eth_getCode`](#eth_getcode) | Public · read-only | Returns the code stored at the given address in the state for the given block number. | | [`eth_getFilterChanges`](#eth_getfilterchanges) | Public · read-only (stateful filter) | Returns the logs for the filter with the given id since last time it was called | | [`eth_getHashrate`](#eth_gethashrate) | Public · read-only | Returns the current hashrate for local CPU miner and remote miner. | | [`eth_getHeaderByHash`](#eth_getheaderbyhash) | Public · read-only | Returns the requested header by hash. | | [`eth_getHeaderByNumber`](#eth_getheaderbynumber) | Public · read-only | Returns the requested canonical block header | | [`eth_getLogs`](#eth_getlogs) | Public · read-only | Returns logs matching a filter | | [`eth_getProof`](#eth_getproof) | Public · read-only | Returns the Merkle-proof for a given account and optionally some storage keys. | | [`eth_getRawTransactionByBlockHashAndIndex`](#eth_getrawtransactionbyblockhashandindex) | Public · read-only | Returns the bytes of the transaction for the given block hash and index. | | [`eth_getRawTransactionByBlockNumberAndIndex`](#eth_getrawtransactionbyblocknumberandindex) | Public · read-only | Returns the bytes of the transaction for the given block number and index. | | [`eth_getRawTransactionByHash`](#eth_getrawtransactionbyhash) | Public · read-only | Returns the bytes of the transaction for the given hash. | | [`eth_getStorageAt`](#eth_getstorageat) | Public · read-only | Returns the storage from the state at the given address, key and block number | | [`eth_getTransactionByBlockHashAndIndex`](#eth_gettransactionbyblockhashandindex) | Public · read-only | Returns the transaction for the given block hash and index. | | [`eth_getTransactionByBlockNumberAndIndex`](#eth_gettransactionbyblocknumberandindex) | Public · read-only | Returns the transaction for the given block number and index. | | [`eth_getTransactionByHash`](#eth_gettransactionbyhash) | Public · read-only | Returns the transaction for the given hash | | [`eth_getTransactionCount`](#eth_gettransactioncount) | Public · read-only | Returns the number of transactions the given address has sent for the given block number | | [`eth_getTransactionReceipt`](#eth_gettransactionreceipt) | Public · read-only | Returns the transaction receipt for the given transaction hash. | | [`eth_getUncleByBlockHashAndIndex`](#eth_getunclebyblockhashandindex) | Public · read-only | Returns the uncle block for the given block hash and index | | [`eth_getUncleByBlockNumberAndIndex`](#eth_getunclebyblocknumberandindex) | Public · read-only | Returns the uncle block for the given block hash and index | | [`eth_getUncleCountByBlockHash`](#eth_getunclecountbyblockhash) | Public · read-only | Returns number of uncles in the block for the given block hash | | [`eth_getUncleCountByBlockNumber`](#eth_getunclecountbyblocknumber) | Public · read-only | Returns number of uncles in the block for the given block number | | [`eth_hashrate`](#eth_hashrate) | Public · read-only | Returns the POW hashrate. | | [`eth_maxPriorityFeePerGas`](#eth_maxpriorityfeepergas) | Public · read-only | Returns a suggestion for a gas tip cap for dynamic fee transactions. | | [`eth_mining`](#eth_mining) | Public · read-only | Returns an indication if this node is currently mining. | | [`eth_newBlockFilter`](#eth_newblockfilter) | Public · read-only (stateful filter) | Creates a filter that fetches blocks that are imported into the chain | | [`eth_newFilter`](#eth_newfilter) | Public · read-only (stateful filter) | Creates a new filter and returns the filter id | | [`eth_newPendingTransactionFilter`](#eth_newpendingtransactionfilter) | Public · read-only (stateful filter) | Creates a filter that fetches pending transactions as transactions enter the pending state | | [`eth_newSideBlockFilter`](#eth_newsideblockfilter) | Public · read-only (stateful filter) | Creates a filter that fetches blocks that are imported into the chain with a non-canonical status | | [`eth_pendingTransactions`](#eth_pendingtransactions) | Public · read-only | Returns the transactions that are in the transaction pool and have a from address that is one of the accounts | | [`eth_sendRawTransaction`](#eth_sendrawtransaction) | Public · write (client-signed) | Will add the signed transaction to the transaction pool | | [`eth_syncing`](#eth_syncing) | Public · read-only | Returns false in case the node is currently not syncing with the network | | [`eth_uninstallFilter`](#eth_uninstallfilter) | Public · read-only (stateful filter) | Removes the filter with the given filter id. | ### `eth_accounts` Returns the collection of accounts this node manages. | | | |---|---| | Access | **Public · read-only** | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:281` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | array of addresses | !!! note "Behaviour on PQWERAI" Read-only but describes this node's local configuration or mempool; results differ per node. **Parameters:** none === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_accounts", "params": [] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_accounts", "params": []}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": [] } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_blockNumber` Returns the block number of the chain head. | | | |---|---| | Access | **Public · read-only** · playground | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:644` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | quantity (hex) | **Parameters:** none === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_blockNumber", "params": [] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_blockNumber", "params": []}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": "0xd46" } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_call` Executes the given transaction on the state for the given block number. Additionally, the caller can specify a batch of contract for fields overriding. Note, this function doesn't make and changes in the state/blockchain and is useful to execute and retrieve values. | | | |---|---| | Access | **Public · read-only** · playground | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:1148` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | data (hex) | **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `args` | `txObject` | yes | transaction call object {from,to,gas,gasPrice|maxFeePerGas,maxPriorityFeePerGas,value,input|data,nonce,accessList} | | 1 | `blockNrOrHash` | `blockRef` | no | block number (hex), tag, or EIP-1898 object (optional) | | 2 | `overrides` | `stateOverride` | no | optional state override set (address → {balance,nonce,code,state,stateDiff}) | | 3 | `blockOverrides` | `blockOverrides` | no | optional block override object | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_call", "params": [ { "to": "0x4014d3651e6ac0107720cf74c3062053787912e0", "data": "0x" }, "latest" ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_call", "params": [{"to": "0x4014d3651e6ac0107720cf74c3062053787912e0", "data": "0x"}, "latest"]}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_chainId` Is the EIP-155 replay-protection chain id for the current Ethereum chain config. Note, this method does not conform to EIP-695 because the configured chain ID is always returned, regardless of the current head block. We used to return an error when the chain wasn't synced up to a block where EIP-155 is enabled, but this behavior caused issues in CL clients. | | | |---|---| | Access | **Public · read-only** · playground | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:639` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | quantity (hex) | **Parameters:** none === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_chainId", "params": [] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_chainId", "params": []}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": "0x512a" } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_coinbase` Is the address that mining rewards will be sent to (alias for Etherbase). | | | |---|---| | Access | **Public · read-only** | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/eth/api.go:40` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | address | !!! note "Behaviour on PQWERAI" Read-only but describes this node's local configuration or mempool; results differ per node. **Parameters:** none === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_coinbase", "params": [] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_coinbase", "params": []}' \ "$RPC" ``` === "Response" No live response is recorded for this method (state-changing, operator-only or no safe sample). **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_createAccessList` Creates an EIP-2930 type AccessList for the given transaction. Reexec and BlockNrOrHash can be specified to create the accessList on top of a certain state. | | | |---|---| | Access | **Public · read-only** · playground | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:1614` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | {accessList, gasUsed, error?} | **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `args` | `txObject` | yes | transaction call object {from,to,gas,gasPrice|maxFeePerGas,maxPriorityFeePerGas,value,input|data,nonce,accessList} | | 1 | `blockNrOrHash` | `blockRef` | no | block number (hex), tag, or EIP-1898 object (optional) | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_createAccessList", "params": [ { "from": "0x4014d3651e6ac0107720cf74c3062053787912e0", "to": "0x4014d3651e6ac0107720cf74c3062053787912e0", "value": "0x1" }, "latest" ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_createAccessList", "params": [{"from": "0x4014d3651e6ac0107720cf74c3062053787912e0", "to": "0x4014d3651e6ac0107720cf74c3062053787912e0", "value": "0x1"}, "latest"]}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": { "accessList": [], "gasUsed": "0x5208" } } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_estimateGas` Returns the lowest possible gas limit that allows the transaction to run successfully at block `blockNrOrHash`, or the latest block if `blockNrOrHash` is unspecified. It returns error if the transaction would revert or if there are unexpected failures. The returned value is capped by both `args.Gas` (if non-nil & non-zero) and the backend's RPCGasCap configuration (if non-zero). Note: Required blob gas is not computed in this method. | | | |---|---| | Access | **Public · read-only** · playground | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:1206` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | quantity (hex) | **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `args` | `txObject` | yes | transaction call object {from,to,gas,gasPrice|maxFeePerGas,maxPriorityFeePerGas,value,input|data,nonce,accessList} | | 1 | `blockNrOrHash` | `blockRef` | no | block number (hex), tag, or EIP-1898 object (optional) | | 2 | `overrides` | `stateOverride` | no | optional state override set (address → {balance,nonce,code,state,stateDiff}) | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_estimateGas", "params": [ { "from": "0x4014d3651e6ac0107720cf74c3062053787912e0", "to": "0x4014d3651e6ac0107720cf74c3062053787912e0", "value": "0x1" } ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_estimateGas", "params": [{"from": "0x4014d3651e6ac0107720cf74c3062053787912e0", "to": "0x4014d3651e6ac0107720cf74c3062053787912e0", "value": "0x1"}]}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": "0x5208" } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_etherbase` Is the address that mining rewards will be sent to. | | | |---|---| | Access | **Public · read-only** | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/eth/api.go:35` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | address | !!! note "Behaviour on PQWERAI" Read-only but describes this node's local configuration or mempool; results differ per node. **Parameters:** none === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_etherbase", "params": [] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_etherbase", "params": []}' \ "$RPC" ``` === "Response" No live response is recorded for this method (state-changing, operator-only or no safe sample). **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_feeHistory` Returns the fee market history. | | | |---|---| | Access | **Public · read-only** · playground | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:102` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | {oldestBlock, baseFeePerGas[], gasUsedRatio[], reward[][]} | **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `blockCount` | `quantity` | yes | hex or decimal integer | | 1 | `lastBlock` | `blockTag` | yes | block number (hex) or 'latest' | 'earliest' | 'pending' | 'safe' | 'finalized' | | 2 | `rewardPercentiles` | `number[]` | yes | array of percentiles | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_feeHistory", "params": [ "0x4", "latest", [ 25, 75 ] ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_feeHistory", "params": ["0x4", "latest", [25, 75]]}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": { "oldestBlock": "0xd43", "reward": [ [ "0x3b9aca00", "0x3b9aca00" ], [ "0x0", "0x0" ], [ "0x0", "0x0" ], "... 1 more items" ], "baseFeePerGas": [ "0x7", "0x7", "0x7", "... 2 more items" ], "gasUsedRatio": [ 0.0032605333333333335, 0, 0, "... 1 more items" ] } } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_fillTransaction` Fills the defaults (nonce, gas, gasPrice or 1559 fields) on a given unsigned transaction, and returns it to the caller for further processing (signing + broadcast). | | | |---|---| | Access | **Public · read-only** | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:1971` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | {raw, tx} | !!! note "Behaviour on PQWERAI" Read-only but describes this node's local configuration or mempool; results differ per node. **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `args` | `txObject` | yes | transaction call object {from,to,gas,gasPrice|maxFeePerGas,maxPriorityFeePerGas,value,input|data,nonce,accessList} | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_fillTransaction", "params": [ "" ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_fillTransaction", "params": [""]}' \ "$RPC" ``` === "Response" No live response is recorded for this method (state-changing, operator-only or no safe sample). **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_gasPrice` Returns a suggestion for a gas price for legacy transactions. | | | |---|---| | Access | **Public · read-only** · playground | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:74` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | quantity (hex) | **Parameters:** none === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_gasPrice", "params": [] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_gasPrice", "params": []}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": "0x3b9aca07" } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_getBalance` Returns the amount of wei for the given address in the state of the given block number. The rpc.LatestBlockNumber and rpc.PendingBlockNumber meta block numbers are also allowed. | | | |---|---| | Access | **Public · read-only** · playground | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:652` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | quantity (hex) | **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `address` | `address` | yes | 20-byte hex address, 0x-prefixed | | 1 | `blockNrOrHash` | `blockRef` | yes | block number (hex), tag, or EIP-1898 object {blockHash|blockNumber} | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_getBalance", "params": [ "0x4014d3651e6ac0107720cf74c3062053787912e0", "latest" ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_getBalance", "params": ["0x4014d3651e6ac0107720cf74c3062053787912e0", "latest"]}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": "0x3635ad116511f7d5a8" } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_getBlockByHash` Returns the requested block. When fullTx is true all transactions in the block are returned in full detail, otherwise only the transaction hash is returned. | | | |---|---| | Access | **Public · read-only** · playground | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:836` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | block object or null | **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `hash` | `hash32` | yes | 32-byte hex hash, 0x-prefixed | | 1 | `fullTx` | `boolean` | yes | true or false | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_getBlockByHash", "params": [ "0x5ae63f554b1d25fcb55a81a763b4a46ef23886615e77c9e0bee64ffb62e45658", false ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_getBlockByHash", "params": ["0x5ae63f554b1d25fcb55a81a763b4a46ef23886615e77c9e0bee64ffb62e45658", false]}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": { "number": "0xd43", "hash": "0x5ae63f554b1d25fcb55a81a763b4a46ef23886615e77c9e0bee64ffb62e45658", "parentHash": "0x744580857f7628b50e7b6f640d3e7722115c2e24eef3805d03a2de2c13467f02", "nonce": "0x00000000000000c3", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...(+384 hex chars)", "stateRoot": "0x7c7815556fd2968a8ce0b1f1bb821476fd4ebc5ff6ea9a9e801b778fd81116cb", "miner": "0xa8aef113ac6f3f649355ade9172c993c6c302b51", "difficulty": "0x100", "totalDifficulty": "0xcc8c0", "extraData": "0xcb89505141492d47332d31c0", "gasLimit": "0xe4e1c0", "gasUsed": "0xbf0c", "timestamp": "0x6b0a6e7b", "transactionsRoot": "0x3be7d309edfec824a23390731a4005aa491bc58a29add973bb4446091ce9f105", "receiptsRoot": "0xf9b7b102934f8295c36c63c40711f433ed9606c25f8e181593804909ec250538", "baseFeePerGas": "0x7", "transactions": [ "0xc65bab0ee754df8f7152a56cb606cba829f076e8d9f22caa863de153bb2f0e5e" ], "uncles": [], "size": "0xa85" } } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_getBlockByNumber` Returns the requested canonical block. - When blockNr is -1 the chain pending block is returned. - When blockNr is -2 the chain latest block is returned. - When blockNr is -3 the chain finalized block is returned. - When blockNr is -4 the chain safe block is returned. - When fullTx is true all transactions in the block are returned, otherwise only the transaction hash is returned. | | | |---|---| | Access | **Public · read-only** · playground | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:821` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | block object or null | **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `number` | `blockTag` | yes | block number (hex) or 'latest' | 'earliest' | 'pending' | 'safe' | 'finalized' | | 1 | `fullTx` | `boolean` | yes | true or false | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_getBlockByNumber", "params": [ "0xd43", false ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_getBlockByNumber", "params": ["0xd43", false]}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": { "number": "0xd43", "hash": "0x5ae63f554b1d25fcb55a81a763b4a46ef23886615e77c9e0bee64ffb62e45658", "parentHash": "0x744580857f7628b50e7b6f640d3e7722115c2e24eef3805d03a2de2c13467f02", "nonce": "0x00000000000000c3", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...(+384 hex chars)", "stateRoot": "0x7c7815556fd2968a8ce0b1f1bb821476fd4ebc5ff6ea9a9e801b778fd81116cb", "miner": "0xa8aef113ac6f3f649355ade9172c993c6c302b51", "difficulty": "0x100", "totalDifficulty": "0xcc8c0", "extraData": "0xcb89505141492d47332d31c0", "gasLimit": "0xe4e1c0", "gasUsed": "0xbf0c", "timestamp": "0x6b0a6e7b", "transactionsRoot": "0x3be7d309edfec824a23390731a4005aa491bc58a29add973bb4446091ce9f105", "receiptsRoot": "0xf9b7b102934f8295c36c63c40711f433ed9606c25f8e181593804909ec250538", "baseFeePerGas": "0x7", "transactions": [ "0xc65bab0ee754df8f7152a56cb606cba829f076e8d9f22caa863de153bb2f0e5e" ], "uncles": [], "size": "0xa85" } } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. - Recorded: `["latest"]` → `{"code": -32602, "message": "missing value for required argument 1"}` --- ### `eth_getBlockReceipts` Returns the block receipts for the given block hash or number or tag. | | | |---|---| | Access | **Public · read-only** · playground | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:921` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | array of receipt objects | **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `blockNrOrHash` | `blockRef` | yes | block number (hex), tag, or EIP-1898 object {blockHash|blockNumber} | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_getBlockReceipts", "params": [ "0xd43" ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_getBlockReceipts", "params": ["0xd43"]}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "blockHash": "0x5ae63f554b1d25fcb55a81a763b4a46ef23886615e77c9e0bee64ffb62e45658", "blockNumber": "0xd43", "contractAddress": null, "cumulativeGasUsed": "0xbf0c", "effectiveGasPrice": "0x3b9aca07", "from": "0x4014d3651e6ac0107720cf74c3062053787912e0", "gasUsed": "0xbf0c", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...(+384 hex chars)", "status": "0x1", "to": "0x08a60aa7959381fa8089f4db1d359107e243a59f", "transactionHash": "0xc65bab0ee754df8f7152a56cb606cba829f076e8d9f22caa863de153bb2f0e5e", "transactionIndex": "0x0", "type": "0x2" } ] } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_getBlockTransactionCountByHash` Returns the number of transactions in the block with the given hash. | | | |---|---| | Access | **Public · read-only** · playground | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:1721` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | quantity (hex) or null | **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `blockHash` | `hash32` | yes | 32-byte hex hash, 0x-prefixed | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_getBlockTransactionCountByHash", "params": [ "0x5ae63f554b1d25fcb55a81a763b4a46ef23886615e77c9e0bee64ffb62e45658" ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_getBlockTransactionCountByHash", "params": ["0x5ae63f554b1d25fcb55a81a763b4a46ef23886615e77c9e0bee64ffb62e45658"]}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_getBlockTransactionCountByNumber` Returns the number of transactions in the block with the given block number. | | | |---|---| | Access | **Public · read-only** · playground | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:1712` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | quantity (hex) or null | **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `blockNr` | `blockTag` | yes | block number (hex) or 'latest' | 'earliest' | 'pending' | 'safe' | 'finalized' | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_getBlockTransactionCountByNumber", "params": [ "0xd43" ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_getBlockTransactionCountByNumber", "params": ["0xd43"]}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_getCode` Returns the code stored at the given address in the state for the given block number. | | | |---|---| | Access | **Public · read-only** · playground | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:895` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | data (hex) | **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `address` | `address` | yes | 20-byte hex address, 0x-prefixed | | 1 | `blockNrOrHash` | `blockRef` | yes | block number (hex), tag, or EIP-1898 object {blockHash|blockNumber} | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_getCode", "params": [ "0x4014d3651e6ac0107720cf74c3062053787912e0", "latest" ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_getCode", "params": ["0x4014d3651e6ac0107720cf74c3062053787912e0", "latest"]}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_getFilterChanges` Returns the logs for the filter with the given id since last time it was called. This can be used for polling. For pending transaction and block filters the result is []common.Hash. (pending)Log filters return []Log. | | | |---|---| | Access | **Public · read-only (stateful filter)** | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/eth/filters/api.go:491` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | false or sync-progress object | !!! note "Behaviour on PQWERAI" Creates or reads per-node filter state that expires after 5 minutes of inactivity; unreliable behind load-balanced endpoints. **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `id` | `filterId` | yes | filter identifier returned by eth_newFilter, eth_newBlockFilter or eth_newPendingTransactionFilter | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_getFilterChanges", "params": [ "" ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_getFilterChanges", "params": [""]}' \ "$RPC" ``` === "Response" No live response is recorded for this method (state-changing, operator-only or no safe sample). **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_getHashrate` Returns the current hashrate for local CPU miner and remote miner. | | | |---|---| | Access | **Public · read-only** | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/consensus/ethash/api.go:111` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | number | !!! note "Behaviour on PQWERAI" Read-only but describes this node's local configuration or mempool; results differ per node. **Parameters:** none === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_getHashrate", "params": [] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_getHashrate", "params": []}' \ "$RPC" ``` === "Response" No live response is recorded for this method (state-changing, operator-only or no safe sample). **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_getHeaderByHash` Returns the requested header by hash. | | | |---|---| | Access | **Public · read-only** · playground | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:806` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | header object or null | **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `hash` | `hash32` | yes | 32-byte hex hash, 0x-prefixed | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_getHeaderByHash", "params": [ "0x5ae63f554b1d25fcb55a81a763b4a46ef23886615e77c9e0bee64ffb62e45658" ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_getHeaderByHash", "params": ["0x5ae63f554b1d25fcb55a81a763b4a46ef23886615e77c9e0bee64ffb62e45658"]}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": { "number": "0xd43", "hash": "0x5ae63f554b1d25fcb55a81a763b4a46ef23886615e77c9e0bee64ffb62e45658", "parentHash": "0x744580857f7628b50e7b6f640d3e7722115c2e24eef3805d03a2de2c13467f02", "nonce": "0x00000000000000c3", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...(+384 hex chars)", "stateRoot": "0x7c7815556fd2968a8ce0b1f1bb821476fd4ebc5ff6ea9a9e801b778fd81116cb", "miner": "0xa8aef113ac6f3f649355ade9172c993c6c302b51", "difficulty": "0x100", "totalDifficulty": "0xcc8c0", "extraData": "0xcb89505141492d47332d31c0", "gasLimit": "0xe4e1c0", "gasUsed": "0xbf0c", "timestamp": "0x6b0a6e7b", "transactionsRoot": "0x3be7d309edfec824a23390731a4005aa491bc58a29add973bb4446091ce9f105", "receiptsRoot": "0xf9b7b102934f8295c36c63c40711f433ed9606c25f8e181593804909ec250538", "baseFeePerGas": "0x7" } } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_getHeaderByNumber` Returns the requested canonical block header. - When blockNr is -1 the chain pending header is returned. - When blockNr is -2 the chain latest header is returned. - When blockNr is -3 the chain finalized header is returned. - When blockNr is -4 the chain safe header is returned. | | | |---|---| | Access | **Public · read-only** · playground | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:792` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | header object or null | **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `number` | `blockTag` | yes | block number (hex) or 'latest' | 'earliest' | 'pending' | 'safe' | 'finalized' | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_getHeaderByNumber", "params": [ "0xd43" ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_getHeaderByNumber", "params": ["0xd43"]}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": { "number": "0xd43", "hash": "0x5ae63f554b1d25fcb55a81a763b4a46ef23886615e77c9e0bee64ffb62e45658", "parentHash": "0x744580857f7628b50e7b6f640d3e7722115c2e24eef3805d03a2de2c13467f02", "nonce": "0x00000000000000c3", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...(+384 hex chars)", "stateRoot": "0x7c7815556fd2968a8ce0b1f1bb821476fd4ebc5ff6ea9a9e801b778fd81116cb", "miner": "0xa8aef113ac6f3f649355ade9172c993c6c302b51", "difficulty": "0x100", "totalDifficulty": "0xcc8c0", "extraData": "0xcb89505141492d47332d31c0", "gasLimit": "0xe4e1c0", "gasUsed": "0xbf0c", "timestamp": "0x6b0a6e7b", "transactionsRoot": "0x3be7d309edfec824a23390731a4005aa491bc58a29add973bb4446091ce9f105", "receiptsRoot": "0xf9b7b102934f8295c36c63c40711f433ed9606c25f8e181593804909ec250538", "baseFeePerGas": "0x7" } } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_getLogs` Returns logs matching a filter. PQWERAI bounds the block range per request (default 5000 blocks). | | | |---|---| | Access | **Public · read-only** · playground | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` · Core 263419f9 (filter API exposed) | | Verified | source `core/source/cmd/pqwerai-core/logs.go:37` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | array of log objects | !!! note "Behaviour on PQWERAI" Block range bounded by --rpc.logs-max-range (default node setting; 1..100000 allowed). Larger ranges return an error. **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `crit` | `filterObject` | yes | {fromBlock,toBlock,address,topics,blockHash} | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_getLogs", "params": [ { "fromBlock": "0xd43", "toBlock": "0xd43" } ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_getLogs", "params": [{"fromBlock": "0xd43", "toBlock": "0xd43"}]}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": [] } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_getProof` Returns the Merkle-proof for a given account and optionally some storage keys. | | | |---|---| | Access | **Public · read-only** · playground | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:692` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | EIP-1186 account proof object | **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `address` | `address` | yes | 20-byte hex address, 0x-prefixed | | 1 | `storageKeys` | `string[]` | yes | array of strings | | 2 | `blockNrOrHash` | `blockRef` | yes | block number (hex), tag, or EIP-1898 object {blockHash|blockNumber} | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_getProof", "params": [ "0x4014d3651e6ac0107720cf74c3062053787912e0", [], "latest" ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_getProof", "params": ["0x4014d3651e6ac0107720cf74c3062053787912e0", [], "latest"]}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": { "address": "0x4014d3651e6ac0107720cf74c3062053787912e0", "accountProof": [ "0xf90211a0755b5c8a8b5ec34176e69a8bd7062034120f3c59d41cc145ebdaa08676d0e6e8a0fd985f0ae70a7e15ccf2059a01981136f1065834f0793088114bd3...(+936 hex chars)", "0xf851808080808080a0fad97393a1d2b9f75a0c9089b94a9f5b4745786d58e74536d0754e5a5ca7f29c80808080a065502fedb1ec92b1f63bc226d3889d6ad154898ca34a4de874bb5ea4a52cc2a98080808080", "0xf873a020cfe060dd69390251818a564b0ac73bac9a6aecf2aa52062980379a6b3539f7b850f84e81c5893635ad116511f7d5a8a056e81f171bcc55a6ff8345e6...(+106 hex chars)" ], "balance": "0x3635ad116511f7d5a8", "codeHash": "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", "nonce": "0xc5", "storageHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "storageProof": [] } } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_getRawTransactionByBlockHashAndIndex` Returns the bytes of the transaction for the given block hash and index. | | | |---|---| | Access | **Public · read-only** · playground | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:1754` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | data (hex) | **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `blockHash` | `hash32` | yes | 32-byte hex hash, 0x-prefixed | | 1 | `index` | `quantity` | yes | 0x-prefixed hex integer | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_getRawTransactionByBlockHashAndIndex", "params": [ "", "" ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_getRawTransactionByBlockHashAndIndex", "params": ["", ""]}' \ "$RPC" ``` === "Response" No live response is recorded for this method (state-changing, operator-only or no safe sample). **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_getRawTransactionByBlockNumberAndIndex` Returns the bytes of the transaction for the given block number and index. | | | |---|---| | Access | **Public · read-only** · playground | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:1746` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | data (hex) | **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `blockNr` | `blockTag` | yes | block number (hex) or 'latest' | 'earliest' | 'pending' | 'safe' | 'finalized' | | 1 | `index` | `quantity` | yes | 0x-prefixed hex integer | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_getRawTransactionByBlockNumberAndIndex", "params": [ "0xd43", "0x0" ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_getRawTransactionByBlockNumberAndIndex", "params": ["0xd43", "0x0"]}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": "0x02f9086d82512a81c4843b9aca00843b9aca0e830258789408a60aa7959381fa8089f4db1d359107e243a59f80b907fdf907fa8a505141492d4646472d31f907...(+4194 hex chars)" } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_getRawTransactionByHash` Returns the bytes of the transaction for the given hash. | | | |---|---| | Access | **Public · read-only** · playground | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:1802` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | data (hex) | **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `hash` | `hash32` | yes | 32-byte hex hash, 0x-prefixed | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_getRawTransactionByHash", "params": [ "0xc65bab0ee754df8f7152a56cb606cba829f076e8d9f22caa863de153bb2f0e5e" ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_getRawTransactionByHash", "params": ["0xc65bab0ee754df8f7152a56cb606cba829f076e8d9f22caa863de153bb2f0e5e"]}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": "0x02f9086d82512a81c4843b9aca00843b9aca0e830258789408a60aa7959381fa8089f4db1d359107e243a59f80b907fdf907fa8a505141492d4646472d31f907...(+4194 hex chars)" } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_getStorageAt` Returns the storage from the state at the given address, key and block number. The rpc.LatestBlockNumber and rpc.PendingBlockNumber meta block numbers are also allowed. | | | |---|---| | Access | **Public · read-only** · playground | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:907` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | data (hex) | **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `address` | `address` | yes | 20-byte hex address, 0x-prefixed | | 1 | `hexKey` | `string` | yes | JSON string | | 2 | `blockNrOrHash` | `blockRef` | yes | block number (hex), tag, or EIP-1898 object {blockHash|blockNumber} | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_getStorageAt", "params": [ "0x4014d3651e6ac0107720cf74c3062053787912e0", "0x0", "latest" ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_getStorageAt", "params": ["0x4014d3651e6ac0107720cf74c3062053787912e0", "0x0", "latest"]}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_getTransactionByBlockHashAndIndex` Returns the transaction for the given block hash and index. | | | |---|---| | Access | **Public · read-only** · playground | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:1738` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | transaction object or null | **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `blockHash` | `hash32` | yes | 32-byte hex hash, 0x-prefixed | | 1 | `index` | `quantity` | yes | 0x-prefixed hex integer | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_getTransactionByBlockHashAndIndex", "params": [ "0x5ae63f554b1d25fcb55a81a763b4a46ef23886615e77c9e0bee64ffb62e45658", "0x0" ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x5ae63f554b1d25fcb55a81a763b4a46ef23886615e77c9e0bee64ffb62e45658", "0x0"]}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x5ae63f554b1d25fcb55a81a763b4a46ef23886615e77c9e0bee64ffb62e45658", "blockNumber": "0xd43", "from": "0x4014d3651e6ac0107720cf74c3062053787912e0", "gas": "0x25878", "gasPrice": "0x3b9aca07", "maxFeePerGas": "0x3b9aca0e", "maxPriorityFeePerGas": "0x3b9aca00", "hash": "0xc65bab0ee754df8f7152a56cb606cba829f076e8d9f22caa863de153bb2f0e5e", "input": "0xf907fa8a505141492d4646472d31f907ecf8af01a0000000000000000000000000000000000000000000000000000000000000512aa0e7c41635510f505a9877...(+3962 hex chars)", "nonce": "0xc4", "to": "0x08a60aa7959381fa8089f4db1d359107e243a59f", "transactionIndex": "0x0", "value": "0x0", "type": "0x2", "accessList": [], "chainId": "0x512a", "v": "0x0", "r": "0x54118e3ddd7a2d6f07815954d3b6bdfa1949c5ad966c5e6aa89e4a766e0e6444", "s": "0x51019227b38e08cd0477deecc0cba729c88e5c4584c58f9b811b782dadffeec4", "yParity": "0x0" } } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_getTransactionByBlockNumberAndIndex` Returns the transaction for the given block number and index. | | | |---|---| | Access | **Public · read-only** · playground | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:1730` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | transaction object or null | **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `blockNr` | `blockTag` | yes | block number (hex) or 'latest' | 'earliest' | 'pending' | 'safe' | 'finalized' | | 1 | `index` | `quantity` | yes | 0x-prefixed hex integer | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_getTransactionByBlockNumberAndIndex", "params": [ "0xd43", "0x0" ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0xd43", "0x0"]}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x5ae63f554b1d25fcb55a81a763b4a46ef23886615e77c9e0bee64ffb62e45658", "blockNumber": "0xd43", "from": "0x4014d3651e6ac0107720cf74c3062053787912e0", "gas": "0x25878", "gasPrice": "0x3b9aca07", "maxFeePerGas": "0x3b9aca0e", "maxPriorityFeePerGas": "0x3b9aca00", "hash": "0xc65bab0ee754df8f7152a56cb606cba829f076e8d9f22caa863de153bb2f0e5e", "input": "0xf907fa8a505141492d4646472d31f907ecf8af01a0000000000000000000000000000000000000000000000000000000000000512aa0e7c41635510f505a9877...(+3962 hex chars)", "nonce": "0xc4", "to": "0x08a60aa7959381fa8089f4db1d359107e243a59f", "transactionIndex": "0x0", "value": "0x0", "type": "0x2", "accessList": [], "chainId": "0x512a", "v": "0x0", "r": "0x54118e3ddd7a2d6f07815954d3b6bdfa1949c5ad966c5e6aa89e4a766e0e6444", "s": "0x51019227b38e08cd0477deecc0cba729c88e5c4584c58f9b811b782dadffeec4", "yParity": "0x0" } } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_getTransactionByHash` Returns the transaction for the given hash | | | |---|---| | Access | **Public · read-only** · playground | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:1781` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | transaction object or null | **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `hash` | `hash32` | yes | 32-byte hex hash, 0x-prefixed | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_getTransactionByHash", "params": [ "0xc65bab0ee754df8f7152a56cb606cba829f076e8d9f22caa863de153bb2f0e5e" ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_getTransactionByHash", "params": ["0xc65bab0ee754df8f7152a56cb606cba829f076e8d9f22caa863de153bb2f0e5e"]}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x5ae63f554b1d25fcb55a81a763b4a46ef23886615e77c9e0bee64ffb62e45658", "blockNumber": "0xd43", "from": "0x4014d3651e6ac0107720cf74c3062053787912e0", "gas": "0x25878", "gasPrice": "0x3b9aca07", "maxFeePerGas": "0x3b9aca0e", "maxPriorityFeePerGas": "0x3b9aca00", "hash": "0xc65bab0ee754df8f7152a56cb606cba829f076e8d9f22caa863de153bb2f0e5e", "input": "0xf907fa8a505141492d4646472d31f907ecf8af01a0000000000000000000000000000000000000000000000000000000000000512aa0e7c41635510f505a9877...(+3962 hex chars)", "nonce": "0xc4", "to": "0x08a60aa7959381fa8089f4db1d359107e243a59f", "transactionIndex": "0x0", "value": "0x0", "type": "0x2", "accessList": [], "chainId": "0x512a", "v": "0x0", "r": "0x54118e3ddd7a2d6f07815954d3b6bdfa1949c5ad966c5e6aa89e4a766e0e6444", "s": "0x51019227b38e08cd0477deecc0cba729c88e5c4584c58f9b811b782dadffeec4", "yParity": "0x0" } } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_getTransactionCount` Returns the number of transactions the given address has sent for the given block number | | | |---|---| | Access | **Public · read-only** · playground | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:1762` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | quantity (hex) | **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `address` | `address` | yes | 20-byte hex address, 0x-prefixed | | 1 | `blockNrOrHash` | `blockRef` | yes | block number (hex), tag, or EIP-1898 object {blockHash|blockNumber} | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_getTransactionCount", "params": [ "0x4014d3651e6ac0107720cf74c3062053787912e0", "latest" ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_getTransactionCount", "params": ["0x4014d3651e6ac0107720cf74c3062053787912e0", "latest"]}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": "0xc5" } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_getTransactionReceipt` Returns the transaction receipt for the given transaction hash. | | | |---|---| | Access | **Public · read-only** · playground | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:1818` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | receipt object or null | **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `hash` | `hash32` | yes | 32-byte hex hash, 0x-prefixed | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_getTransactionReceipt", "params": [ "0xc65bab0ee754df8f7152a56cb606cba829f076e8d9f22caa863de153bb2f0e5e" ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_getTransactionReceipt", "params": ["0xc65bab0ee754df8f7152a56cb606cba829f076e8d9f22caa863de153bb2f0e5e"]}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x5ae63f554b1d25fcb55a81a763b4a46ef23886615e77c9e0bee64ffb62e45658", "blockNumber": "0xd43", "contractAddress": null, "cumulativeGasUsed": "0xbf0c", "effectiveGasPrice": "0x3b9aca07", "from": "0x4014d3651e6ac0107720cf74c3062053787912e0", "gasUsed": "0xbf0c", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...(+384 hex chars)", "status": "0x1", "to": "0x08a60aa7959381fa8089f4db1d359107e243a59f", "transactionHash": "0xc65bab0ee754df8f7152a56cb606cba829f076e8d9f22caa863de153bb2f0e5e", "transactionIndex": "0x0", "type": "0x2" } } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_getUncleByBlockHashAndIndex` Returns the uncle block for the given block hash and index. When fullTx is true all transactions in the block are returned in full detail, otherwise only the transaction hash is returned. | | | |---|---| | Access | **Public · read-only** · playground | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:862` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | block object or null | **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `blockHash` | `hash32` | yes | 32-byte hex hash, 0x-prefixed | | 1 | `index` | `quantity` | yes | 0x-prefixed hex integer | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_getUncleByBlockHashAndIndex", "params": [ "", "" ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_getUncleByBlockHashAndIndex", "params": ["", ""]}' \ "$RPC" ``` === "Response" No live response is recorded for this method (state-changing, operator-only or no safe sample). **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_getUncleByBlockNumberAndIndex` Returns the uncle block for the given block hash and index. When fullTx is true all transactions in the block are returned in full detail, otherwise only the transaction hash is returned. | | | |---|---| | Access | **Public · read-only** · playground | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:846` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | block object or null | **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `blockNr` | `blockTag` | yes | block number (hex) or 'latest' | 'earliest' | 'pending' | 'safe' | 'finalized' | | 1 | `index` | `quantity` | yes | 0x-prefixed hex integer | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_getUncleByBlockNumberAndIndex", "params": [ "", "" ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_getUncleByBlockNumberAndIndex", "params": ["", ""]}' \ "$RPC" ``` === "Response" No live response is recorded for this method (state-changing, operator-only or no safe sample). **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_getUncleCountByBlockHash` Returns number of uncles in the block for the given block hash | | | |---|---| | Access | **Public · read-only** · playground | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:886` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | quantity (hex) or null | **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `blockHash` | `hash32` | yes | 32-byte hex hash, 0x-prefixed | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_getUncleCountByBlockHash", "params": [ "0x5ae63f554b1d25fcb55a81a763b4a46ef23886615e77c9e0bee64ffb62e45658" ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_getUncleCountByBlockHash", "params": ["0x5ae63f554b1d25fcb55a81a763b4a46ef23886615e77c9e0bee64ffb62e45658"]}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_getUncleCountByBlockNumber` Returns number of uncles in the block for the given block number | | | |---|---| | Access | **Public · read-only** · playground | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:877` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | quantity (hex) or null | **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `blockNr` | `blockTag` | yes | block number (hex) or 'latest' | 'earliest' | 'pending' | 'safe' | 'finalized' | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_getUncleCountByBlockNumber", "params": [ "0xd43" ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_getUncleCountByBlockNumber", "params": ["0xd43"]}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_hashrate` Returns the POW hashrate. | | | |---|---| | Access | **Public · read-only** | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/eth/api.go:45` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | quantity (hex) | !!! note "Behaviour on PQWERAI" Read-only but describes this node's local configuration or mempool; results differ per node. **Parameters:** none === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_hashrate", "params": [] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_hashrate", "params": []}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_maxPriorityFeePerGas` Returns a suggestion for a gas tip cap for dynamic fee transactions. | | | |---|---| | Access | **Public · read-only** · playground | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:86` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | quantity (hex) | **Parameters:** none === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_maxPriorityFeePerGas", "params": [] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_maxPriorityFeePerGas", "params": []}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": "0x3b9aca00" } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_mining` Returns an indication if this node is currently mining. | | | |---|---| | Access | **Public · read-only** | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/eth/api.go:50` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | boolean | !!! note "Behaviour on PQWERAI" Read-only but describes this node's local configuration or mempool; results differ per node. **Parameters:** none === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_mining", "params": [] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_mining", "params": []}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_newBlockFilter` Creates a filter that fetches blocks that are imported into the chain. It is part of the filter package since polling goes with eth_getFilterChanges. | | | |---|---| | Access | **Public · read-only (stateful filter)** | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/eth/filters/api.go:196` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | filter ID (hex string) | !!! note "Behaviour on PQWERAI" Creates or reads per-node filter state that expires after 5 minutes of inactivity; unreliable behind load-balanced endpoints. **Parameters:** none === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_newBlockFilter", "params": [] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_newBlockFilter", "params": []}' \ "$RPC" ``` === "Response" No live response is recorded for this method (state-changing, operator-only or no safe sample). **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_newFilter` Creates a new filter and returns the filter id. It can be used to retrieve logs when the state changes. This method cannot be used to fetch logs that are already stored in the state. Default criteria for the from and to block are "latest". Using "latest" as block number will return logs for mined blocks. Using "pending" as block number returns logs for not yet mined (pending) blocks. In case logs are removed (chain reorg) previously returned logs are returned again but with the removed property set to true. In case "fromBlock" > "toBlock" an error is returned. | | | |---|---| | Access | **Public · read-only (stateful filter)** | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/eth/filters/api.go:370` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | filter ID (hex string) | !!! note "Behaviour on PQWERAI" Creates or reads per-node filter state that expires after 5 minutes of inactivity; unreliable behind load-balanced endpoints. **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `crit` | `filterObject` | yes | {fromBlock,toBlock,address,topics,blockHash} | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_newFilter", "params": [ "" ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_newFilter", "params": [""]}' \ "$RPC" ``` === "Response" No live response is recorded for this method (state-changing, operator-only or no safe sample). **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_newPendingTransactionFilter` Creates a filter that fetches pending transactions as transactions enter the pending state. It is part of the filter package because this filter can be used through the `eth_getFilterChanges` polling method that is also used for log filters. | | | |---|---| | Access | **Public · read-only (stateful filter)** | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/eth/filters/api.go:120` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | filter ID (hex string) | !!! note "Behaviour on PQWERAI" Creates or reads per-node filter state that expires after 5 minutes of inactivity; unreliable behind load-balanced endpoints. **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `fullTx` | `*bool` | no | *bool | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_newPendingTransactionFilter", "params": [ "" ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_newPendingTransactionFilter", "params": [""]}' \ "$RPC" ``` === "Response" No live response is recorded for this method (state-changing, operator-only or no safe sample). **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_newSideBlockFilter` Creates a filter that fetches blocks that are imported into the chain with a non-canonical status. It is part of the filter package since polling goes with eth_getFilterChanges. | | | |---|---| | Access | **Public · read-only (stateful filter)** | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/eth/filters/api.go:229` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | filter ID (hex string) | !!! note "Behaviour on PQWERAI" Creates or reads per-node filter state that expires after 5 minutes of inactivity; unreliable behind load-balanced endpoints. **Parameters:** none === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_newSideBlockFilter", "params": [] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_newSideBlockFilter", "params": []}' \ "$RPC" ``` === "Response" No live response is recorded for this method (state-changing, operator-only or no safe sample). **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_pendingTransactions` Returns the transactions that are in the transaction pool and have a from address that is one of the accounts this node manages. | | | |---|---| | Access | **Public · read-only** | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:2065` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | array of transaction objects | !!! note "Behaviour on PQWERAI" Read-only but describes this node's local configuration or mempool; results differ per node. **Parameters:** none === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_pendingTransactions", "params": [] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_pendingTransactions", "params": []}' \ "$RPC" ``` === "Response" No live response is recorded for this method (state-changing, operator-only or no safe sample). **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_sendRawTransaction` Will add the signed transaction to the transaction pool. The sender is responsible for signing the transaction and using the correct nonce. | | | |---|---| | Access | **Public · write (client-signed)** | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:1989` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | 32-byte hash | !!! note "Behaviour on PQWERAI" Broadcasts a transaction signed by the client. The node never receives keys. **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `input` | `bytes` | yes | 0x-prefixed hex data | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_sendRawTransaction", "params": [ "" ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_sendRawTransaction", "params": [""]}' \ "$RPC" ``` === "Response" No live response is recorded for this method (state-changing, operator-only or no safe sample). **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. - Recorded: `["0x00"]` → `{"code": -32000, "message": "typed transaction too short"}` --- ### `eth_syncing` Returns false in case the node is currently not syncing with the network. It can be up-to-date or has not yet received the latest block headers from its pears. In case it is synchronizing: - startingBlock: block number this node started to synchronize from - currentBlock: block number this node is currently importing - highestBlock: block number of the highest block header this node has received from peers - pulledStates: number of state entries processed until now - knownStates: number of known state entries that still need to be pulled | | | |---|---| | Access | **Public · read-only** · playground | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:136` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | false or sync-progress object | **Parameters:** none === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_syncing", "params": [] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_syncing", "params": []}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_uninstallFilter` Removes the filter with the given filter id. | | | |---|---| | Access | **Public · read-only (stateful filter)** | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/eth/filters/api.go:436` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | boolean | !!! note "Behaviour on PQWERAI" Creates or reads per-node filter state that expires after 5 minutes of inactivity; unreliable behind load-balanced endpoints. **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `id` | `filterId` | yes | filter identifier returned by eth_newFilter, eth_newBlockFilter or eth_newPendingTransactionFilter | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_uninstallFilter", "params": [ "" ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_uninstallFilter", "params": [""]}' \ "$RPC" ``` === "Response" No live response is recorded for this method (state-changing, operator-only or no safe sample). **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- # JSON-RPC: g4 namespace (finality) # g4 namespace (finality) PQWERAI BFT finality, Smartnode registry and exact issuance accounting. 3 public methods. Operator, disabled and unsupported methods of this namespace are listed in [Operator interfaces](operator.md). `$RPC` is your node URL (see [quickstart](../../getting-started/blockchain-quickstart.md)). | Method | Access | Summary | |---|---|---| | [`g4_evidence`](#g4_evidence) | Public · read-only | Lists equivocation evidence (double or surround votes) detected by this node. | | [`g4_status`](#g4_status) | Public · read-only | Finality and issuance accounting: head, justified/finalized checkpoints, registry totals, exact issuance count | | [`g4_validators`](#g4_validators) | Public · read-only | Lists Smartnode validators from the registry: id, owner, Ed25519 key, stake, delegated stake, activation epoch | ### `g4_evidence` Lists equivocation evidence (double or surround votes) detected by this node. | | | |---|---| | Access | **Public · read-only** · playground | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/cmd/pqwerai-core/g4.go:376` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | array of objects | **Parameters:** none === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "g4_evidence", "params": [] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "g4_evidence", "params": []}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": null } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `g4_status` Finality and issuance accounting: head, justified/finalized checkpoints, registry totals, exact issuance counters and vote-submission counters. | | | |---|---| | Access | **Public · read-only** · playground | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/cmd/pqwerai-core/g4.go:210` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | object | !!! note "Behaviour on PQWERAI" PQWERAI finality and issuance accounting. Fields minted_wei, pow_issued_wei, pos_issued_wei, founder_issued_wei and fee_burn_wei are exact counters read from consensus state. **Parameters:** none === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "g4_status", "params": [] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "g4_status", "params": []}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": { "epoch_set_root": "738681aacb1e6ae6b4ac3d4811b1eeed72fc58dfde06925c9518d022be98efd3", "epoch_set_size": 8, "fee_burn_wei": "11238156192", "finality": true, "finalized_hash": "0x6084012e9c51853a7f55632b95e5ea31225b0ba478c41040f5d14e1406249485", "finalized_height": 3360, "founder_issued_wei": "18296009000000000", "head": 3398, "ipfs_issued_wei": "91480045000000000", "justified_hash": "0xc052d1b3c726e19145e3919c75837f9bda9dceba255f8ebeaa686564b2930929", "justified_height": 3392, "liveness_ejected_validators": 0, "liveness_participation_records": true, "minted_wei": "1001367829600900000000000", "pos_issued_wei": "329328162000000000", "pow_issued_wei": "1225832603000000000", "registry_locked_gwei": 256000000000, "registry_slash_burned_gwei": 0, "rejected_certificates": 3, "reserve_issued_wei": "164664081000000000", "validators": 8, "vote_counters": { "certificate_regossip_peers": 9, "forged_or_unauthorized": 58, "replayed": 71 } } } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `g4_validators` Lists Smartnode validators from the registry: id, owner, Ed25519 key, stake, delegated stake, activation epoch and status. | | | |---|---| | Access | **Public · read-only** · playground | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/cmd/pqwerai-core/g4.go:344` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | array of objects | **Parameters:** none === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "g4_validators", "params": [] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "g4_validators", "params": []}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "activation_epoch": 0, "delegated_gwei": 0, "id": "006deec6ad22108132270e180f6d5129ec0c9df957fc5060a610920f89b79eb0", "key": "4c4eb1b767799e138cc2683e2796dda142149a48bf68fb9605182acc8149fa87", "last_seen_epoch": 106, "owner": "0xf586ab6d74a479338dd3dfe0eb00ef47ab6f6469", "pending_key": false, "stake_gwei": 32000000000, "status": "active" }, { "activation_epoch": 0, "delegated_gwei": 0, "id": "1854f42760eaba4cc5d5646edcc96cb6dc5777d031c729a1592129f63e3bbe11", "key": "2ff5c73c2f1f952d0f46a9a569a5d129b6f45d714c8a4d2a4f3cea597e72fd84", "last_seen_epoch": 105, "owner": "0xfdfe78145ab107960e6f6ef80aed79ff251b8665", "pending_key": false, "stake_gwei": 32000000000, "status": "active" }, { "activation_epoch": 0, "delegated_gwei": 0, "id": "713dedb75cb0bcb25baa4d76227be7e8de1f2ae753c1d3873d6517bb28d3f698", "key": "762e147b2f0014059334d0afde366ffc40ffd58fc87c90db7855ee398ea0a3ed", "last_seen_epoch": 106, "owner": "0x608706e9e09375b5332b3393466dbcddbac23390", "pending_key": false, "stake_gwei": 32000000000, "status": "active" }, "... 5 more items" ] } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- # JSON-RPC: net namespace # net namespace Network identity and peer count. 3 public methods. Operator, disabled and unsupported methods of this namespace are listed in [Operator interfaces](operator.md). `$RPC` is your node URL (see [quickstart](../../getting-started/blockchain-quickstart.md)). | Method | Access | Summary | |---|---|---| | [`net_listening`](#net_listening) | Public · read-only | Returns an indication if the node is listening for network connections. | | [`net_peerCount`](#net_peercount) | Public · read-only | Returns the number of connected peers | | [`net_version`](#net_version) | Public · read-only | Returns the current ethereum protocol version. | ### `net_listening` Returns an indication if the node is listening for network connections. | | | |---|---| | Access | **Public · read-only** · playground | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:2295` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | boolean | **Parameters:** none === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "net_listening", "params": [] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "net_listening", "params": []}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": true } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `net_peerCount` Returns the number of connected peers | | | |---|---| | Access | **Public · read-only** · playground | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:2300` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | quantity (hex) | **Parameters:** none === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "net_peerCount", "params": [] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "net_peerCount", "params": []}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": "0x4" } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `net_version` Returns the current ethereum protocol version. | | | |---|---| | Access | **Public · read-only** · playground | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:2305` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | string | **Parameters:** none === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "net_version", "params": [] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "net_version", "params": []}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": "20778" } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- # Operator JSON-RPC interfaces # Operator interfaces !!! danger "Not for public endpoints or documentation tooling" These methods are registered by PQWERAI Core but are either privileged (mining, validator voting, peer diagnostics), need keys the node never holds, or are deliberately disabled. They are documented so operators can recognise them. The API playground never executes them, and a public RPC proxy should not forward them. | Method | Class | Why it is restricted | |---|---|---| | [`eth_getFilterLogs`](#eth_getfilterlogs) | Disabled on PQWERAI Core | Always returns an error on PQWERAI Core: a stored filter would bypass the eth_getLogs block-range bound. Use eth_getLogs or eth_getFilterChanges. | | [`eth_getWork`](#eth_getwork) | Operator · mining | Legacy Ethash external-miner interface. GhostRider sealing runs inside the node through the pinned helper; operator use only, never through a public proxy. | | [`eth_resend`](#eth_resend) | Unsupported (node-held keys) | Requires an account unlocked inside the node. PQWERAI Core exposes no personal_* namespace and loads no keystore, so these return an error; sign in the client and use eth_sendRawTransaction. | | [`eth_sendTransaction`](#eth_sendtransaction) | Unsupported (node-held keys) | Requires an account unlocked inside the node. PQWERAI Core exposes no personal_* namespace and loads no keystore, so these return an error; sign in the client and use eth_sendRawTransaction. | | [`eth_sign`](#eth_sign) | Unsupported (node-held keys) | Requires an account unlocked inside the node. PQWERAI Core exposes no personal_* namespace and loads no keystore, so these return an error; sign in the client and use eth_sendRawTransaction. | | [`eth_signTransaction`](#eth_signtransaction) | Unsupported (node-held keys) | Requires an account unlocked inside the node. PQWERAI Core exposes no personal_* namespace and loads no keystore, so these return an error; sign in the client and use eth_sendRawTransaction. | | [`eth_submitHashrate`](#eth_submithashrate) | Operator · mining | Legacy Ethash external-miner interface. GhostRider sealing runs inside the node through the pinned helper; operator use only, never through a public proxy. | | [`eth_submitWork`](#eth_submitwork) | Operator · mining | Legacy Ethash external-miner interface. GhostRider sealing runs inside the node through the pinned helper; operator use only, never through a public proxy. | | [`g4_context`](#g4_context) | Operator · validator helper | Read-only helpers used by Smartnode signers to obtain the checkpoint vote context. Not needed by applications. | | [`g4_link`](#g4_link) | Operator · validator helper | Read-only helpers used by Smartnode signers to obtain the checkpoint vote context. Not needed by applications. | | [`g4_submitVote`](#g4_submitvote) | Operator · validator action | Accepts signature-verified Smartnode finality votes. Authenticated, replay-checked and rate-limited by the node. Never exposed through documentation tooling. | | [`pqwerai_peerHealth`](#pqwerai_peerhealth) | Operator · diagnostics | Peer manager diagnostics (peer IDs and subnets). Operators should not expose it through public endpoints. | ## Namespaces that are not served Probed on the live node: every method of these namespaces returns `-32601 method not found`. | Namespace | Result | |---|---| | `admin_*` | not served (-32601) | | `clique_*` | not served (-32601) | | `debug_*` | not served (-32601) | | `engine_*` | not served (-32601) | | `ethash_*` | not served (-32601) | | `les_*` | not served (-32601) | | `miner_*` | not served (-32601) | | `personal_*` | not served (-32601) | | `trace_*` | not served (-32601) | ### `eth_getFilterLogs` Disabled on PQWERAI Core (would bypass the eth_getLogs range bound). | | | |---|---| | Access | **Disabled on PQWERAI Core** | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/cmd/pqwerai-core/logs.go:52` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | array of log objects | !!! warning "Behaviour on PQWERAI" Always returns an error on PQWERAI Core: a stored filter would bypass the eth_getLogs block-range bound. Use eth_getLogs or eth_getFilterChanges. **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `id` | `filterId` | yes | filter identifier returned by eth_newFilter, eth_newBlockFilter or eth_newPendingTransactionFilter | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_getFilterLogs", "params": [ "0x1" ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_getFilterLogs", "params": ["0x1"]}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "error": { "code": -32000, "message": "eth_getFilterLogs is disabled; use eth_getLogs (bounded range) or eth_getFilterChanges" } } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_getWork` Returns a work package for external miner. The work package consists of 3 strings: result[0] - 32 bytes hex encoded current block header pow-hash result[1] - 32 bytes hex encoded seed hash used for DAG result[2] - 32 bytes hex encoded boundary condition ("target"), 2^256/difficulty result[3] - hex encoded block number | | | |---|---| | Access | **Operator · mining** | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/consensus/ethash/api.go:42` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | [headerHash, seedHash, target, blockNumber] | !!! warning "Behaviour on PQWERAI" Legacy Ethash external-miner interface. GhostRider sealing runs inside the node through the pinned helper; operator use only, never through a public proxy. **Parameters:** none === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_getWork", "params": [] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_getWork", "params": []}' \ "$RPC" ``` === "Response" No live response is recorded for this method (state-changing, operator-only or no safe sample). **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. - Recorded: `[]` → `{"code": -32000, "message": "no mining work available yet"}` --- ### `eth_resend` Accepts an existing transaction and a new gas price and limit. It will remove the given transaction from the pool and reinsert it with the new gas price and limit. | | | |---|---| | Access | **Unsupported (node-held keys)** | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:2089` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | 32-byte hash | !!! warning "Behaviour on PQWERAI" Requires an account unlocked inside the node. PQWERAI Core exposes no personal_* namespace and loads no keystore, so these return an error; sign in the client and use eth_sendRawTransaction. **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `sendArgs` | `txObject` | yes | transaction call object {from,to,gas,gasPrice|maxFeePerGas,maxPriorityFeePerGas,value,input|data,nonce,accessList} | | 1 | `gasPrice` | `quantity` | no | 0x-prefixed hex integer | | 2 | `gasLimit` | `*hexutil.Uint64` | no | *hexutil.Uint64 | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_resend", "params": [ "", "", "" ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_resend", "params": ["", "", ""]}' \ "$RPC" ``` === "Response" No live response is recorded for this method (state-changing, operator-only or no safe sample). **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_sendTransaction` Creates a transaction for the given argument, sign it and submit it to the transaction pool. | | | |---|---| | Access | **Unsupported (node-held keys)** | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:1935` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | 32-byte hash | !!! warning "Behaviour on PQWERAI" Requires an account unlocked inside the node. PQWERAI Core exposes no personal_* namespace and loads no keystore, so these return an error; sign in the client and use eth_sendRawTransaction. **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `args` | `txObject` | yes | transaction call object {from,to,gas,gasPrice|maxFeePerGas,maxPriorityFeePerGas,value,input|data,nonce,accessList} | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_sendTransaction", "params": [ "" ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_sendTransaction", "params": [""]}' \ "$RPC" ``` === "Response" No live response is recorded for this method (state-changing, operator-only or no safe sample). **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. - Recorded: `[{"from": "0x4014d3651e6ac0107720cf74c3062053787912e0", "to": "0x4014d3651e6ac0107720cf74c3062053787912e0", "value": "0x1"}]` → `{"code": -32000, "message": "unknown account"}` --- ### `eth_sign` Calculates an ECDSA signature for: keccak256("\x19Ethereum Signed Message:\n" + len(message) + message). Note, the produced signature conforms to the secp256k1 curve R, S and V values, where the V value will be 27 or 28 for legacy reasons. The account associated with addr must be unlocked. https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign | | | |---|---| | Access | **Unsupported (node-held keys)** | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:2006` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | data (hex) | !!! warning "Behaviour on PQWERAI" Requires an account unlocked inside the node. PQWERAI Core exposes no personal_* namespace and loads no keystore, so these return an error; sign in the client and use eth_sendRawTransaction. **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `addr` | `address` | yes | 20-byte hex address, 0x-prefixed | | 1 | `data` | `bytes` | yes | 0x-prefixed hex data | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_sign", "params": [ "", "" ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_sign", "params": ["", ""]}' \ "$RPC" ``` === "Response" No live response is recorded for this method (state-changing, operator-only or no safe sample). **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. - Recorded: `["0x4014d3651e6ac0107720cf74c3062053787912e0", "0x00"]` → `{"code": -32000, "message": "unknown account"}` --- ### `eth_signTransaction` Will sign the given transaction with the from account. The node needs to have the private key of the account corresponding with the given from address and it needs to be unlocked. | | | |---|---| | Access | **Unsupported (node-held keys)** | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:2031` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | {raw, tx} | !!! warning "Behaviour on PQWERAI" Requires an account unlocked inside the node. PQWERAI Core exposes no personal_* namespace and loads no keystore, so these return an error; sign in the client and use eth_sendRawTransaction. **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `args` | `txObject` | yes | transaction call object {from,to,gas,gasPrice|maxFeePerGas,maxPriorityFeePerGas,value,input|data,nonce,accessList} | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_signTransaction", "params": [ "" ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_signTransaction", "params": [""]}' \ "$RPC" ``` === "Response" No live response is recorded for this method (state-changing, operator-only or no safe sample). **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_submitHashrate` Can be used for remote miners to submit their hash rate. This enables the node to report the combined hash rate of all miners which submit work through this node. It accepts the miner hash rate and an identifier which must be unique between nodes. | | | |---|---| | Access | **Operator · mining** | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/consensus/ethash/api.go:93` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | boolean | !!! warning "Behaviour on PQWERAI" Legacy Ethash external-miner interface. GhostRider sealing runs inside the node through the pinned helper; operator use only, never through a public proxy. **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `rate` | `quantity` | yes | 0x-prefixed hex integer | | 1 | `id` | `hash32` | yes | 32-byte hex hash, 0x-prefixed | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_submitHashrate", "params": [ "", "" ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_submitHashrate", "params": ["", ""]}' \ "$RPC" ``` === "Response" No live response is recorded for this method (state-changing, operator-only or no safe sample). **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `eth_submitWork` Can be used by external miner to submit their POW solution. It returns an indication if the work was accepted. Note either an invalid solution, a stale work a non-existent work will return false. | | | |---|---| | Access | **Operator · mining** | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/consensus/ethash/api.go:67` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | boolean | !!! warning "Behaviour on PQWERAI" Legacy Ethash external-miner interface. GhostRider sealing runs inside the node through the pinned helper; operator use only, never through a public proxy. **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `nonce` | `bytes8` | yes | 8-byte nonce | | 1 | `hash` | `hash32` | yes | 32-byte hex hash, 0x-prefixed | | 2 | `digest` | `hash32` | yes | 32-byte hex hash, 0x-prefixed | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_submitWork", "params": [ "", "", "" ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_submitWork", "params": ["", "", ""]}' \ "$RPC" ``` === "Response" No live response is recorded for this method (state-changing, operator-only or no safe sample). **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `g4_context` Builds the RLP vote context for a checkpoint link between two heights. | | | |---|---| | Access | **Operator · validator helper** | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/cmd/pqwerai-core/g4.go:330` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | string | !!! warning "Behaviour on PQWERAI" Read-only helpers used by Smartnode signers to obtain the checkpoint vote context. Not needed by applications. **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `source` | `integer` | yes | JSON number | | 1 | `target` | `integer` | yes | JSON number | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "g4_context", "params": [ "", "" ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "g4_context", "params": ["", ""]}' \ "$RPC" ``` === "Response" No live response is recorded for this method (state-changing, operator-only or no safe sample). **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. - Recorded: `[0, 1]` → `{"code": -32000, "message": "invalid checkpoint link"}` --- ### `g4_link` Returns the next checkpoint link (source, target, RLP vote context) validators should sign, or null. | | | |---|---| | Access | **Operator · validator helper** | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/cmd/pqwerai-core/g4.go:259` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | object | !!! warning "Behaviour on PQWERAI" Read-only helpers used by Smartnode signers to obtain the checkpoint vote context. Not needed by applications. **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `refused` | `integer` | no | JSON number (optional) | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "g4_link", "params": [ null ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "g4_link", "params": [null]}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": null } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `g4_submitVote` Submits a signed Smartnode finality vote (RLP context + signed vote). Authenticated against the epoch validator set. | | | |---|---| | Access | **Operator · validator action** | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/cmd/pqwerai-core/g4.go:407` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | object | !!! warning "Behaviour on PQWERAI" Accepts signature-verified Smartnode finality votes. Authenticated, replay-checked and rate-limited by the node. Never exposed through documentation tooling. **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `ctxHex` | `string` | yes | JSON string | | 1 | `voteHex` | `string` | yes | JSON string | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "g4_submitVote", "params": [ "", "" ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "g4_submitVote", "params": ["", ""]}' \ "$RPC" ``` === "Response" No live response is recorded for this method (state-changing, operator-only or no safe sample). **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `pqwerai_peerHealth` Peer-manager diagnostics: target, connected peers (IDs and subnets), dial candidates, cache and manifest status. | | | |---|---| | Access | **Operator · diagnostics** | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/cmd/pqwerai-core/peers.go:555` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | peer health object | !!! warning "Behaviour on PQWERAI" Peer manager diagnostics (peer IDs and subnets). Operators should not expose it through public endpoints. **Parameters:** none === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "pqwerai_peerHealth", "params": [] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "pqwerai_peerHealth", "params": []}' \ "$RPC" ``` === "Response" No live response is recorded for this method (state-changing, operator-only or no safe sample). **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- # JSON-RPC: txpool namespace # txpool namespace Transaction-pool inspection (node-local view of pending and queued transactions). 4 public methods. Operator, disabled and unsupported methods of this namespace are listed in [Operator interfaces](operator.md). `$RPC` is your node URL (see [quickstart](../../getting-started/blockchain-quickstart.md)). | Method | Access | Summary | |---|---|---| | [`txpool_content`](#txpool_content) | Public · read-only | Returns the transactions contained within the transaction pool. | | [`txpool_contentFrom`](#txpool_contentfrom) | Public · read-only | Returns the transactions contained within the transaction pool. | | [`txpool_inspect`](#txpool_inspect) | Public · read-only | Retrieves the content of the transaction pool and flattens it into an easily inspectable list. | | [`txpool_status`](#txpool_status) | Public · read-only | Returns the number of pending and queued transaction in the pool. | ### `txpool_content` Returns the transactions contained within the transaction pool. | | | |---|---| | Access | **Public · read-only** | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:176` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | map[string]map[string]map[string]*RPCTransaction | !!! note "Behaviour on PQWERAI" Read-only but describes this node's local configuration or mempool; results differ per node. **Parameters:** none === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "txpool_content", "params": [] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "txpool_content", "params": []}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": { "pending": { "0x4014d3651e6AC0107720cF74c3062053787912E0": { "197": { "blockHash": null, "blockNumber": null, "from": "0x4014d3651e6ac0107720cf74c3062053787912e0", "gas": "0x3b978", "gasPrice": "0x3b9aca0e", "maxFeePerGas": "0x3b9aca0e", "maxPriorityFeePerGas": "0x3b9aca00", "hash": "0x664e0096501b674bab60c46e6f8ea97581d7f3c5ed82d505d71f45c7a342707d", "input": "0xf9032f8f505141492d4646472d504152542d31f9031cf8af01a0000000000000000000000000000000000000000000000000000000000000512aa0e7c4163551...(+1508 hex chars)", "nonce": "0xc5", "to": "0x08a60aa7959381fa8089f4db1d359107e243a59f", "transactionIndex": null, "value": "0x0", "type": "0x2", "accessList": [], "chainId": "0x512a", "v": "0x1", "r": "0x54fa52a4e3a11b74df1b3b862c26b6f6e4238c5cbe6337986014aa66006fea3f", "s": "0x349fd223d751f78e6c531a525b86aed61e9cd93ab289c5ed667c365a1f7e7a4e", "yParity": "0x1" } } }, "queued": {} } } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `txpool_contentFrom` Returns the transactions contained within the transaction pool. | | | |---|---| | Access | **Public · read-only** | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:203` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | map[string]map[string]*RPCTransaction | !!! note "Behaviour on PQWERAI" Read-only but describes this node's local configuration or mempool; results differ per node. **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `addr` | `address` | yes | 20-byte hex address, 0x-prefixed | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "txpool_contentFrom", "params": [ "0x4014d3651e6ac0107720cf74c3062053787912e0" ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "txpool_contentFrom", "params": ["0x4014d3651e6ac0107720cf74c3062053787912e0"]}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": { "pending": { "197": { "blockHash": null, "blockNumber": null, "from": "0x4014d3651e6ac0107720cf74c3062053787912e0", "gas": "0x3b978", "gasPrice": "0x3b9aca0e", "maxFeePerGas": "0x3b9aca0e", "maxPriorityFeePerGas": "0x3b9aca00", "hash": "0x664e0096501b674bab60c46e6f8ea97581d7f3c5ed82d505d71f45c7a342707d", "input": "0xf9032f8f505141492d4646472d504152542d31f9031cf8af01a0000000000000000000000000000000000000000000000000000000000000512aa0e7c4163551...(+1508 hex chars)", "nonce": "0xc5", "to": "0x08a60aa7959381fa8089f4db1d359107e243a59f", "transactionIndex": null, "value": "0x0", "type": "0x2", "accessList": [], "chainId": "0x512a", "v": "0x1", "r": "0x54fa52a4e3a11b74df1b3b862c26b6f6e4238c5cbe6337986014aa66006fea3f", "s": "0x349fd223d751f78e6c531a525b86aed61e9cd93ab289c5ed667c365a1f7e7a4e", "yParity": "0x1" } }, "queued": {} } } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `txpool_inspect` Retrieves the content of the transaction pool and flattens it into an easily inspectable list. | | | |---|---| | Access | **Public · read-only** | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:236` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | map[string]map[string]map[string]string | !!! note "Behaviour on PQWERAI" Read-only but describes this node's local configuration or mempool; results differ per node. **Parameters:** none === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "txpool_inspect", "params": [] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "txpool_inspect", "params": []}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": { "pending": { "0x4014d3651e6AC0107720cF74c3062053787912E0": { "197": "0x08a60aa7959381FA8089f4db1d359107E243A59F: 0 wei + 244088 gas \u00d7 1000000014 wei" } }, "queued": {} } } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `txpool_status` Returns the number of pending and queued transaction in the pool. | | | |---|---| | Access | **Public · read-only** | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/internal/ethapi/api.go:226` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | map[string]hexutil.Uint | !!! note "Behaviour on PQWERAI" Read-only but describes this node's local configuration or mempool; results differ per node. **Parameters:** none === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "txpool_status", "params": [] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "txpool_status", "params": []}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": { "pending": "0x1", "queued": "0x0" } } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- # JSON-RPC: web3 namespace # web3 namespace Client version and Keccak-256 helper. 2 public methods. Operator, disabled and unsupported methods of this namespace are listed in [Operator interfaces](operator.md). `$RPC` is your node URL (see [quickstart](../../getting-started/blockchain-quickstart.md)). | Method | Access | Summary | |---|---|---| | [`web3_clientVersion`](#web3_clientversion) | Public · read-only | Returns the client identifier. | | [`web3_sha3`](#web3_sha3) | Public · read-only | Applies the ethereum sha3 implementation on the input | ### `web3_clientVersion` Returns the client identifier. | | | |---|---| | Access | **Public · read-only** · playground | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/node/api.go:333` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | string | **Parameters:** none === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "web3_clientVersion", "params": [] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "web3_clientVersion", "params": []}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": "CoreGeth/linux-amd64/go1.26.8" } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- ### `web3_sha3` Applies the ethereum sha3 implementation on the input. It assumes the input is hex encoded. | | | |---|---| | Access | **Public · read-only** · playground | | Network | testnet 20778 (local node or approved endpoint); mainnet not available | | Authentication | none on loopback; bearer token when the node binds a non-loopback address; public proxies rate-limit per IP | | Minimum software | protocol `pqwerai-v8-testnet/1` | | Verified | source `core/source/node/api.go:339` at Core `bad4a06ea`; registered on live `CoreGeth/linux-amd64/go1.26.8` | | Returns | data (hex) | **Parameters** | # | Name | Type | Required | Description | |---|---|---|---|---| | 0 | `input` | `bytes` | yes | 0x-prefixed hex data | === "JSON-RPC request" ```json { "jsonrpc": "2.0", "id": 1, "method": "web3_sha3", "params": [ "0x68656c6c6f" ] } ``` === "curl" ```bash curl -s -H 'content-type: application/json' \ -d '{"jsonrpc": "2.0", "id": 1, "method": "web3_sha3", "params": ["0x68656c6c6f"]}' \ "$RPC" ``` === "Recorded response" Recorded 2026-11-28T06:02:45+00:00 at head 3396 on a public testnet, chain 20778. Long arrays are truncated. ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1c8aff950685c2ed4bc3174f3472287b56d9517b9c948127319a09a7a36deac8" } ``` **Errors and edge cases** - `-32602` invalid or missing parameter (e.g. `missing value for required argument 0`). - `-32000` execution or validation error with a message from the node. --- # Protocol Research and Specifications # Protocol Research and Specifications This Developer Hub documents **what is implemented and tested** for public testnet 20778. Design plans and research are kept apart so they are never mistaken for available features. | Kind | Where | Status meaning | |---|---|---| | Current product documentation | This site | Implemented; tested where stated on each page | | Normative chain parameters | [`network.json`](../blockchain/network-parameters.md) | Binding for nodes and wallets | | Strategic Plan v3.1 and decision records | Project blueprint (repository-internal) | **Draft target**; existing code and tests decide status | | Historical plans (v4/v6/v7) | Project blueprint | **Historical**; superseded | ## Research tracks The dated, evidence-backed status of every feature is on [Feature status](../resources/feature-status.md). | Track | State | |---|---| | GhostFlow parallel execution | **Experimental**, node-local option; consensus-neutral; measured 1.3–1.6× execution speed-up only at ≥ 512 transactions per block in a single-process benchmark; no network throughput figure is claimed | | [GhostTurbo](ghostturbo.md) phases 1–2 (adaptive scheduling, smart transactions) | Tested locally; all flags off; not enabled on 20778 | | [GhostTurbo](ghostturbo.md) phase 3 (faster finality) | **Shadow mode only** (provisional signal, never final); runs on the 8 operator validators of 20778 since 28 November 2026; the provisional shadow checkpoint runs ahead of the real finalized checkpoint, which alone is final; not consensus finality | | GhostPulse adaptive network intelligence | **Experimental, advisory and node-local**: node health, congestion and resource advice for node, mining and AI work; never changes consensus or the issuance split | | Difficulty rule v2 (higher hash-rate band) | Candidate, not active | | liveness/v1 (duty window, inactivity exit) | Genesis-bound on 20778 (duty window 8, inactivity 12 checkpoints) | | Distributed training, training rewards | Out of scope for this testnet | | Independent multi-operator AI cohort | Required before AI gates can pass; not established | ## Statements that are historical, not current - "WASM is research-only" → WASM VM v1 is official release scope and enabled in the 20778 profile from block 0; [C++ and C# authoring guides](../contracts/wasm/index.md) describe supported tooling and remaining acceptance limits. - "AI revenue split 80/7/4/4/4/1" → replaced by [revenue policy v3](../ai/revenue-policy.md). - "Block rewards 80 % PoW / 20 % PoS" → the chain 20778 split is 67 % PoW / 18 % Smartnodes / 1 % founder / 9 % Quantum Reserve / 5 % IPFS storage pool from block 1. - "The chain has no PUSH0/MCOPY" → obsolete; see [EVM compatibility](../blockchain/evm-compatibility.md). - Placeholder site URLs and the old `PQWERAI_v8` repository name in older material (corrected in this release). # GhostTurbo — adaptive trust execution and shadow fast finality # GhostTurbo — adaptive trust execution and shadow fast finality **GhostTurbo** (adaptive trust execution and shadow fast finality) is a research track built on top of the **GhostFlow** parallel execution engine. Its goal is faster, Smartnode-backed confirmations; today only the phases below exist, and none of them makes a transaction final sooner. Node flags, RPC fields and files use the identifiers `pate` and `pase`. It has three phases. Only phase 3 runs on the test network, and only in **shadow mode**. !!! warning "Shadow finality is not finality" On testnet 20778 a transaction is irreversible only when the **real** Smartnode checkpoint that covers it is finalized (see [Finality for applications](../blockchain/finality.md)). The shadow signal described below is provisional and measured for research. Wallets, exchanges, bridges and the fork choice must not rely on it. ## At a glance | Phase | What it does | Status | On chain 20778 | | --- | --- | --- | --- | | 1 — adaptive trust scheduling | Node-local, advisory scheduler: transactions that are likely to conflict go straight to the serial path, so GhostFlow wastes less work on re-execution | Tested locally | No (flag off by default) | | 2 — smart transactions | Opt-in recurring payments through an explicit `RecurringPermissions` contract, execution templates and an adaptive TrustGuard | Tested locally | No (flags off; contract not deployed, needs an independent audit) | | 3 — shadow fast finality | Validators sign an extra, provisional finality link on a short interval next to the real 32-block checkpoints, so faster finality can be measured without changing consensus | Shadow mode | Shadow mode on the 8 operator validators since the launch (27 November 2026), shadow quorum since 28 November (GhostTurbo); provisional only, never final | The authoritative, dated status of each phase is on the [Feature status](../resources/feature-status.md) page. ## Phase 1 — adaptive trust scheduling - **Purpose:** reduce wasted parallel work. GhostFlow executes independent transactions in parallel and re-executes on conflicts; GhostTurbo keeps a node-local reputation of *conflict behaviour* and routes predictable conflicts to the serial path first. - **Consensus impact:** none. The scheduler is advisory: block contents, ordering, state roots and validity are identical with GhostTurbo on or off. It never affects votes, weights, quorum or fork choice. - **Configuration:** a node flag, off by default. Public RPC endpoints refuse the `pase_pate*` methods. - **Limits:** results are local benchmarks on one host. No throughput figure is claimed for the running network. ## Phase 2 — smart transactions - **Purpose:** let a user authorise a recurring payment explicitly (amount cap, interval, expiry, revocation) instead of signing every instance. - **Pieces:** the `RecurringPermissions` contract, a smart-transaction engine, execution templates, the adaptive TrustGuard, and an optional wallet *Recurring* page. - **Status:** all flags off. The contract is **not deployed** on any public network; an independent contract audit is required before any deployment. ## Phase 3 — shadow fast finality A transaction becomes irreversible 32–66 blocks after inclusion, because Casper-FFG-style finality needs two consecutive justified checkpoints 32 blocks apart. Phase 3 studies **block-level** faster finality: keep GhostRider proof-of-work ordering, the existing Ed25519 Smartnode votes, the more-than-two-thirds quorum and slashing rules, but justify checkpoints on a shorter interval. - **Transaction-level instant finality is not feasible** without moving ordering authority from miners to validators, which would be a different consensus model. GhostTurbo does not do that. - **Shadow mode** (node flag `-ff.shadow`): validators sign the shorter-interval links as well, and the node reports a *provisional* shadow finality height (`ff_status`) next to the real one. Nothing in block validity, fork choice or state depends on it. - **On chain 20778** (since 28 November 2026): the 8 signers post shadow votes through the signer gateway (`https://rpc-testnet.pqwerai.com/signer`, allowlisted validator hosts only), and the provisional shadow checkpoint runs ahead of the real finalized checkpoint. It is always provisional: only the real checkpoint is final, and consensus is unchanged. The public RPC serves `ff_status`, `ff_votes` and `ghostturbo_status`. No latency figure is claimed for 20778. - **Fixed issue:** a late signer could stall its shadow votes (finding `FFSHADOW-LATE-SIGNER-STARVED`), fixed in Core 987d727fb, which is included in the chain 20778 Core. - **Activation:** turning shorter-interval finality into real consensus finality is a hard fork with a new profile commitment. It needs a decentralised validator set, the stage-aware slashing decision and an independent review. It is not scheduled. !!! note "Trust assumption" Real finality on 20778 rests on eight genesis validators run by one operator. Any faster finality inherits that assumption; decentralising the validator set matters more than latency. ## Source documents - Phase 1 design: `architecture/PATE_ADAPTIVE_TRUST_EXECUTION.md` - Phase 2 design: `architecture/PATE_PHASE2_SMART_TRANSACTIONS.md` - Phase 3 audit, design and shadow-mode prototype: `architecture/PATE_PHASE3_FAST_FINALITY.md` These files are in the project repository; results and rollout records are kept with the project evidence. # Resources # Resources | Page | Contents | |---|---| | [Changelog](changelog.md) | API, SDK/tooling, contract toolchain and protocol changes | | [Compatibility matrix](compatibility.md) | Which Wallet, Core, explorer API and compiler versions were tested together | | [Versions](versions.md) | Documentation versions and what each covers | | [AI-friendly resources](ai-resources.md) | `llms.txt`, `llms-full.txt`, OpenRPC, OpenAPI, Postman | | [Source provenance](provenance.md) | How this site is built from reviewed sources, and the latest test results | | [Known gaps and limitations](gaps.md) | What is missing or not public yet | ## Current overview Start with [Current ecosystem status](current-status.md) for the reviewed 23 November snapshot across all topics, then [Feature status](feature-status.md) for evidence levels and [Known gaps](gaps.md) for open acceptance. # AI-friendly resources # AI-friendly resources | Resource | Contents | |---|---| | [`/llms.txt`](../llms.txt) | Curated index of every public page with a one-line description | | [`/llms-full.txt`](../llms-full.txt) | Full text of every public page (Markdown) in one file | | [`rpc-methods.json`](../downloads/rpc-methods.json) | All 72 RPC methods: parameters, return types, access class, source location, recorded examples | | [`pqwerai-openrpc.json`](../downloads/pqwerai-openrpc.json) | OpenRPC 1.2.6 document of the public methods | | [`explorer-openapi.yaml`](../downloads/explorer-openapi.yaml) | Explorer REST API, OpenAPI 3.1 | | [`pqwerai-postman-collection.json`](../downloads/pqwerai-postman-collection.json) | Read-only RPC + explorer requests | | [`provenance.json`](../provenance.json) | Source commit, build version, pages, sources | These files are generated in the same build as the human pages, from the same allowlisted sources, and pass the same publication checks; there is no separate, broader export for agents. ## MCP documentation server (evaluated, not deployed) A read-only MCP server exposing `search_docs`, `get_page` and `get_rpc_method` over the files above is feasible (the data is static and public). It is not deployed yet. If built, it must serve only this build's public files, never the repository, and never proxy node RPC. # Changelog # Changelog ## Wallet 0.9.1 — 28 November 2026 - **Create a token in one click:** a Create token button in the Contract Studio header, a Create a token card on the first screen of the new-contract wizard (no-code ERC-20 for every language, or the token example for Solidity, Vyper, Fe, C++ and C#), and a Create a token card on the Tokens page that opens Studio without switching to Advanced. - **Rectangular controls:** 4 px corners for buttons, inputs, chips, list rows and the sidebar; 6 px for cards and panels. - Same Core `a679d60a1`, genesis v3 and network values as 0.9.0; installing over 0.9.0 keeps keys and settings. ## Public testnet 20778 documentation — 27 November 2026 - The documentation now describes **public testnet 20778** (chain ID `20778` / `0x512a`, genesis v3 `0xe7c41635510f505a98776ca3a198730e0cc120cd10039069006be334f41f3db6`, Core `a679d60a1`). The network is live since 27 November 2026, 21:47 UTC; the public endpoints serve it since 28 November 2026, about 07:10 UTC. Genesis v3 replaces two earlier candidates that were never launched; every former fork rule is bound in its genesis profile, so nodes pass no rule or fork flag. The docs live under `/testnet-20778/`. - **Issuance:** 67 % PoW / 18 % Smartnodes / 1 % founder / 9 % Quantum Reserve / 5 % IPFS storage pool from block 1, credited per epoch by validator vote participation. The IPFS share is bound in the genesis profile (no fork flag); the pool contract was deployed at `0xf4286aEB5865B9Ea6d620595E9E72707B0134EB5` in block 143; no storage operator runs on 20778 yet. - **Contracts:** the AI market, QAI/tEUR, tWPQAI, the standard contracts (proxy, Multicall3, Permit2), the IPFS reward pool and the Quantum Reserve `0xcebDE02DF19270F4E56423607806AAeC6561A945` were **deployed** on 27 November 2026 (deployment verification PASS, author record). The Smartnode Warranty and RecurringPermissions are **not deployed**. There is no legacy wrapped coin on 20778. - **Feature status:** GhostRider mining and Smartnode BFT finality are live (first finalized checkpoint 64); GhostFlow is experimental and node-local (no network throughput figure); GhostTurbo runs in shadow mode only; GhostPulse is advisory; GhostShield v2 (32 tPQAI collateral, up to 10 sponsored addresses, GhostTurbo eligibility, payment-assurance claims from block 1) is bound in the genesis and active on 20778; the independent review is pending before mainnet. - **Wallet for 20778:** 0.9.0, published 28 November 2026. Earlier wallet releases (up to 0.8.26) cannot join chain 20778. - **JSON-RPC reference:** the method list is unchanged; recorded examples are withheld until they are re-captured from a 20778 node at launch. Core CLI flags are now extracted from Core `a679d60a1` (new miner options `--miner.ghostturbo-priority`, default true, and `--miner.ghostturbo-reserve`, default 50). Format: entries record what changed for developers; exact commits are in the repository history and [provenance](provenance.md). # Compatibility matrix # Compatibility matrix | Component | Version | Tested how | Result | |---|---|---|---| | Protocol | `pqwerai-v8-testnet/1`, chain 20778 (journeys verified before the chain 20778 launch; re-run on 20778 still to be recorded) | All journeys | ✅ before launch | | Core (method inventory source) | `bad4a06ea` source snapshot | RPC methods extracted from source | ✅ 72 methods | | Core (live node used for tests) | release build `6a3337e7` (`CoreGeth/linux-amd64/go1.26.8`) | Live probe + journeys | ✅ 72/72 registered | | GhostRider helper | SHA-256 `3a54f0bb…99a8` | Mining on local testnet | ✅ | | PQWERAI Windows Wallet | 0.8.21 (before the chain 20778 launch), executable source `dac4bd7f`; the 20778 build is 0.9.1 (published 28 November 2026 after 0.9.0; no test results recorded on this page) | Release: 459 tests PASS / 97 skips; packaged UI 19 PASS / 1 skip; CI 28/28 at `90212432` with identical executable inputs | Author verification, not independent audit | | Explorer | 0.8.0 / schema 3, REST v1 and read-only Etherscan /api | Public status and proxy read checked 23 November; OpenAPI describes the interface | Historical contract test counts remain historical | | solc | 0.8.26+commit.8a97fa7a | Foundry + CLI | ✅ | | Vyper | 0.4.3+commit.bff19ea2 | CLI | ✅ | | Huff Neo `hnc` | 1.7.1 (2fe1d0c9) | CLI | ✅ (experimental tooling) | | Fe | 26.5.1 (149c758) | CLI, Contract Studio | ✅ (pre-1.0 upstream) | | OpenZeppelin Contracts | 5.0.2 (tar SHA-256 `18c7b7e9…925a`) | ERC-20/721/1155, Ownable2Step, AccessControl | ✅ | | Foundry | 1.8.5 (51a52c5) | Every journey | ✅ | | Hardhat, Remix, ethers.js, viem, web3.py | — | Not executed | ⚪ NOT RUN | !!! note "Two Core revisions" The repository holds the Core source snapshot `bad4a06ea` that the RPC inventory is parsed from; the local testnet used to verify it runs the later release build `6a3337e7`. Every method in the snapshot is registered on the live build; the live build additionally reports liveness fields in `g4_status`. ## Pins serve different purposes The old RPC source/probe rows above identify the original 72-method extraction and recorded examples; they are not the latest binary release. Wallet 0.8.21 bundles Windows Core `f5d9ce2c6` and its platform-specific helper. The selected research Core `54c4ed638` is another source identity and is not the bundled version. Public read-only status on 23 November (before the chain 20778 launch) did not rerun every old example/compiler journey. The release's `SHA256SUMS` is authoritative for the exact package/platform. No new compatibility claim is made for the separately developing 0.8.22/native-signing/macOS branches. # Current ecosystem status # Current ecosystem status **Reviewed 28 November 2026, author review.** This is a navigation snapshot for public testnet **20778**, not an acceptance gate. [Feature status](feature-status.md) remains the evidence-level ledger. [Known gaps](gaps.md) records limits. Test assets tPQAI, tWPQAI, tQAI and tEUR have no monetary value. No mainnet is authorized or scheduled. ## Release and network identity - **Chain/network 20778** (`0x512a`), genesis v3 `0xe7c41635510f505a98776ca3a198730e0cc120cd10039069006be334f41f3db6`, generated with PQWERAI Core `a679d60a1`. The network is **live since 27 November 2026, 21:47 UTC**; the first finalized checkpoint (height 64) followed at 22:03 UTC. The public endpoints `https://rpc-testnet.pqwerai.com`, `https://explorer.pqwerai.com` (explorer 0.11.0), the faucet, the docs and the site serve chain 20778 since 28 November 2026, about 07:10 UTC. See [network parameters](../blockchain/network-parameters.md). - **Wallet for 20778: 0.9.1, published 28 November 2026** (token creation in one click; 0.9.0 brought the Smartnode & GhostShield hub). Earlier wallet releases cannot join chain 20778. The SHA-256 values are on the release page. - **Genesis validators:** 8 Smartnode validators × 32 tPQAI, 0 ejected, all run by the project, so the network is not yet decentralised. - **Issuance:** 67 % PoW / 18 % Smartnodes / 1 % founder / 9 % Quantum Reserve / 5 % IPFS storage pool from block 1, credited per epoch in proportion to validator vote participation. The IPFS share is bound in the genesis profile (no fork flag); the IPFS reward v2 pool contract was deployed at its address in block 143. No storage operator runs on 20778 yet, so nothing has been claimed. ## Status labels used here | Label | Meaning | |---|---| | Live | Implemented and tested; switched on at chain 20778 genesis or deployed on 20778 | | Experimental | Implemented, node-local or opt-in; no network-level claim | | Shadow mode | Runs next to the real mechanism and is measured, but never decides anything | | Not deployed | Contract exists and was tested, but is not deployed on chain 20778 | | In development | Specification or code in progress; not released | | Planned | A target; no working code yet | ## Complete topic map | Topic | Current information and guide | Status on 20778 / evidence boundary | |---|---|---| | Accounts and recovery | [Local keys, phrase and encrypted backups](../wallet/accounts-and-backup.md) | Never disclose a recovery phrase; no hardware-wallet acceptance claimed | | Agents and collaboration | [Six guarded roles, peer observations and Discord status](../nodes/agents.md) | Experimental; advisory only, never move funds on their own | | AI downloads / IPFS | [Public reads, signed bundles and cache repair](../ai/model-distribution.md) | Public download access is separate from paid inference and storage bonds | | AI runtime and sharing | [Managed CPU/Vulkan startup](../wallet/ai-sharing.md) | Independent multi-GPU proof open | | AI Workflows | [Canvas, provider discovery, LoRA, datasets and knowledge](../ai/workflows.md) | AI market contracts deployed on 20778; paid steps need a registered provider, and none is registered on 20778 yet | | Block production (GhostRider) | [Network](../blockchain/network-parameters.md), [mining](../mining/index.md) | Live: CPU proof of work from block 0; measure the block interval on the explorer | | Consensus finality (Smartnode BFT) | [32-block checkpoints and application finality](../blockchain/finality.md) | Live: 8 project-operated validators, first finalized checkpoint 64; independent consensus/security acceptance open | | EVM and WASM | [EVM rules](../blockchain/evm-compatibility.md), [WASM](../contracts/wasm/index.md) | Live: London + listed EIPs and WASM VM v1 from genesis; inference never validates blocks | | Contract Studio | [Seven languages, compile, simulate and verify](../wallet/studio.md) | Pin compiler/target; no automatic safety guarantee | | Developer SDKs | [Foundry, ethers, viem, web3.py and tools](../tools/index.md) | No official SDK; NOT RUN examples remain labelled | | Editor AI gateway | [Loopback endpoint, route and spending session](../tools/vscode-ai.md) | Explicit budget; editor cannot approve payments itself | | Escrow and AI revenue (GhostLLM) | [Paid Ask](../wallet/paid-ask.md), [v3 policy](../ai/revenue-policy.md) | AIJobMarket, ModelRegistry and AIProviderRegistry deployed on 20778 (27 November 2026); no independent provider registered yet; no on-chain verification of inference results | | Explorer / Etherscan | [REST](../explorer/reference.md), [read-only /api](../explorer/etherscan.md) | No source verification, tracing or complete ERC-1155 decoding | | Faucet | [Testnet onboarding](../getting-started/blockchain-quickstart.md) | Limited test funds from the genesis faucet, not mainnet allocations or guaranteed availability | | Fees and issuance | [67/18/1/9/5 from block 1](../mining/rewards-and-issuance.md) | Uncapped; base fee burned, tip to miner; AI revenue separate | | Genesis Program / Discord | [Sign-in and participation guide](../getting-started/genesis-program.md) | GenesisBadge contract deployed; the programme service is not running on 20778 yet; no mainnet entitlement | | IPFS storage rewards | [Bonded v2 design](../getting-started/ipfs-storage-reward.md) | 5 % share credited from block 1; v2 pool contract deployed (block 143); no storage operator yet, nothing claimed | | Mining | [Native Windows CPU mining](../getting-started/wallet-mining.md) | Needs wallet 0.9.0 (the 20778 build); XMRig pool evidence remains disposable-chain only | | Model pools | [Whole-model routing or split stages](../getting-started/model-pool.md) | Directory live at `pools-testnet.pqwerai.com`, relay live; official pool `bonsai-2-community` created 28 November 2026 with 0 members; pooled on-chain settlement and independent split/payout acceptance open | | Node operations | [Install](../nodes/install.md), [monitor/backup/rollback](../nodes/operations.md) | Keep signer journals safe; no rule or fork flags on chain 20778 (all genesis-bound) | | GhostFlow / GhostTurbo | [Research status](../research/ghostturbo.md) | GhostFlow experimental, node-local; GhostTurbo shadow mode only (provisional), not consensus finality | | GhostPulse | [Research status](../research/index.md) | Read-only `ghostpulse_*` methods run on every 20778 core; advisory and node-local, not on the public RPC; governor not deployed | | GhostShield | [Smartnode Warranty](../wallet/smartnode-warranty.md) | GhostShield v2 active on 20778 (genesis-bound, payment-assurance claims from block 1): 1 collateral record (sn1 owner, 32 tPQAI), 10 assured sponsorships, 0 claims; not insurance; independent review pending before mainnet. The separate Warranty contract is not GhostShield and is not deployed | | Post-quantum token (QAI) | [tQAI/tEUR contracts and recovery](../contracts/guides/qai-post-quantum.md) | Deployed on 20778 (27 November 2026); legacy bonding-curve buys paused since block 5,112 (sells open); tEUR, the curve and the 120% stack are legacy and the economy is under redesign; authorization is post-quantum, normal gas/votes/P2P remain classical | | Quantum Reserve | [Treasury and QAI distinction](../contracts/guides/qai-post-quantum.md) | Deployed at `0xcebDE02DF19270F4E56423607806AAeC6561A945` (block 165); 2-of-3 governance, caps; auto policy off | | RPC and integration | [JSON-RPC](../reference/json-rpc/index.md), [custody](../nodes/exchange-integration.md) | Public safe/finalized proxy tags differ from self-hosted Core; no tracing/WebSocket promise | | Security and distribution | [Provenance](provenance.md), [gaps](gaps.md) | No independent audit; signed release fabric/recovery acceptance still incomplete | | Tokens / NFTs | [ERC-20](../contracts/guides/erc20.md), [721](../contracts/guides/erc721.md), [1155](../contracts/guides/erc1155.md) | A Studio template does not imply complete token indexing | ## Development is separate from the public package Wallet diagnostics, native message signing/Discord verification, macOS, agent collaboration and free-community integration have separate source branches and their own evidence. Local implementation, a build or unit tests do not establish an installed-wallet/browser/Discord acceptance run or independent audit. Measurements made before the chain 20778 launch show that the code ran, not that it runs on chain 20778. # Feature status # Feature status Every readiness claim on pqwerai.com and in these docs comes from one ledger (`docs/status/readiness.json`). A level is only reached with repository evidence, and tools never raise a level: a promotion is a reviewed change with new evidence. When evidence gets old, the last verified level stays, with its date, and is flagged for review. **No feature is independently audited and nothing is mainnet ready.** Public test network 20778 has been live since 27 November 2026: features of its genesis that run on it are *live on testnet*, contracts deployed on it are *deployed on testnet*, and services that do not run on it yet are *tested · not yet on 20778*. Every validator, miner and public service is still run by the project. tPQAI and tQAI have no monetary value. ## Readiness levels 0. **Planned** — a target in the plan; no working code yet 1. **Implemented in code** — source exists on a project branch or in the selected Core 2. **Locally tested** — executed tests or a local multi-node harness passed (author verification) 3. **Deployed on testnet** — code or contracts are deployed on public test network 20778 4. **Enabled on the running network** — switched on and in use on public test network 20778 5. **Independently audited** — an independent security review was completed and its report is recorded 6. **Mainnet ready** — cleared for a mainnet by an explicit owner decision after audit ## Summary | Feature | Status | Last verified | | --- | --- | --- | | GhostRider CPU mining | Live on testnet | 2026-11-28 | | Smartnode checkpoint finality | Live on testnet | 2026-11-28 | | Issuance split 67/18/1/9/5 | Live on testnet | 2026-11-28 | | EVM smart contracts with EIP-1559 | Live on testnet | 2026-11-28 | | WASM VM v1 | Deployed on testnet | 2026-11-28 | | Post-quantum signature verification (ML-DSA-65, SLH-DSA) | Live on testnet | 2026-11-28 | | GhostFlow parallel execution engine | Tested locally · experimental | 2026-11-27 | | GhostTurbo phases 1 and 2 (adaptive trust scheduling, smart transactions) | Tested locally | 2026-11-28 | | GhostTurbo phase 3 shadow fast finality | Testnet · shadow mode | 2026-11-28 | | GhostShield v2 Smartnode sponsorship and payment assurance | Live on testnet · experimental | 2026-11-28 | | GhostPulse adaptive network intelligence | Deployed on testnet · experimental | 2026-11-28 | | GhostDeploy universal node hosting standard (GDS-1) | Deployed on testnet · experimental | 2026-11-28 | | AI market contracts (ModelRegistry, AIJobMarket escrow) | Deployed on testnet | 2026-11-28 | | Same-model compute pools | Deployed on testnet | 2026-11-28 | | GhostLLM inference runtimes | Tested locally | 2026-11-27 | | QAI post-quantum test token (bonding curve) | Deployed on testnet · experimental | 2026-11-28 | | Quantum Reserve (2-of-3 ML-DSA-65 treasury) | Deployed on testnet | 2026-11-28 | | IPFS storage reward (ipfs-reward/v1, 5% of issuance) | Deployed on testnet | 2026-11-28 | | IPFS reward v2 (bonded, slashable proof of access) | Deployed on testnet | 2026-11-28 | | Public read-only explorer | Live on testnet | 2026-11-28 | | Automatic peer discovery | Tested locally | 2026-11-28 | | Network Monitor internal agent (QL-007) | Tested · not yet on 20778 | 2026-11-28 | | Internal role agents QL-008 to QL-012 (Security, Economic, Compute Scheduler, Training Coordinator, Developer) | Tested · not yet on 20778 | 2026-11-28 | | Ethereum ecosystem compatibility, phase 1: deployment proxy, Multicall3, Permit2, Wrapped tPQAI | Deployed on testnet | 2026-11-28 | | Genesis Program: Discord-verified Mainnet Joinlist and testnet tasks | Tested · not yet on 20778 | 2026-11-28 | | Public testnet launch (faucet, independent validators) | Deployed on testnet | 2026-11-28 | | Mainnet | Planned | 2026-11-27 | ## Details and evidence ### GhostRider CPU mining Ordinary computers seal every block with GhostRider proof of work. - **Level:** Enabled on the running network - **Limits:** Seals every block of chain 20778 since the launch on 27 November 2026. Two miners run by the project seal blocks today, and anyone running a node can add hashrate. Native Windows mining comes with the 20778 wallet (0.9.0). Pool mining is tested on a disposable chain only; no benchmark against other GhostRider implementations exists. - **Docs:** [mining](../mining/index.md), [getting-started/become-a-miner](../getting-started/become-a-miner.md) - **Evidence (repository paths):** - Implemented in code (2026-11-27): `developers/data/network-20778.json` — chain 20778 network specification (genesis 0xe7c41635…3db6, Core a679d60a1) - Locally tested (2026-11-15): `audit/evidence/2026-11-15-g1-stratum/README.md` - Deployed on testnet (2026-11-27): `audit/evidence/2026-11-27-chain-20778-launch/README.md` — chain 20778 launch record: live since 2026-11-27 21:47 UTC, first finalized checkpoint 64 at 22:03 UTC - Enabled on the running network (2026-11-27): `audit/evidence/2026-11-27-chain-20778-launch/README.md` — chain 20778 launch record: live since 2026-11-27 21:47 UTC, first finalized checkpoint 64 at 22:03 UTC ### Smartnode checkpoint finality Staked validators vote on 32-block checkpoints; more than two thirds of stake makes them final. - **Level:** Enabled on the running network - **Limits:** Eight genesis validators of 32 tPQAI each, all run by the project, two per host on four VPS (Chicago, Frankfurt, Los Angeles, Amsterdam), so that no single host can finalize alone; checkpoint 64 was the first finalized on 27 November 2026. Not yet independent, and one project host relays the certificates. Validator top-up and the stage-aware surround-vote fix are bound in the genesis profile. The liveness rule (force exit after 12 silent checkpoints) still needs a rehearsal with this layout. Slashing acceptance and the full validator lifecycle are not complete. - **Docs:** [smartnodes](../smartnodes/index.md), [getting-started/smartnode](../getting-started/smartnode.md), [smartnodes/finality](../smartnodes/finality.md) - **Evidence (repository paths):** - Implemented in code (2026-11-27): `developers/data/network-20778.json` — chain 20778 network specification (genesis 0xe7c41635…3db6, Core a679d60a1) - Locally tested (2026-11-05): `audit/evidence/testnet-rc1/finality-griefing` - Deployed on testnet (2026-11-27): `audit/evidence/2026-11-27-chain-20778-launch/README.md` — chain 20778 launch record: live since 2026-11-27 21:47 UTC, first finalized checkpoint 64 at 22:03 UTC - Enabled on the running network (2026-11-27): `audit/evidence/2026-11-27-chain-20778-launch/README.md` — chain 20778 launch record: live since 2026-11-27 21:47 UTC, first finalized checkpoint 64 at 22:03 UTC ### Issuance split 67/18/1/9/5 New tPQAI is split by consensus rule from block 1: 67% miners, 18% active Smartnode stake, 1% founder treasury, 9% Quantum Reserve and 5% IPFS storage pool, credited each epoch according to validator vote participation. - **Level:** Enabled on the running network - **Limits:** tPQAI has no monetary value. No supply cap by policy. An epoch without validator votes issues nothing, proof-of-work share included. The 67/18/1/9/5 split is bound in the genesis profile (no fork flag) and was measured on chain at launch; the 5% IPFS storage share is taken from the 72% base proof-of-work share and goes to the bonded v2 pool contract, deployed at its address in block 143. - **Docs:** [mining/rewards-and-issuance](../mining/rewards-and-issuance.md), [blockchain/network-parameters](../blockchain/network-parameters.md) - **Evidence (repository paths):** - Implemented in code (2026-11-27): `developers/data/network-20778.json` — chain 20778 network specification (genesis 0xe7c41635…3db6, Core a679d60a1) - Locally tested (2026-11-05): `audit/evidence/testnet-rc1/founder-issuance` - Deployed on testnet (2026-11-27): `audit/evidence/2026-11-27-chain-20778-launch/README.md` — chain 20778 launch record: live since 2026-11-27 21:47 UTC, first finalized checkpoint 64 at 22:03 UTC - Enabled on the running network (2026-11-27): `audit/evidence/2026-11-27-chain-20778-launch/README.md` — chain 20778 launch record: live since 2026-11-27 21:47 UTC, first finalized checkpoint 64 at 22:03 UTC ### EVM smart contracts with EIP-1559 Standard Ethereum tooling deploys contracts; the base fee is burned. - **Level:** Enabled on the running network - **Limits:** No sustained TPS figure is claimed; the TPS benchmark on 20778 has not run and the 10,000 TPS target is open. EVM rules through London plus EIP-3651, 3855, 3860, 5656, 1153 and EIP-6780 at block 0. 24 contracts were deployed with standard tooling at launch. - **Docs:** [contracts](../contracts/index.md), [getting-started/first-smart-contract](../getting-started/first-smart-contract.md), [blockchain/evm-compatibility](../blockchain/evm-compatibility.md) - **Evidence (repository paths):** - Implemented in code (2026-11-27): `developers/data/network-20778.json` — chain 20778 network specification (genesis 0xe7c41635…3db6, Core a679d60a1) - Locally tested (2026-11-14): `audit/evidence/2026-11-14-studio-languages-stable/conformance.txt` - Deployed on testnet (2026-11-27): `audit/evidence/2026-11-27-chain-20778-launch/addresses-20778.json` — 24 contracts deployed on 20778 on 2026-11-27 (blocks 143-209), runtime verify PASS - Enabled on the running network (2026-11-27): `audit/evidence/2026-11-27-chain-20778-launch/README.md` — chain 20778 launch record: live since 2026-11-27 21:47 UTC, first finalized checkpoint 64 at 22:03 UTC ### WASM VM v1 A second virtual machine runs WebAssembly contracts next to the EVM. - **Level:** Deployed on testnet - **Limits:** Enabled at genesis block 0 of 20778, with local-variable metering bound in the genesis profile; no WASM contract is part of the launch deployment. Release acceptance (remaining resource-limit questions, mixed-version rollout, explorer display, independent review) is open. - **Docs:** [contracts/application-languages](../contracts/application-languages.md) - **Evidence (repository paths):** - Implemented in code (2026-11-27): `developers/data/network-20778.json` — chain 20778 network specification (genesis 0xe7c41635…3db6, Core a679d60a1) - Locally tested (2026-11-13): `audit/evidence/2026-11-13-wasm-v1-acceptance/summary.json` - Deployed on testnet (2026-11-27): `audit/evidence/2026-11-27-chain-20778-launch/README.md` — chain 20778 launch record: live since 2026-11-27 21:47 UTC, first finalized checkpoint 64 at 22:03 UTC ### Post-quantum signature verification (ML-DSA-65, SLH-DSA) Contracts can verify post-quantum signatures through built-in precompiles. - **Level:** Enabled on the running network - **Limits:** Enabled at genesis block 0 of 20778; the ML-DSA-65 and SLH-DSA-192s verifier wrappers that call them are deployed. Ordinary tPQAI transactions, Smartnode votes and P2P transport still use classical cryptography. - **Docs:** [contracts/guides/qai-post-quantum](../contracts/guides/qai-post-quantum.md) - **Evidence (repository paths):** - Implemented in code (2026-11-12): `audit/evidence/2026-11-12-qai-pq/README.md` - Locally tested (2026-11-12): `audit/evidence/2026-11-12-qai-pq/qai-gas.json` - Deployed on testnet (2026-11-27): `audit/evidence/2026-11-27-chain-20778-launch/addresses-20778.json` — 24 contracts deployed on 20778 on 2026-11-27 (blocks 143-209), runtime verify PASS - Enabled on the running network (2026-11-27): `audit/evidence/2026-11-27-chain-20778-launch/README.md` — chain 20778 launch record: live since 2026-11-27 21:47 UTC, first finalized checkpoint 64 at 22:03 UTC ### GhostFlow parallel execution engine Runs independent transactions in parallel; a cost-aware profile picks serial or parallel per batch, and the result is always the same as serial execution. - **Level:** Locally tested - **Mode:** experimental - **Limits:** Experimental, node-local and consensus-neutral: it never changes which transactions are valid or the resulting state. A single-process benchmark measured a 1.3 to 1.6 times faster execution only for blocks with 512 or more transactions and no gain at 128 or fewer; no network throughput (TPS) figure is claimed. No live block has gone through it yet. - **Docs:** [research](../research/index.md), [nodes/install](../nodes/install.md) - **Evidence (repository paths):** - Implemented in code (2026-11-15): `architecture/PATE_ADAPTIVE_TRUST_EXECUTION.md` - Locally tested (2026-11-15): `audit/evidence/2026-11-15-pate-v1/README.md` - Locally tested (2026-11-20): `audit/evidence/2026-11-20-pase-merge-path/REPORT.md` ### GhostTurbo phases 1 and 2 (adaptive trust scheduling, smart transactions) Advisory scheduling that routes predictable conflicts to the serial path, plus opt-in recurring smart transactions. - **Level:** Locally tested - **Limits:** Advisory and node-local: it never changes transaction order, validity or gas. Flags are off by default. The RecurringPermissions contract is not deployed on 20778 and needs an independent audit first. - **Docs:** [research/ghostturbo](../research/ghostturbo.md) - **Evidence (repository paths):** - Implemented in code (2026-11-15): `architecture/PATE_ADAPTIVE_TRUST_EXECUTION.md` - Implemented in code (2026-11-15): `architecture/PATE_PHASE2_SMART_TRANSACTIONS.md` - Locally tested (2026-11-15): `audit/PATE_V1_RESULTS_2026-11-15.md` - Locally tested (2026-11-15): `audit/PATE_V2_RESULTS_2026-11-15.md` ### GhostTurbo phase 3 shadow fast finality Validators sign an extra, provisional finality signal next to the real one, so its speed can be measured without changing consensus. - **Level:** Enabled on the running network - **Mode:** shadow: provisional signal only; real finality is unchanged - **Limits:** Shadow mode is not consensus finality: a provisional signal is never final, and wallets, exchanges and the fork choice rely only on the real 32-block checkpoints. It runs in shadow mode on chain 20778 since the launch. Since 28 November 2026 the eight signers send their shadow votes through a signer gateway and every validator-host core pulls them, so the provisional shadow checkpoint now runs ahead of the real finalized checkpoint (public RPC method ff_status, always marked provisional). No latency figure is claimed yet. Activating faster finality would be a hard fork that needs independent validators and an independent review. - **Docs:** [research/ghostturbo](../research/ghostturbo.md) - **Evidence (repository paths):** - Implemented in code (2026-11-15): `architecture/PATE_PHASE3_FAST_FINALITY.md` - Locally tested (2026-11-15): `audit/evidence/2026-11-15-pate-v3/README.md` - Deployed on testnet (2026-11-27): `audit/evidence/2026-11-27-chain-20778-launch/README.md` — chain 20778 launch record: live since 2026-11-27 21:47 UTC, first finalized checkpoint 64 at 22:03 UTC - Enabled on the running network (2026-11-27): `audit/evidence/2026-11-27-chain-20778-launch/README.md` — chain 20778 launch record: live since 2026-11-27 21:47 UTC, first finalized checkpoint 64 at 22:03 UTC - Enabled on the running network (2026-11-28): `audit/evidence/2026-11-28-active-features/README.md` — GT-01 signer gateway and GT-03 shadow-vote pull (CR-0138): ff_status provisional, shadow finalized ahead of real ### GhostShield v2 Smartnode sponsorship and payment assurance A Smartnode operator locks at least 32 tPQAI of collateral behind up to ten sponsored addresses; sponsored addresses become eligible for GhostTurbo, and assured sponsorships carry objective on-chain payment-assurance claims. - **Level:** Enabled on the running network - **Mode:** experimental - **Limits:** Native protocol state bound in the chain 20778 genesis profile (genesis v3, Core a679d60a1), with payment-assurance claims enabled from block 1. In use since 28 November 2026: one project Smartnode sponsors ten of the project's own addresses (3.2 tPQAI each); no claim has been filed yet. Not insurance: a claim pays only what the on-chain rules and the remaining collateral allow, and nothing is final before the finalized checkpoint. The public RPC does not serve the ghostshield_* methods; read them in the explorer or on your own node. The independent review is required before any mainnet. The separate Solidity Smartnode Warranty contract is not GhostShield and is not deployed. - **Docs:** [wallet/smartnode-warranty](../wallet/smartnode-warranty.md) - **Evidence (repository paths):** - Implemented in code (2026-11-27): `audit/evidence/2026-11-27-chain-20778-launch/README.md` — GhostShield v2 in Core a679d60a1, bound in the genesis-v3 profile - Locally tested (2026-11-27): `audit/evidence/2026-11-27-chain-20778-launch/README.md` — GhostShield v2 devnet suites (58 tests incl. 25k random operations) and AI review fixes GS2-01..09 before the genesis cut - Deployed on testnet (2026-11-27): `audit/evidence/2026-11-27-chain-20778-launch/README.md` — chain 20778 launch with GhostShield v2 in the genesis - Enabled on the running network (2026-11-28): `audit/evidence/2026-11-28-active-features/README.md` — ghostshield_status active, claims block 1; ten assured sponsorships by Smartnode sn1; 0 claims, 0 faults ### GhostPulse adaptive network intelligence Advisory layer that watches node health, peers, congestion and CPU, GPU and memory use, and advises how a computer's resources are shared between the blockchain node, mining and AI work, always keeping block processing first. It never changes consensus, rewards or eligibility. - **Level:** Deployed on testnet - **Mode:** experimental - **Limits:** Experimental and node-local: the read-only ghostpulse_* health and advice methods run in PQWERAI Core on every chain 20778 node and answer only on the operator's own node (the public RPC refuses them); the resource governor is off by default, is not deployed, and its advice is not applied automatically. Scope approved by the owner on 25 November 2026 (AR-13): rewards are outside its scope and the issuance split (67/18/1/9/5 on 20778) is fixed. Its health scores are local observations and are never used to penalize a Smartnode. - **Docs:** [research](../research/index.md) - **Evidence (repository paths):** - Implemented in code (2026-11-27): `ghostpulse/governor.py` — advisory GhostPulse package; Core read-only ghostpulse_* methods per audit/AUDIT_CORE.md (2026-11-27) - Locally tested (2026-11-27): `ghostpulse/governor.py` — 62 unit tests of the advisory host package (CMP-GHOSTPULSE-HOST) - Deployed on testnet (2026-11-28): `audit/evidence/2026-11-28-active-features/README.md` — ghostpulse_status on the 20778 cores: circuit closed, 0 failures ### GhostDeploy universal node hosting standard (GDS-1) Open, permissionless standard and reference tool for deploying, running, monitoring, migrating and selling PQWERAI nodes on any infrastructure, with Cold Smartnodes whose owners keep their keys and funds. - **Level:** Deployed on testnet - **Mode:** experimental - **Limits:** Draft GDS-1 0.1.0 for public test network 20778. The optional HostingOperatorRegistry and HostingMarket contracts are deployed on 20778 (code equal to the build artifact, on-chain smoke test passed); they are experimental and not independently audited. Live installs on 20778 passed signed conformance runs on Docker Compose and systemd; no profile is supported (9 experimental, 4 unavailable). No release, binary or SDK package is published and the repository is not public. Testnet acceptance is not met: the 20778 validator set is rated critical (one operator and one provider hold all voting power), and no Cold Smartnode has been registered from a wallet yet. - **Docs:** — - **Evidence (repository paths):** - Implemented in code (2026-11-28): `scripts/website/data/ghostdeploy.json` — snapshot of the GhostDeploy reference repository (SPEC GDS-1 0.1.0-draft, reference tool, OpenAPI, profiles) - Locally tested (2026-11-28): `scripts/website/data/ghostdeploy.json` — docs/STATUS.md at GhostDeploy commit 7d80dca: unit/integration suites, SDKs against the real API server (Python 24/24, TypeScript 21/21) - Deployed on testnet (2026-11-28): `scripts/website/data/ghostdeploy.json` — GhostDeploy commit 7d80dca: contracts/deployments/20778/state.json (registry 0xe17A42D74cCa66da8459bC7D0627539a61b4C9C5, market 0x7cF3eD32b837051CA7Bd78e2b7eD53cd15260320, code verified, smoke test ok) and spec/evidence conformance reports (compose, systemd) ### AI market contracts (ModelRegistry, AIJobMarket escrow) Clients lock tPQAI in escrow, providers run the model off-chain, and payment is released only for accepted work. - **Level:** Deployed on testnet - **Limits:** ModelRegistry, AIJobMarket, OperatorDirectory and AIProviderRegistry were deployed on 20778 on 27 November 2026 at their reserved addresses. No AI provider or gateway runs on 20778 yet, so no job has been paid. There is no verification of inference results: a provider's signed receipt is a claim, not a computation proof, and disputes go to a single arbiter. Reputation and penalties are off-chain. Accepted jobs pay 88% to the provider and 4% each to gateway verification, the CPU pool and the Smartnode pool. Unaudited test-network contracts. - **Docs:** [ai](../ai/index.md), [getting-started/ai-provider](../getting-started/ai-provider.md), [ai/service-escrow](../ai/service-escrow.md), [ai/revenue-policy](../ai/revenue-policy.md) - **Evidence (repository paths):** - Implemented in code (2026-11-10): `audit/evidence/escrow-v3` - Locally tested (2026-11-05): `audit/evidence/escrow-v3/acceptance-report.json` - Deployed on testnet (2026-11-27): `audit/evidence/2026-11-27-chain-20778-launch/addresses-20778.json` — 24 contracts deployed on 20778 on 2026-11-27 (blocks 143-209), runtime verify PASS ### Same-model compute pools PCs that run the same model join a pool and add up their capacity. - **Level:** Deployed on testnet - **Limits:** The pool directory runs on chain 20778 since 28 November 2026 (public read API https://pools-testnet.pqwerai.com/v1/pools), with the official bonsai-2-community pool (every GPU backend admitted automatically, price 0) and a relay for PCs behind NAT. No member serves the pool yet, so no inference route through a pool is claimed. Membership alone does not provide an inference route. Independent multi-PC split acceptance and pooled on-chain settlement remain open; no on-chain membership bond. - **Docs:** [ai](../ai/index.md), [getting-started/model-pool](../getting-started/model-pool.md) - **Evidence (repository paths):** - Implemented in code (2026-11-14): `audit/evidence/model-pools-2026-11-14/README.md` - Locally tested (2026-11-14): `audit/evidence/model-pools-2026-11-14/real-meshllm-two-agents.out.txt` - Deployed on testnet (2026-11-28): `audit/evidence/2026-11-28-active-features/README.md` — directory, official pool and relay answering on 20778 ### GhostLLM inference runtimes Models run on provider hardware, outside consensus, through the GhostLLM runtime. - **Level:** Locally tested - **Limits:** Real IPFS downloads, cache repair, runtime inference and restart cancellation passed on one RTX 4060 Ti PC with wallet 0.8.21. An RTX 2070 timeout on another PC remains undiagnosed. Independent multi-operator inference is open; the second inference backend remains a separate loopback process with unauthenticated cluster mode off. - **Docs:** [ai/ghostllm-runtime](../ai/ghostllm-runtime.md) - **Evidence (repository paths):** - Implemented in code (2026-11-13): `ai/hardware/colibri.py` - Locally tested (2026-11-13): `audit/evidence/2026-11-13-colibri/verify-cuda-run1.json` - Locally tested (2026-11-14): `audit/evidence/model-pools-2026-11-14/real-meshllm-two-agents.out.txt` - Locally tested (2026-11-22): `audit/WALLET_0_8_21_RELEASE_2026-11-22.md` — Scoped documentation source/status review; no new full runtime acceptance ### QAI post-quantum test token (bonding curve) An experimental, valueless post-quantum test token whose holders sign with ML-DSA-65 keys; its economy is under redesign and the earlier tEUR curve and 120% stack stay on chain as legacy test contracts. - **Level:** Deployed on testnet - **Mode:** experimental - **Limits:** Experimental test asset with no monetary value; not money, not a stablecoin, not redeemable for real euros; no peg, floor or price promise. The founder holds none. The legacy curve, tEUR and 120% stack contracts were deployed on 20778 on 27 November 2026 as legacy test contracts under redesign: stack minting is paused, and buys on the bonding curve are paused since block 5,112 (28 November 2026, 2-of-3 governors); sells stay open. PQWERAI will not issue its own euro token, and external stablecoins (USDC, EURC) through a bridge are roadmap only (CR-0136). - **Docs:** [contracts/guides/qai-post-quantum](../contracts/guides/qai-post-quantum.md) - **Evidence (repository paths):** - Implemented in code (2026-11-12): `audit/QUANTUM_QAI_FEATURE_AUDIT.md` - Locally tested (2026-11-14): `audit/evidence/2026-11-14-qai-bonding-curve` - Deployed on testnet (2026-11-27): `audit/evidence/2026-11-27-chain-20778-launch/addresses-20778.json` — 24 contracts deployed on 20778 on 2026-11-27 (blocks 143-209), runtime verify PASS ### Quantum Reserve (2-of-3 ML-DSA-65 treasury) The 9% issuance share accrues to a genesis-pinned reserve whose spending needs two of three post-quantum approvals. - **Level:** Deployed on testnet - **Limits:** The reserve address 0xcebDE02DF19270F4E56423607806AAeC6561A945 is pinned in the 20778 genesis profile and receives the 9% share from the first epoch; the contract was deployed there in block 165. Spending needs two of three ML-DSA-65 approvals and is capped at 1% per day; the automatic rules are off. - **Docs:** [contracts/guides/qai-post-quantum](../contracts/guides/qai-post-quantum.md) - **Evidence (repository paths):** - Implemented in code (2026-11-13): `audit/QAI_RESERVE_ACCOUNTING_2026-11-13.md` - Locally tested (2026-11-13): `audit/evidence/2026-11-13-qai-reserve-dryrun/dryrun-report.json` - Deployed on testnet (2026-11-27): `audit/evidence/2026-11-27-chain-20778-launch/addresses-20778.json` — 24 contracts deployed on 20778 on 2026-11-27 (blocks 143-209), runtime verify PASS ### IPFS storage reward (ipfs-reward/v1, 5% of issuance) A 5% share of issuance, bound in the chain 20778 genesis and credited from block 1, for a pool that pays IPFS Kubo and Cluster operators for proven pinned content. - **Level:** Deployed on testnet - **Limits:** On 20778 the 5% share is bound in the genesis profile and credited from block 1 (the first settlement) to the pool address 0xf4286aEB5865B9Ea6d620595E9E72707B0134EB5, where the bonded v2 pool contract was deployed in block 143; no node needs a fork flag. No storage operator runs on 20778 yet, so nothing has been claimed. Public model downloading requires neither enrollment nor a bond. Access proofs do not prove unique physical storage. - **Docs:** [getting-started/ipfs-storage-reward](../getting-started/ipfs-storage-reward.md) - **Evidence (repository paths):** - Implemented in code (2026-11-16): `protocol/IPFS_REWARD_V1.md` - Locally tested (2026-11-16): `audit/evidence/2026-11-16-ipfs-reward/rehearsal-report.json` - Deployed on testnet (2026-11-27): `audit/evidence/2026-11-27-chain-20778-launch/README.md` — chain 20778 launch record: live since 2026-11-27 21:47 UTC, first finalized checkpoint 64 at 22:03 UTC ### IPFS reward v2 (bonded, slashable proof of access) Operators post a tPQAI bond, answer storage challenges every 192-block round and share that round's 5% fairly; missed proofs can be slashed. - **Level:** Deployed on testnet - **Limits:** The bonded v2 pool at 0xf4286aEB5865B9Ea6d620595E9E72707B0134EB5 receives the 5% share on 20778 from block 1; the contract was deployed there in block 143, so operators can bond, prove and claim. No operator has enrolled yet. Minimum identity bond 1 tPQAI plus a capacity bond. - **Docs:** [getting-started/ipfs-storage-reward](../getting-started/ipfs-storage-reward.md) - **Evidence (repository paths):** - Implemented in code (2026-11-18): `audit/evidence/2026-11-18-ipfs-reward-v2/README.md` - Locally tested (2026-11-18): `audit/evidence/2026-11-18-ipfs-reward-v2/python-tests.txt` - Deployed on testnet (2026-11-27): `audit/evidence/2026-11-27-chain-20778-launch/addresses-20778.json` — 24 contracts deployed on 20778 on 2026-11-27 (blocks 143-209), runtime verify PASS ### Public read-only explorer Blocks, transactions, issuance, validators and AI market events, read-only. - **Level:** Enabled on the running network - **Limits:** Explorer 0.11.0 serves chain 20778 with a fresh index and GhostShield v2 views since 28 November 2026. No source verification, internal transaction tracing or complete ERC-1155 decoding. A point-in-time check is not an uptime guarantee. - **Docs:** [explorer](../explorer/index.md) - **Evidence (repository paths):** - Implemented in code (2026-11-12): `explorer/pqwexplorer/web.py` - Locally tested (2026-11-12): `audit/evidence/explorer/reorg-acceptance.json` - Deployed on testnet (2026-11-28): `audit/evidence/2026-11-27-chain-20778-launch/README.md` — explorer 0.11.0 public on chain 20778 since about 07:10 UTC - Enabled on the running network (2026-11-28): `audit/evidence/2026-11-27-chain-20778-launch/README.md` — explorer 0.11.0 public on chain 20778 since about 07:10 UTC ### Automatic peer discovery A new node finds the network by itself through built-in seeds, a signed seed manifest and peer exchange. - **Level:** Locally tested - **Limits:** On 20778 the five project nodes run a static mesh, and the bootnode addresses of the five live nodes are recorded for wallets and new nodes. Automatic discovery is tested but not what the network relies on today. - **Docs:** [nodes/install](../nodes/install.md) - **Evidence (repository paths):** - Implemented in code (2026-11-13): `audit/evidence/2026-11-13-wallet-p2p-discovery/summary.json` - Locally tested (2026-11-13): `audit/evidence/2026-11-13-wallet-p2p-discovery/summary.json` ### Network Monitor internal agent (QL-007) A small local model (Qwen3-0.6B on the CPU) checks node health every two minutes and decides to do nothing, raise an alert or propose an operation to a human. - **Level:** Locally tested - **Mode:** tested; not yet running on public test network 20778 (live since 27 November 2026) - **Limits:** The agent is not running on 20778 yet; its 20778 configuration exists and redeployment is pending. Network operations remain proposals for a human. Discord reporting grants no control authority. No independent inference or multi-host bus acceptance. - **Docs:** [nodes/operations](../nodes/operations.md) - **Evidence (repository paths):** - Implemented in code (2026-11-18): `audit/evidence/2026-11-18-internal-agents-cr0072/README.md` - Locally tested (2026-11-18): `audit/evidence/2026-11-18-internal-agents-cr0072/eval-qwen3-0.6b.jsonl` ### Internal role agents QL-008 to QL-012 (Security, Economic, Compute Scheduler, Training Coordinator, Developer) Five more small local-model agents on the Network Monitor's guarded runtime: Security, Economic, Compute Scheduler, Training Coordinator and Developer. - **Level:** Locally tested - **Mode:** tested; not yet running on public test network 20778 (live since 27 November 2026) - **Limits:** The six-role supervisor is not running on 20778 yet; redeployment is pending. Model output is restricted to proposals, alerts or no-op and cannot trigger reserves, CI, routes, firewall changes or pinning. No live official-pool inference, paid job or independent security acceptance. - **Docs:** [nodes/operations](../nodes/operations.md) - **Evidence (repository paths):** - Implemented in code (2026-11-19): `audit/evidence/2026-11-19-role-agents-cr0085/README.md` - Locally tested (2026-11-19): `audit/evidence/2026-11-19-role-agents-cr0085/eval-qwen3-0.6b.jsonl` ### Ethereum ecosystem compatibility, phase 1: deployment proxy, Multicall3, Permit2, Wrapped tPQAI The contracts that Ethereum wallets, indexers and exchanges expect (deployment proxy, Multicall3, Permit2, Wrapped tPQAI), plus an exchange integration guide. - **Level:** Deployed on testnet - **Limits:** Deployed on 20778 on 27 November 2026 at the usual Ethereum addresses (deployment proxy, Multicall3, Permit2) and tWPQAI at 0xae14c8C74ff10F7fe43E7ADe4306E5257fdA02b4; tWPQAI has no owner, upgrade, pause or fee. There is no legacy WPQAI on 20778. This is not an exchange listing. Still missing: debug_trace/trace namespaces, and the EVM stops before Prague. - **Docs:** [contracts/guides/canonical-contracts](../contracts/guides/canonical-contracts.md), [nodes/exchange-integration](../nodes/exchange-integration.md) - **Evidence (repository paths):** - Implemented in code (2026-11-19): `contracts/canonical/WPQAI.sol` - Locally tested (2026-11-19): `audit/evidence/2026-11-19-eth-compat/devnet-407ad6305-result.json` - Deployed on testnet (2026-11-27): `audit/evidence/2026-11-27-chain-20778-launch/addresses-20778.json` — 24 contracts deployed on 20778 on 2026-11-27 (blocks 143-209), runtime verify PASS ### Genesis Program: Discord-verified Mainnet Joinlist and testnet tasks Sign in with Discord, join the Mainnet Joinlist, link a wallet by signature and record verified testnet tasks. - **Level:** Locally tested - **Mode:** tested; not yet running on public test network 20778 (live since 27 November 2026) - **Limits:** The service is tested and not yet running on 20778 (the GenesisBadge contract is deployed). Discord sign-in waits for its secret. Joinlist and points have no value or mainnet entitlement. - **Docs:** [getting-started/genesis-program](../getting-started/genesis-program.md) - **Evidence (repository paths):** - Implemented in code (2026-11-19): `genesis/README.md` - Locally tested (2026-11-19): `audit/evidence/2026-11-19-genesis-program/README.md` ### Public testnet launch (faucet, independent validators) Public test network 20778: a new genesis with eight validators, a faucet and public RPC. - **Level:** Deployed on testnet - **Limits:** Live since 27 November 2026 21:47 UTC, with a faucet and public RPC since 28 November 2026. All validators, miners and public services are run by the project; independently operated validators and an independent security review come next. tPQAI has no monetary value. - **Docs:** [resources/gaps](../resources/gaps.md) - **Evidence (repository paths):** - Implemented in code (2026-11-27): `audit/evidence/2026-11-27-chain-20778-launch/README.md` — chain 20778 launch record: live since 2026-11-27 21:47 UTC, first finalized checkpoint 64 at 22:03 UTC - Locally tested (2026-11-27): `audit/evidence/2026-11-27-chain-20778-launch/README.md` — chain 20778 launch record: live since 2026-11-27 21:47 UTC, first finalized checkpoint 64 at 22:03 UTC - Deployed on testnet (2026-11-27): `audit/evidence/2026-11-27-chain-20778-launch/README.md` — chain 20778 launch record: live since 2026-11-27 21:47 UTC, first finalized checkpoint 64 at 22:03 UTC ### Mainnet A production network with real value. - **Level:** Planned - **Limits:** Not scheduled. Requires audits, a genesis ceremony and an explicit launch decision. Mainnet rewards are not guaranteed. - **Docs:** [resources/gaps](../resources/gaps.md) - **Evidence (repository paths):** none — planned # Known gaps and limitations # Known gaps and limitations Reviewed **28 November 2026** for public testnet **20778** (live since 27 November 2026), against current source, the pre-launch audit and the launch record. The [current overview](current-status.md) links every topic; the [feature ledger](feature-status.md) tracks evidence levels. Levels earned before the chain 20778 launch do not carry over to chain 20778. | Area | Remaining limit | |---|---| | Network | Chain 20778 is live since 27 November 2026, 21:47 UTC. All eight Smartnode validators, the miners and the public services are run by the project, so the network is not yet decentralised; independent validators and mainnet are open | | Consensus rules | No longer node flags: on chain 20778 every former fork rule (registry top-up, stage-surround slashing fix, EIP-6780, WASM locals metering, GhostShield v2, IPFS share) is bound in the genesis profile and nodes pass none. Later rule changes would still be versioned future-height forks that every node must adopt | | Wallet | Wallet 0.9.1 for chain 20778 was published on 28 November 2026; its built-in official pool list for 20778 is not updated yet (a later build). Releases are unsigned and unaudited; no hardware-wallet acceptance | | Other wallet branches | Diagnostics, native signing/Discord and macOS are development branches | | Contracts | AI market, QAI/tEUR, tWPQAI, standard contracts (proxy, Multicall3, Permit2), the IPFS reward v2 pool and the Quantum Reserve were deployed on chain 20778 on 27 November 2026 (author verification, no independent audit). **Not deployed:** the Smartnode Warranty (its address stays reserved and unused) and RecurringPermissions (needs an independent audit) | | AI runtime | Independent heterogeneous GPU/CPU acceptance open | | Paid AI | Inference results are not verified on chain (the receipt is a provider-chosen hash; acceptance or dispute by the customer); a single arbiter resolves disputes; independent providers and complete UI acceptance remain open | | Model pools | Directory and relay live on 20778; the official pool `bonsai-2-community` was created on 28 November 2026 and has no members yet; independent split execution, multi-PC split acceptance, accountable contributions and pooled on-chain settlement open | | Free agents | Rules-only waiting for community inference capacity; guarded prototype is not live inference | | Distribution | Independent retention/CAR recovery, signed catalogs and no-GitHub bootstrap acceptance open | | IPFS rewards | The 5 % share is credited from block 1 and the v2 pool contract is deployed (block 143), but no storage operator runs on 20778 yet and nothing has been claimed; bonded proof of access is not proof of unique storage | | Explorer | Read-only Etherscan API; no contract source verification, internal transaction tracing or complete ERC-1155 decoding | | Supply | Total supply subtracts base-fee and observed slashing burn; compatibility circulating field is not free float | | RPC | No tracing/WebSocket subscriptions; safe/finalized proxy resolution is distinct from self-hosted Core behaviour. Recorded JSON-RPC examples were captured on the live 20778 network (2026-11-28) | | Contract languages | Seven Studio languages and supported WASM subsets; no independent toolchain/VM audit; Fe pre-1.0 upstream; the WASM locals-memory metering fix (CR-0035) cannot yet be switched on in production | | SDKs | No official SDK; unexecuted Hardhat/Remix/ethers/viem/web3.py examples remain NOT RUN; scripted examples were run before the chain 20778 launch and still need a re-run on 20778 | | QAI / Reserve | Post-quantum account authorization, classical gas/votes/P2P; valueless tQAI/tEUR; contracts deployed on 20778; legacy bonding-curve buys paused since block 5,112 (sells open); tEUR, the curve and the 120% stack are legacy and the economy is under redesign; Reserve auto policy off | | Finality | Smartnode BFT checkpoint finality has run on 20778 since the launch (first finalized checkpoint 64 at 22:03 UTC on 27 November 2026). A validator silent for 12 checkpoints is force-exited; with the 50/50 stake split this needs a launch rehearsal. Issuance is credited only for epochs with validator vote participation. Independent consensus/security audit and operator acceptance missing | | GhostFlow | Experimental and node-local: measured 1.3–1.6× execution speed-up only at ≥ 512 transactions per block in a single-process benchmark; no network throughput figure is claimed | | GhostTurbo | Shadow mode only: the provisional fast-finality signal is never consensus finality. Since 28 November 2026 the 8 signers post shadow votes through the allowlisted signer gateway, and the provisional shadow checkpoint runs ahead of the real finalized checkpoint; it is always provisional, only the real checkpoint is final and consensus is unchanged; no latency figure is claimed. The public RPC serves `ff_status`, `ff_votes` and `ghostturbo_status`. Real fast finality would be a consensus fork that is not built | | GhostPulse | Read-only `ghostpulse_*` methods run on every 20778 core; advisory and node-local, not on the public RPC; governor not deployed; it never changes consensus | | GhostShield | v2 (32 tPQAI collateral, up to 10 sponsored addresses, GhostTurbo eligibility, payment-assurance claims from block 1) is bound in the chain 20778 genesis and active (1 collateral record, 10 assured sponsorships, 0 claims so far); the independent review is pending before mainnet, and GhostShield is not insurance. The public RPC does not serve `ghostshield_*` methods (use the explorer or your own node). The separate Smartnode Warranty contract is not GhostShield and is not deployed | | Genesis Program | GenesisBadge contract deployed; the programme service is not running on 20778 yet; joinlist/points give no mainnet allocation or entitlement | | Documentation | Private source/edit links require repository access. No external accessibility audit or full new runtime acceptance implied by docs checks | No local test, documentation refresh or software prerelease closes the strategic release gates automatically. # Source provenance # Source provenance ## Pipeline ```mermaid flowchart LR A[Core sourcemethod signatures] --> I[rpc_inventory.py] L[Live local node] --> I I --> R[rpc-methods.json] O[explorer/openapi.yaml] --> C[explorer_contract_test.py] X[Live explorer index] --> C N[network.json] --> G[gen_reference.py] R --> G O --> G G --> D[developers/docsgenerated pages] E[developers/examples] --> H[run_examples.shon local testnet] E --> M[MkDocs build+ devhub hook] D --> M P[authored pagesclassification: public] --> M M --> K[check_docs.pylinks · secrets · policy] K --> S[(Published site+ provenance.json)] ``` - **Allowlist:** `developers/SOURCE_MANIFEST.json` lists the only repository paths that may feed the site; private directories are explicitly excluded. - **Classification gate:** the build fails if any page lacks `classification: public` or a valid status. - **Secret gate:** the built site is scanned for private keys, tokens, private paths, non-documentation IP addresses and a hashed deny-list of sensitive values (the values themselves are never committed). - **Freshness gates:** generated pages must equal what the current inputs produce; RPC method references, compiler versions, chain parameters and economic statements are checked against their sources. - **Identity:** every page footer and `/provenance.json` name the exact source commit and build version. ## Latest results (2026-11-07) | Check | Result | |---|---| | RPC inventory: source methods registered on live node | PASS 72/72; 9 absent namespaces confirmed `-32601` | | Explorer contract test (static + live) | PASS 35/35 | | Tutorial journeys on local testnet | PASS 19/19 steps in 11 journeys (below) | | Documentation build (`mkdocs build --strict`) and `check_docs.py` | PASS 11/11 gate checks | | Unit tests (`tests/test_devhub.py`) | PASS 10/10 | | Ethers.js, viem, web3.py, Hardhat, Remix examples | NOT RUN (dependencies not installed) | | Journey | Steps | Result | |---|---|---| | Blockchain quickstart (incl. waiting for BFT finality) | 6 | PASS | | Raw JSON-RPC with curl | 1 | PASS | | Python opcode probe | 1 | PASS | | First smart contract (build, deploy, verify, interact) | 4 | PASS | | ERC-20 token | 1 | PASS | | ERC-721 and ERC-1155 | 1 | PASS | | Access control, events, payable, libraries (TipJar) | 1 | PASS | | Five-language Counter (Solidity, Vyper, Yul, Huff, Fe) | 1 | PASS | | AI escrow (quote, fund, propose, accept, finalize, withdraw, refund) | 1 | PASS | | Mining rewards counters | 1 | PASS | | Smartnode key generation and registry reads | 1 | PASS | Not executed against the chain for this release: Smartnode registration, delegation and exit (would change the shared validator set). Raw results and logs: `audit/evidence/devhub/` in the repository. # Documentation versions # Documentation versions | Version | URL path | Covers | Search index | |---|---|---|---| | **testnet-20778** (current, alias `latest`) | `/testnet-20778/` | Public test network 20778, protocol `pqwerai-v8-testnet/1` | Own index, this version only | | dev | built on request | Unreleased branches (e.g. diagnostics, native Discord signing, macOS); released Studio/WASM guides remain current | Separate, never aliased to latest | | Archived versions | `//` | Rebuilt from their release tag when a newer testnet ships | Own index | | Mainnet | — | Not authorized; published only after an explicit owner decision | — | The version selector in the header lists the published versions (`/versions.json`). Each version is built from one source commit; the commit and build version are printed in the header banner and in `/provenance.json`. # Smartnodes and Finality # Smartnodes and Finality Smartnodes are validators registered on chain with stake. Each 32-block epoch they sign the checkpoint link chosen by the Casper-FFG voting rule; a link signed by **more than 2/3 of the epoch set's effective stake** justifies the target, and justification of the next checkpoint finalizes it. Nodes never reorganise below the finalized checkpoint. | Topic | Page | |---|---| | Run a validator | [Set up a Smartnode](../getting-started/smartnode.md) | | Register, top up, delegate, claim, rotate, exit, withdraw, slash | [Registry operations](registry-operations.md) | | Votes, certificates, evidence, guarantees | [BFT finality](finality.md) | | What applications should wait for | [Finality for applications](../blockchain/finality.md) | !!! note "What finality does and does not claim" Finality on testnet 20778 is an FFG-style checkpoint protocol over a registry-derived validator set with signature-verified votes and slashable equivocation. It has passed the project's local adversarial tests; it has **not** had an independent consensus/security audit, which remains a requirement before any public launch. # BFT finality # BFT finality | Parameter | Value | |---|---| | Epoch / checkpoint spacing | 32 blocks | | Quorum | strictly more than 2/3 of the epoch set's effective stake | | Minimum genesis validators | 4 | | Max link span | 4096 blocks | | Vote transport | signed votes over authenticated JSON-RPC (`g4_submitVote`); certificates travel in blocks over devp2p | ## Flow ```mermaid sequenceDiagram participant S as Validator signer participant N as Own node participant C as Chain S->>N: g4_link (source = justified, target = latest checkpoint) N-->>S: RLP vote context S->>S: journal check (no double / surround vote), fsync S->>N: g4_submitVote(context, signed vote) N->>N: verify signature vs epoch set, reject stale / replayed N->>C: certificate transaction once > 2/3 stake signed C-->>C: justify target, finalize source ``` ## Safety mechanisms - **Signer journal:** persistent, fsync before releasing a vote, refuses double votes (same target height, different hash) and surround votes, anchored against stale backups. Never restore it from an old backup. - **Equivocation evidence:** a node that sees two conflicting votes from one validator records them (`g4_evidence`) and relays a slashing transaction; 25 % of the validator's stake is burned. - **Vote flood resistance:** forged, malformed, stale and replayed submissions are rejected and counted (`g4_status.vote_counters`); rejected traffic cannot crowd out valid votes. ## Liveness With less than 2/3 of stake online, PoW block production continues but finality stalls. The candidate `liveness/v1` genesis profile (experimental; active on the local testnet) adds a duty window for late certificates and force-exits validators that carry no vote for K consecutive checkpoints (not slashed); `g4_status` then reports `liveness_ejected_validators` and `liveness_participation_records`. # Smartnode registry operations # Registry operations Registry operations are ordinary transactions sent to the registry system account `keccak256('PQAI/private/G4/registry/v1')[12:]`, each with gas limit 150,000. Use `pqwerai-cli`, `pqwerai-wallet-cli` or the Windows Wallet; the calldata format is internal and byte-identical between the Go and C# tools. | Op | Code | Command | Rules | |---|---|---|---| | Register | 1 | `sn-register -from -keyfile sn-key.json -stake ` | Proof of possession binds key, owner, chain ID, genesis. Min 1 tPQAI. Activates after 2 epochs | | Top up | 2 | `sn-topup -from -id -amount ` | Effective stake capped at 2048 tPQAI | | Delegate | 3 | `sn-delegate -from -id -amount ` | Min 0.001 tPQAI | | Undelegate | 4 | `sn-undelegate -from -id -amount ` | | | Claim | 5 | `sn-claim -from -id ` | Withdraw accrued validator rewards | | Rotate key | 6 | `sn-rotate -from -id -keyfile new.json` | Restart the signer with the new key | | Exit | 7 | `sn-exit -from -id ` | Leaves the set at its exit epoch | | Withdraw | 8 | `sn-withdraw -from -id ` | After 4 unbonding epochs **and** finality of the withdrawable epoch | | Slash | 9 | `sn-slash -from -vote-a -vote-b ` | Double or surround vote evidence; burns 25 % of stake | Read-only views: `pqwerai-cli sn-validators`, `sn-status`, or [`g4_validators`](../reference/json-rpc/g4.md#g4_validators) and [`g4_status`](../reference/json-rpc/g4.md#g4_status). Limits: at most 64 validators in an epoch set and 256 registered; evidence is accepted within 3 epochs. # Wallets and SDKs # Wallets, SDKs and tools !!! note "Official vs. compatible" PQWERAI publishes **no official JavaScript, TypeScript or Python SDK**. The official tools are the Windows Wallet, `pqwerai-cli`/`pqwerai-wallet-cli` and the node. Everything else is standard Ethereum tooling that works because PQWERAI speaks Ethereum JSON-RPC. Filter tools | Tool | Kind | Status for this release | Use for | |---|---|---|---| | [PQWERAI Windows Wallet](windows-wallet.md) | Official desktop wallet with the native Windows node | Wallet 0.9.1 for chain 20778 published 28 November 2026; earlier pre-releases (not code-signed) cannot join 20778. Last recorded release run (0.8.21): 459 wallet tests passed / 97 skips; packaged UI 19 passed / 1 skip; local CI 28/28 | Accounts, transfers, tokens, Studio deploys, own node, mining, Smartnodes, AI sharing | | [Wallet AI gateway for VS Code](vscode-ai.md) | Local OpenAI-compatible endpoint (wallet) | Experimental (CR-0089): unit, live local-model and one live paid testnet answer | Continue, Cline, Roo Code, OpenAI SDKs; choose this PC, the network, a pool or a provider | | [pqwerai-cli / pqwerai-wallet-cli](core-cli.md) | Official CLI | ✅ Tested (keygen, registry reads); parity 21/21 | Scripts, Smartnode operations, backups | | [Foundry 1.8.5](foundry.md) | Contract toolchain + CLI | ✅ Every tutorial executed with it | Compile, deploy, test, `cast` RPC calls (TypeScript-free) | | [Hardhat](hardhat.md) | JS/TS contract toolchain | Configuration documented, **not executed** | TypeScript projects, plugins | | [Remix](remix.md) | Browser IDE | Configuration documented, **not executed** | Learning, quick experiments | | [ethers.js v6](ethers.md) | TS/JS library | Example **not executed** | Frontends, Node.js backends | | [viem 2](viem.md) | TS library | Example **not executed** | Typed frontends | | [web3.py 7](web3py.md) | Python library | Example **not executed** | Python backends, data jobs | | Python standard library | — | ✅ [Opcode probe](../blockchain/evm-compatibility.md#probe-a-node-yourself) executed | Minimal JSON-RPC clients | | [Explorer API](../explorer/index.md) | REST | ✅ Contract-tested | Indexed history, issuance, validators | | [Contract verification](../contracts/verification.md) | Procedure | ✅ Tested | Proving deployed bytecode | "Not executed" means the configuration is written from the chain's verified parameters, but the dependency was not installed and run for this release (no new downloads were authorized). See [Known gaps](../resources/gaps.md). ## Chain configuration for any tool | Setting | Value | |---|---| | Chain ID | `20778` (`0x512a`) | | Currency | tPQAI, 18 decimals | | RPC | your node, e.g. `http://127.0.0.1:8545` | | EVM target | `cancun` (no blob opcodes) or `london` | | Finality | `g4_status.finalized_height`; the `finalized` tag works on the public RPC only | # Core CLI and flags # Core CLI and configuration flags Extracted from the Core release for public testnet 20778 (`pqwerai-v8-0.1.0-public-testnet (chain 20778)`, source `a679d60a11e6`). `pqwerai-core` is the node; `pqwerai-cli` is the command-line wallet and Smartnode tool (the Windows Wallet ships the equivalent `pqwerai-wallet-cli`). !!! note "Quoted Core help text" Flag descriptions are quoted from the Core source, with engine names shown as GhostFlow (parallel execution) and GhostTurbo (adaptive trust execution and shadow fast finality) and notes about earlier networks left out; flag names are unchanged. Where they say `PQAI`, the test-network unit is **tPQAI**. Chain 20778 is the current public testnet. !!! note "No rule or fork flags on chain 20778" Chain 20778 binds every former fork rule in its genesis profile (genesis `0xe7c41635…3db6`): registry top-up, registry stage-surround, EIP-6780 and WASM locals metering at block 0, GhostShield v2 at block 0 with payment-assurance claims from block 1, and the IPFS storage reward from block 1. Nodes pass none of the `HARD FORK` node flags below; Core refuses a conflicting value. The `genesis` flags record how that genesis was cut; the help text of `--ghostshield-claims-block` predates the owner decision of 27 November 2026 that switched claims on from block 1. ## `pqwerai-core` node flags | Flag | Type | Default | Description | |---|---|---|---| | `--datadir` | string | — | database directory (required) | | `--genesis` | string | — | private-testnet genesis.json (required) | | `--helper` | string | — | GhostRider hash helper path (required) | | `--helper-sha256` | string | — | GhostRider hash helper SHA-256 (required) | | `--difficulty` | uint64 | `16` | fixed private-testnet base difficulty; must match genesis | | `--port` | int | `0` | P2P TCP port (0 = random) | | `--p2p.addr` | string | — | P2P listener literal IP (empty = all interfaces; use 127.0.0.1 for isolated tests) | | `--rpc.addr` | string | `127.0.0.1` | JSON-RPC bind address | | `--rpc.port` | int | `8545` | JSON-RPC port | | `--rpc.token-file` | string | — | file containing a bearer token; REQUIRED for non-loopback RPC | | `--peers` | string | — | comma separated enode URLs to connect to | | `--mine` | bool | `false` | mine GhostRider blocks | | `--miner.threads` | int | `1` | local: parallel GhostRider helper processes used for mining (1..256; no consensus effect) | | `--miner.external` | bool | `false` | publish authenticated G1 jobs for an explicitly started external miner; requires `--mine` | | `--etherbase` | string | — | mining reward address | | `--pase-workers` | int | `0` | experimental GhostFlow workers (0 = canonical serial, the default) | | `--pase-general` | bool | `false` | experimental: GhostFlow also executes contract blocks with read/write-set speculation (needs `-pase-workers`; same result as serial) | | `--pase-profile` | string | — | general GhostFlow profile: plain (default) or cost-aware (a local cost model chooses serial or parallel per batch; merge preload; same result as serial; needs `--pase-general`) | | `--pate` | bool | `envBool("PATE_ENABLED")` | GhostTurbo adaptive trust scheduling for GhostFlow: node-local and advisory, consensus unchanged (needs `--pase-workers` and `--pase-general`; default from env `PATE_ENABLED`, off) | | `--ff.shadow` | bool | `envBool("FF_SHADOW")` | GhostTurbo phase 3 shadow fast finality: collect shadow checkpoint votes and report provisional ffg/fast-v1 finality (ff_* RPC); node-local measurement, consensus unchanged (needs the G4 registry; default from env `FF_SHADOW`, off) | | `--ff.interval` | uint64 | `8` | shadow checkpoint interval in blocks (4, 8 or 16) | | `--ff.depth` | uint64 | `2` | blocks on top of a shadow checkpoint before validators vote on it | | `--ff.sources` | string | — | comma separated node RPC URLs to pull shadow votes from (ff_votes) | | `--pate.state` | string | — | GhostTurbo trust-state snapshot file (default datadir/pqwerai-pate.json) | | `--g4-relayer-key` | string | — | secp256k1 key file of a funded disposable test account that relays finality certificates | | `--verbosity` | int | `3` | log level 0-5 | | `--shutdown-on-stdin-close` | bool | `false` | managed process: stop gracefully when the parent closes stdin | | `--expect-genesis-hash` | string | — | refuse to start unless the genesis block hash equals this value | | `--maxpeers` | int | `16` | maximum P2P peers | | `--p2p.target` | int | `8` | keep at least this many peer connections when candidates exist ( | | `--rpc.logs-max-range` | uint64 | `5000` | maximum block range of one eth_getLogs request | | `--rpc.allow-unprotected-txs` | bool | `false` | accept transactions without EIP-155 replay protection over RPC (only for submitting keyless canonical deployments such as Multicall3; block validation is unchanged) | | `--miner.gasceil` | uint64 | `0` | block gas limit this miner targets (0 = keep the genesis gas limit) | | `--miner.ghostturbo-priority` | bool | `true` | local policy (GhostTurbo T2): order the transactions of GhostShield v2 GhostTurbo-eligible senders first (no fee or validity change; no consensus effect) | | `--miner.ghostturbo-reserve` | uint64 | `50` | local policy: percent of each block's gas kept for ordinary transactions when GhostTurbo priority is on (0..100) | | `--miner.certificate-hold` | duration | `8s` | local policy: max wait after a finality checkpoint for its certificate before sealing (0 = off) | | `--eip6780-block` | int64 | `-1` | HARD FORK: activate EIP-6780 (SELFDESTRUCT only deletes contracts created in the same transaction) at this block; every node must use the same value (-1 = not scheduled) | | `--ghostpulse` | bool | `true` | GhostPulse local telemetry and health (ghostpulse_* RPC); advisory only, never affects consensus | | `--ghostpulse.interval` | duration | `10s` | GhostPulse sampling interval (>= 1s) | | `--ghostpulse.metrics` | string | — | GhostPulse Prometheus endpoint address, e.g. 127.0.0.1:6061 (empty = off); serves /metrics and /healthz | | `--ghostshield-block` | int64 | `-1` | REMOVED: ghostshield-guarantee/v1 was never activated on any network and has been deleted; GhostShield v2 is bound by the genesis profile. Any value other than -1 is refused | | `--registry-stage-surround-block` | int64 | `-1` | HARD FORK registry-stage-surround/v1: from this block surround-vote slashing evidence must have one vote stage (closes G4-SLASHING-STAGE-BLIND-SURROUND); every node must use the same value (-1 = not scheduled); chain 20778 binds it in the genesis profile and refuses a conflicting value | | `--registry-topup-block` | int64 | `-1` | HARD FORK registry-topup/v1: from this block a Smartnode top-up credits the validator stake (before it every top-up reverts); every node must use the same value (-1 = not scheduled); chain 20778 binds it in the genesis profile and refuses a conflicting value | | `--wasm-locals-metering-block` | int64 | `-1` | HARD FORK wasm-vm/v1 locals metering (CR-0035): WASM contracts deployed from this block charge every declared local at function entry; inactive unless set; every node must use the same value (-1 = not scheduled); chain 20778 binds it in the genesis profile and refuses a conflicting value | | `--ipfs-reward-block` | int64 | `-1` | HARD FORK ipfs-reward/v1: from this block 5% of each epoch's issuance goes to the IPFS reward pool, out of the PoW share (67/18/1/9/5); needs `--ipfs-reward-pool` and the 72/18/1/9 profile; every node must use the same values (-1 = not scheduled); refused on chain 20778 (genesis profile only) | | `--ipfs-reward-pool` | string | — | ipfs-reward/v1: IPFS storage reward pool contract address (with `--ipfs-reward-block`) | | `--ipfs-reward-redirect` | string | — | HARD FORK ipfs-reward/v2: :[,...] - from each block the IPFS share is credited to that pool (e.g. IPFSRewardPoolV2); share unchanged; needs `--ipfs-reward-block`; every node must use the same values; refused on chain 20778 and with a genesis-bound ipfs-reward | | `--finality-reanchor-block` | int64 | `-1` | HARD FORK finality-reanchor/v1: the child of this checkpoint (a multiple of 32) re-justifies it when finality has halted below it, so validators can certify again; finalizes nothing by itself; needs the finality profile; every node must use the same value (-1 = not scheduled) | ## `pqwerai-core genesis` flags (network creation) | Flag | Type | Default | Description | |---|---|---|---| | `--helper` | string | — | GhostRider hash helper path | | `--helper-sha256` | string | — | GhostRider hash helper SHA-256 | | `--difficulty` | uint64 | `16` | fixed private-testnet base difficulty | | `--out` | string | `genesis.json` | output file | | `--alloc` | string | — | comma separated 0xADDRESS=PQAI whole-coin test allocations | | `--validators` | string | — | JSON validator list; enables the private registry + FFG finality profile | | `--duty-window` | uint64 | `0` | CANDIDATE liveness/v1: certificate duty-credit window in blocks (0 = legacy; consensus rule) | | `--wasm-block` | int64 | `-1` | Official wasm-vm/v1: activation block (-1 = unscheduled; genesis-bound consensus rule; existing network schedules unchanged) | | `--pq-verify-block` | int64 | `-1` | pq-verify/v1: ML-DSA-65/SLH-DSA verification precompile activation block (-1 = unscheduled; genesis-bound consensus rule; fixture 1337 any block) | | `--daa-easing` | bool | `false` | CANDIDATE daa/easing-v2: extra difficulty halving per further 8 s of block gap (consensus rule; registry profile) | | `--inactivity-epochs` | uint64 | `0` | CANDIDATE liveness/v1: force-exit registry validators unseen for N checkpoints (0 = off; consensus rule) | | `--founder` | string | — | public founder address receiving 1% of new issuance; registry profile only | | `--reserve` | string | — | Quantum Reserve contract address receiving 9% of new issuance (72/18/1/9); requires `--founder` | | `--timestamp` | uint64 | `uint64(time.Now().Unix()-3600)` | genesis timestamp | | `--chain-id` | uint64 | `ethash.DevFixtureChainID` | private testnet chain ID (1337 disposable fixture, 20778 public testnet) | | `--gas-limit` | uint64 | `15000000` | genesis block gas limit | | `--registry-topup-block` | int64 | `-1` | genesis-bound registry-topup/v1 activation block (-1 = not bound; chain 20778 requires 0) | | `--registry-stage-surround-block` | int64 | `-1` | genesis-bound registry-stage-surround/v1 activation block (-1 = not bound; chain 20778 requires 0) | | `--eip6780-block` | int64 | `-1` | genesis-bound EIP-6780 activation block (-1 = not bound; chain 20778 requires 0) | | `--wasm-locals-metering-block` | int64 | `-1` | genesis-bound wasm-vm/v1 locals metering (CR-0035) activation block (-1 = not bound; chain 20778 requires it equal to `--wasm-block` when WASM is enabled) | | `--ghostshield-block` | int64 | `-1` | genesis-bound GhostShield v2 (ghostshield-guarantee/v2) with the owner-approved parameters: 0 = active from genesis (-1 = not bound; chain 20778 requires 0) | | `--ghostshield-claims-block` | int64 | `-1` | GhostShield v2 payment-assurance claims activation block, >= 1 (-1 = claims disabled; needs `--ghostshield-block`; 20778 launches with claims disabled until the independent review) | | `--ipfs-reward-block` | int64 | `-1` | genesis-bound ipfs-reward/v1 activation block, >= 1 (-1 = not bound; needs `--ipfs-reward-pool`) | | `--ipfs-reward-pool` | string | — | genesis-bound ipfs-reward/v1 pool contract address: the CREATE address of `--ipfs-reward-pool-deployer` at `--ipfs-reward-pool-nonce` | | `--ipfs-reward-pool-deployer` | string | — | account that will deploy the IPFS reward pool after genesis; the pool address must equal CREATE(deployer, nonce) (required on 20778) | | `--ipfs-reward-pool-nonce` | uint64 | `0` | deployer nonce of the IPFS reward pool deployment transaction | ## `pqwerai-cli` global flags | Flag | Type | Default | Description | |---|---|---|---| | `-rpc` | string | `http://127.0.0.1:8545` (env `PQWERAI_RPC`) | node JSON-RPC URL | | `-token-file` | string | env `PQWERAI_RPC_TOKEN_FILE` | RPC bearer token file | | `-keystore` | string | `pqwerai-keystore` (env `PQWERAI_KEYSTORE`) | keystore directory | | `-password-file` | string | env `PQWERAI_PASSWORD_FILE` | password file (else first stdin line) | | `-keyfile-password-file` | string | — | password file for the BFT key of sn-keygen/sn-register/sn-rotate (default: `-password-file`); keeps the account password out of a validator key handed to a signer host | | `-backup-password-file` | string | env `PQWERAI_BACKUP_PASSWORD_FILE` | backup passphrase file (encrypted backups) | | `-timeout` | duration | `60s` | operation timeout | ## `pqwerai-cli` commands `backup` `balance` `call` `deploy` `erc20-balance` `erc20-transfer` `erc721-owner` `erc721-transfer` `history` `import-key` `list` `new` `nonce` `read` `restore` `send` `sn-claim` `sn-delegate` `sn-exit` `sn-keygen` `sn-register` `sn-rotate` `sn-slash` `sn-status` `sn-topup` `sn-undelegate` `sn-validators` `sn-withdraw` `status` `tx` `verify-backup` Transaction and Smartnode commands accept: | Flag | Description | |---|---| | `-from` | sender | | `-to` | recipient / contract | | `-amount` | PQAI (or token units for erc20) | | `-code` | contract creation bytecode hex file | | `-data` | calldata hex | | `-token` | token contract | | `-id` | token id or validator id | | `-keyfile` | BFT key file | | `-vote-a` | signed vote hex (sn-slash) | | `-vote-b` | signed vote hex (sn-slash) | | `-stake` | stake in PQAI | | `-owner` | owner | | `-encrypt` | seal the whole backup with the backup passphrase | | `-out` | output key file | !!! warning "Secrets" Pass passwords with `-password-file` (mode 0600) or stdin, never as arguments. Keep mining payout keys and validator keys off shared servers. # ethers.js # ethers.js v6 !!! warning "Not executed for this release" Pin the version you test (e.g. `npm install ethers@6.13.4 --save-exact`). The JSON-RPC behaviour it relies on is verified in the [reference](../reference/json-rpc/index.md). ```ts title="pqwerai.ts" import { JsonRpcProvider, Wallet, Contract, parseEther } from "ethers"; const provider = new JsonRpcProvider(process.env.PQWERAI_RPC ?? "http://127.0.0.1:8545", 20778, { staticNetwork: true }); if ((await provider.getNetwork()).chainId !== 20778n) throw new Error("not PQWERAI testnet"); console.log("head", await provider.getBlockNumber()); // Load an encrypted keystore (never a raw key in source code) const wallet = (await Wallet.fromEncryptedJson(keystoreJson, password)).connect(provider); const tx = await wallet.sendTransaction({ to: "0x000000000000000000000000000000000000dEaD", value: parseEther("0.01") }); const receipt = await tx.wait(); // PQWERAI finality (do not use provider.getBlock("finalized"): it errors on PQWERAI) async function isFinal(blockNumber: number, blockHash: string) { const s = await provider.send("g4_status", []); return s.finalized_height >= blockNumber && (await provider.getBlock(blockNumber))?.hash === blockHash; } const counter = new Contract(address, ["function get() view returns (uint256)", "function increment()"], wallet); await (await counter.increment()).wait(); console.log(await counter.get()); ``` - `staticNetwork: true` avoids repeated `eth_chainId` polling. - Event subscriptions use polling (HTTP only); keep ranges within 5000 blocks. # Foundry # Foundry Foundry 1.8.5 is the reference toolchain for this documentation: every Getting Started journey is executed with it. ```bash curl -L https://foundry.paradigm.xyz | bash foundryup --install 1.8.5 forge --version # forge Version: 1.8.5 ``` ```toml title="foundry.toml" --8 --ether --rpc-url "$RPC"` | | Send | `cast send --value 0.01ether --keystore … --password-file … --rpc-url "$RPC"` | | Deploy | `forge create src/C.sol:C --broadcast --keystore … --password-file … --rpc-url "$RPC" --constructor-args …` (constructor args **last**) | | Raw bytecode deploy | `cast send --async --create 0x` (options **before** `--create`) | | Call | `cast call "get()(uint256)" --rpc-url "$RPC"` | | PQWERAI finality | `cast rpc g4_status --rpc-url "$RPC"` | | Logs | `cast logs --from-block N --to-block M --address "Event(...)"` (≤ 5000 blocks) | Notes from testing: - `cast receipt status` prints `true`/`false`. - `forge` lint warnings (e.g. `reentrancy-events`) are advisory; the tutorials are written to avoid them. - Offline builds: `FOUNDRY_OFFLINE=true FOUNDRY_SOLC=/path/to/solc-0.8.26`. - `forge script --broadcast` works like on any EVM chain; set `--chain-id 20778` if you sign offline. - `forge verify-contract` is not supported. The explorer's [Etherscan-compatible API](../explorer/etherscan.md) serves lookups only (`[etherscan]` entry for chain 20778 on that page); use [byte-for-byte verification](../contracts/verification.md). # Hardhat # Hardhat !!! warning "Not executed for this release" This configuration is derived from the verified chain parameters but was not run (Hardhat was not installed on the test machine). Report problems with the link at the bottom of the page. ```ts title="hardhat.config.ts" import type { HardhatUserConfig } from "hardhat/config"; import "@nomicfoundation/hardhat-toolbox"; const config: HardhatUserConfig = { solidity: { version: "0.8.26", settings: { evmVersion: "cancun", optimizer: { enabled: true, runs: 200 }, metadata: { bytecodeHash: "none" } }, }, networks: { pqwerai: { url: process.env.PQWERAI_RPC ?? "http://127.0.0.1:8545", chainId: 20778, accounts: process.env.DEPLOYER_KEY ? [process.env.DEPLOYER_KEY] : [], // prefer a hardware wallet or keystore plugin }, }, }; export default config; ``` ```bash npx hardhat compile npx hardhat run scripts/deploy.ts --network pqwerai ``` - Do not commit private keys or `.env` files; never reuse a mainnet key. - Hardhat's "finalized" helpers do not understand PQWERAI finality; check `g4_status` ([finality](../blockchain/finality.md)). - `npx hardhat verify` does not work: the explorer's [Etherscan-compatible API](../explorer/etherscan.md) serves lookups (`customChains` entry for chain 20778 on that page) but not source verification. Use [byte-for-byte verification](../contracts/verification.md). # MetaMask # MetaMask PQWERAI uses Ethereum accounts, 18-decimal tPQAI, signed Ethereum transactions and native EVM contracts. The local MetaMask relay supports the wallet-facing RPC flow without requiring a custom Authorization header. Core and the existing wallet/faucet gateway retain their bearer authentication. Actual MetaMask extension/mobile UI acceptance is **not executed**: no browser session was connected for this local verification. The executed RPC probe uses `eth-account` signatures and actual PQWERAI nodes. ## Public test network 20778 Open [pqwerai.com/start](https://pqwerai.com/start/#add-wallet) and press **Add network** (CR-0094). tWPQAI is deployed on chain 20778 at `0xae14c8C74ff10F7fe43E7ADe4306E5257fdA02b4`; the **Add tWPQAI token** button appears when the page lists it. The buttons use the standard EIP-3085, EIP-747 and EIP-6963 requests, so MetaMask, Rabby, Coinbase Wallet, Brave and most other EVM browser wallets show their own confirmation; the page never sees keys. The same settings by hand: | Field | Value | |---|---| | Network name | PQWERAI Testnet 20778 | | RPC URL | `https://rpc-testnet.pqwerai.com` (serves chain 20778 since 28 November 2026) | | Chain ID | `20778` (`0x512a`) | | Currency symbol | tPQAI (18 decimals) | | Block explorer | `https://explorer.pqwerai.com` | !!! note "Add a new network entry" Chain 20778 has its own chain ID and genesis. Add it as a new network entry. Testnet coins carry a "t" (CR-0103): the currency symbol is **tPQAI**. tWPQAI (Wrapped tPQAI, 18 decimals) was deployed on chain 20778 on 27 November 2026 at `0xae14c8C74ff10F7fe43E7ADe4306E5257fdA02b4`; add it as a custom token by that address, and check that the token list at `https://pqwerai.com/tokenlist.json` names the same address before relying on it. On the public endpoints the `safe` and `finalized` block tags resolve to the Smartnode finalized checkpoint. A recovery phrase from MetaMask opens the same address in any EVM wallet because PQWERAI accounts are ordinary secp256k1 Ethereum accounts. Extension and mobile UI acceptance with a real MetaMask install is still open. ## Start the local connection Start an initialized disposable network using the integration controller (`testnet/integration/README.md` in the project repository, not public yet). Then run this command from the repository root in Linux/WSL: ```sh python3 pqwerai.py metamask-rpc --state /private/pqwerai/network-a --port 30600 ``` The relay binds only to `127.0.0.1`. Keep the terminal running while using it. It verifies the node's chain ID and genesis against the private runtime manifest before accepting connections. No node-held signing, admin, validator RPC or faucet is exposed through this endpoint. Only already-signed transactions can be submitted. Open `http://127.0.0.1:30600/chain.json` to see the actual parameters: | MetaMask field | Value | | --- | --- | | Network name | The generated local name containing the genesis prefix | | RPC URL | `http://127.0.0.1:30600` | | Chain ID | Use the returned `chainId`; the disposable fixture is `1337` / `0x539` | | Currency symbol | `tPQAI` | | Decimals | `18` | | Block explorer | Leave empty unless an actual matching explorer is running | In MetaMask, add a custom network using these values and fund a fresh test account through the fixture's existing authenticated faucet or CLI. The public testnet `20778` is a separate identity; this command does not activate or advertise it. MetaMask runs on the same computer for this loopback setup. On another computer or on mobile, `127.0.0.1` refers to that device. Remote operation needs a separately configured HTTPS/tunnel endpoint; this relay is not a public RPC deployment. ## Browser dapps and network switching When a browser sends an Origin header, permit its exact origin explicitly: ```sh python3 pqwerai.py metamask-rpc --state /private/pqwerai/network-a --port 30600 \ --allow-origin http://127.0.0.1:8000 ``` Repeat `--allow-origin` for each trusted dapp or extension origin. For an extension, use the exact `chrome-extension://` or `moz-extension://` reported by that browser. Wildcards are rejected. Origin-free background-wallet requests work without a custom bearer header; DNS-rebinding Host names are rejected. From a user click handler in the trusted local dapp, review the returned parameters, then request network addition and selection: ```javascript const configuration = await fetch('http://127.0.0.1:30600/chain.json') .then(response => response.json()); await window.ethereum.request({ method: 'wallet_addEthereumChain', params: [configuration], }); await window.ethereum.request({ method: 'wallet_switchEthereumChain', params: [{ chainId: configuration.chainId }], }); ``` These are wallet methods; they are handled by MetaMask, not forwarded to Core. The relay does not serve `personal_sign`, typed-data signing or `eth_sendTransaction`: it answers them with JSON-RPC error `-32601` (method unavailable at this gateway), because its allowlist forwards only read methods and `eth_sendRawTransaction`. Likewise, use the wallet provider for account access, `personal_sign`, typed-data signing and `eth_sendTransaction`. MetaMask signs locally and submits the signed transaction through `eth_sendRawTransaction`. ## Compatibility and diagnostics The relay supports bounded JSON-RPC batches, fee history, legacy gas price, EIP-1559 transactions, gas estimation, contract calls, ERC-20 metadata/logs and filter polling. It preserves bounded ABI revert bytes for wallet error decoding. Core's own gas cap applies; the relay does not inject the older gateway's five-million-gas estimate limit. The inherited Core endpoint does not populate beacon `safe`/`finalized` markers. This relay resolves both tags to the actual G4 finalized checkpoint, verifies its canonical height/hash, and queries that state. `safe` deliberately uses the same conservative checkpoint. Latest/pending requests keep their normal semantics. Use the reviewed Python environment containing `eth-account`, `eth-abi` and `eth-utils` to run the actual disposable RPC probe: ```sh python3 -m testnet.integration.metamask_probe \ --state /private/pqwerai/network-a --rpc http://127.0.0.1:30600 \ --output /private/pqwerai/fresh-wallet-probe ``` The probe sends test transactions and deploys retained test contracts. Its output must be new and outside Git. Native payments, token transfers, fee/gas methods, revert data and personal/EIP-712 signature recovery are checked against actual Core execution. A successful probe does not establish extension prompts, network switching UI, token import UI, hardware wallets, swaps or fiat-price integration. Each disposable genesis has its own history. Use an isolated test wallet/profile when changing fixtures; previously cached pending transactions can belong to a different history even when the fixture chain ID is the same. MetaMask's ordinary confirmation display is separate from PQWERAI's BFT acceptance evidence. Official wallet references: [add network](https://docs.metamask.io/metamask-connect/evm/reference/json-rpc-api/wallet_addEthereumChain/), [switch network](https://docs.metamask.io/metamask-connect/evm/reference/json-rpc-api/wallet_switchEthereumChain/), [watch an ERC-20 asset](https://docs.metamask.io/metamask-connect/evm/reference/json-rpc-api/wallet_watchAsset/). # Remix # Remix !!! warning "Not executed for this release" 1. Compiler: **0.8.26**, EVM version **cancun** (Advanced configurations), optimizer 200 runs. 2. Deploy & run → *Environment*: - **Injected Provider** with a browser wallet configured for chain ID 20778 and your node URL, or - **Custom – External HTTP Provider** pointing at your node. 3. PQWERAI Core sends no CORS headers, so a browser page cannot call a node directly unless you run a local proxy that adds them for `https://remix.ethereum.org`. Do not expose a node publicly to make Remix work. The provided [MetaMask loopback relay](metamask.md) supports explicit browser origins and signed-transaction submission; use the actual network parameters returned by its `/chain.json` endpoint. 4. To deploy with the PQWERAI Windows Wallet instead: compile in Remix, copy the compiled artifact JSON, and use **Studio → Paste from AI/file** — the wallet recognises Remix artifacts. # viem # viem 2 !!! warning "Not executed for this release" ```ts title="chain.ts" import { defineChain, createPublicClient, createWalletClient, http, parseEther } from "viem"; import { privateKeyToAccount } from "viem/accounts"; export const pqwerai = defineChain({ id: 20778, name: "PQWERAI Testnet", nativeCurrency: { name: "tPQAI", symbol: "tPQAI", decimals: 18 }, rpcUrls: { default: { http: [process.env.PQWERAI_RPC ?? "http://127.0.0.1:8545"] } }, testnet: true, }); const client = createPublicClient({ chain: pqwerai, transport: http() }); console.log(await client.getBlockNumber()); // PQWERAI finality comes from g4_status, not blockTag "finalized" const status = await client.request({ method: "g4_status" as any, params: [] as any }); const wallet = createWalletClient({ chain: pqwerai, transport: http(), account: privateKeyToAccount(process.env.KEY as `0x${string}`) }); const hash = await wallet.sendTransaction({ to: "0x000000000000000000000000000000000000dEaD", value: parseEther("0.01") }); await client.waitForTransactionReceipt({ hash }); ``` `blockTag: "finalized"` and `"safe"` work against the public RPC endpoints, which resolve both to the Smartnode finalized checkpoint. Against your own PQWERAI Core node they return `finalized block not found`; use `latest` and `g4_status` there. # Use PQWERAI AI from VS Code # Use PQWERAI AI from VS Code The Windows wallet runs a small **OpenAI-compatible endpoint on your own PC** (`http://127.0.0.1:9440/v1`). Editor extensions and scripts that speak the OpenAI API (Continue, Cline, Roo Code, the OpenAI Python/JS SDKs, `curl`) send their chat requests there, and the wallet forwards them to whoever you chose under **AI Sharing → Use AI**. !!! warning "Experimental, test network" This feature is part of wallet 0.9.0 for chain 20778 (published 28 November 2026); paid answers need the AI market, which is deployed on 20778, and a registered provider (none independent on 20778 yet). tPQAI has no value. Author review only, not independently audited. ## Why the wallet, and not Core or the explorer - **Core** (the blockchain node) validates blocks. It holds no keys, so it cannot pay a provider, and it has no AI methods (its only PQWERAI-specific RPC is `pqwerai_peerHealth`). - **The explorer** is public and read-only. It already lists pools (`GET /api/v1/pools`) but must never spend anyone's funds. - **The wallet** has your keys, knows the approved model, checks providers on chain and verifies every charge, so the AI endpoint lives there. It listens on `127.0.0.1` only. ## Who answers: the route | Route in the wallet | What happens | Cost | |---|---|---| | **The model on this PC** (default) | The request goes to the local GhostLLM runtime / llama-server endpoint of AI Sharing. Nothing leaves the PC. | Free | | **PQWERAI network: best provider** | Any provider approved on chain (`AIProviderRegistry.eligible`) for the approved model; eligible first, then price, then latency. | tPQAI per answer | | **A model pool** | Only providers whose wallet is a **ready or active member** of the chosen pool (pool directory), still checked on chain. A pool with no serving member answers nothing. | tPQAI per answer | | **One provider** | Exactly one provider address. | tPQAI per answer | The same route is used by **Ask the PQWERAI network** on the AI Sharing page. ## Paying without a prompt each time: the spending session A paid answer is three wallet transactions on AIJobMarket (fund the escrow, authorize the exact request hash, accept the verified charge). An editor cannot show the wallet's password dialog, so you approve a **spending session** once: - **Budget** (default 1 tPQAI), **maximum per answer** (default 0.1 tPQAI) and **length** (default 60 minutes, at most 24 hours). - For each answer the wallet reserves the quoted maximum, funds it, sends the request, checks the provider's on-chain charge against the answer it actually received and accepts **only a matching charge**; only the real charge counts against the budget. A charge that does not match is not accepted (you can dispute it under AI escrow) and its whole reservation stays counted. - The session ends at the budget, at the end time, when you press **Stop**, when you **lock** the wallet (including auto-lock), when you switch account or route, and when the wallet closes. The password is kept in memory only while the session runs. The older 19 November measurement took about 60 seconds. Wallet 0.8.20/0.8.21 and the updated provider agent stream after the payer block: author-run 21 November checks saw first text 3.3–5.0 seconds after those transactions were mined. Inclusion time varies; see [Paid Ask](../wallet/paid-ask.md). ## Set it up 1. Wallet → **AI Sharing → Use AI**. Choose who answers. 2. Click **Start gateway**. Copy the **base URL** and the **API key** (or click **Copy Continue config**). 3. For a network, pool or provider route, click **Start spending session** and confirm with your password. ### Continue `~/.continue/config.yaml`: ```yaml models: - name: PQWERAI provider: openai model: pqwerai apiBase: http://127.0.0.1:9440/v1 apiKey: roles: [chat, edit, apply] ``` ### Cline and Roo Code API provider **OpenAI Compatible** · Base URL `http://127.0.0.1:9440/v1` · API key from the wallet · Model ID `pqwerai`. ### Any OpenAI client ```bash curl http://127.0.0.1:9440/v1/chat/completions \ -H "Authorization: Bearer $PQWERAI_AI_KEY" -H "Content-Type: application/json" \ -d '{"model":"pqwerai","messages":[{"role":"user","content":"Explain a Merkle tree in one sentence."}]}' ``` ```python from openai import OpenAI client = OpenAI(base_url="http://127.0.0.1:9440/v1", api_key="") print(client.chat.completions.create(model="pqwerai", messages=[{"role": "user", "content": "Hello"}]).choices[0].message.content) ``` ## API reference | Method and path | Purpose | |---|---| | `GET /v1/models` | `pqwerai` (the route chosen in the wallet), `pqwerai-local` (always this PC's model, free), `pqwerai-network` (always the chosen network route, paid) | | `POST /v1/chat/completions` | OpenAI chat request; `stream: true` returns server-sent events (one content chunk, because paid answers are verified before they are returned) | | `GET /pqai/v1/status` | Route, pool/provider, and the spending session (budget, spent, remaining, expiry, requests), schema `pqwerai-ai-gateway-status/1` | - Any other model name is treated as `pqwerai`, so editors that insist on their own model name still work. - Paid answers carry a `pqwerai` object: `backend`, `model`, `provider`, `job`, `charge_wei`. - Messages: `system`, `user`, `assistant` (`developer` counts as system, `tool` results become user text); text only; up to 200 messages and 400,000 characters; `max_tokens` 1–4096 (default 512), further capped by the provider's quote (512 tokens on testnet today). - Errors use the OpenAI shape `{"error":{"message","type","code"}}`: 401 without the right key, 403 for a browser request, 413 above 1 MiB, 503 when the route is not available (for example no spending session). ## Security - Loopback only (`127.0.0.1` / `localhost`), never on the network. - Every request needs the API key (`Authorization: Bearer …`); **New key** in the wallet revokes the old one. - Requests with a browser `Origin` header or a foreign `Host` header are refused, so web pages cannot use it. - The gateway holds no keys. Paid requests are signed only inside an active spending session, within its budget. - The API key is stored in the wallet's `settings.json`. It is not a wallet secret: by itself it cannot move funds, only spend within a spending session you started. ## Limits - Paid answers take about a minute (three transactions); streaming is not token by token. - One paid request at a time; tool/function calling and images are not forwarded. - The pool route needs pool members that are also approved providers; on 19 November 2026 the public pool `bonsai-2-community` had no members yet. - Windows wallet only; the Linux CLI has no gateway yet. # web3.py # web3.py 7 !!! warning "Not executed for this release" The standard-library [opcode probe](../blockchain/evm-compatibility.md#probe-a-node-yourself) is the executed Python example. Pin web3 when you test (e.g. `pip install web3==7.6.0`). ```python title="pq_w3_example.py" import json, os from web3 import Web3 from eth_account import Account w3 = Web3(Web3.HTTPProvider(os.environ.get("PQWERAI_RPC", "http://127.0.0.1:8545"))) assert w3.eth.chain_id == 20778, "not the PQWERAI testnet" print("head", w3.eth.block_number) acct = Account.from_key(Account.decrypt(json.load(open("keystore/dev")), open("keystore/dev.password").read().strip())) tx = {"to": "0x000000000000000000000000000000000000dEaD", "value": w3.to_wei(0.01, "ether"), "nonce": w3.eth.get_transaction_count(acct.address, "pending"), "chainId": 20778, "maxPriorityFeePerGas": w3.eth.max_priority_fee, "type": 2} tx["maxFeePerGas"] = 2 * w3.eth.get_block("latest")["baseFeePerGas"] + tx["maxPriorityFeePerGas"] tx["gas"] = w3.eth.estimate_gas({**tx, "from": acct.address}) h = w3.eth.send_raw_transaction(acct.sign_transaction(tx).raw_transaction) r = w3.eth.wait_for_transaction_receipt(h) status = w3.provider.make_request("g4_status", [])["result"] print("final" if status["finalized_height"] >= r["blockNumber"] else "awaiting finality") ``` # PQWERAI Windows Wallet # PQWERAI Windows Wallet Non-custodial wallet for the PQWERAI test network: keys stay on your PC, signing is local, the wallet talks to a PQWERAI node over JSON-RPC. !!! warning "Wallet for 20778: 0.9.1" Published releases up to 0.8.26 **cannot join chain 20778**. Wallet 0.9.0 for chain 20778 (new network profile and genesis v3, Core `a679d60a1`, Smartnode & GhostShield hub) was published on 28 November 2026, followed the same day by 0.9.1 (token creation in one click, rectangular controls, same Core and network values); its `SHA256SUMS` and release notes are on the [release page](https://github.com/peppez07/pqwerai-wallet-releases/releases). Its built-in official pool list for 20778 is not updated yet (a later wallet build). Releases are **unsigned, unaudited test-network prereleases**. The feature descriptions below were verified before the chain 20778 launch (the 0.8.21 release run: wallet tests 459 PASS / 97 environment-gated SKIP, packaged UI 19 PASS / 1 SKIP, local CI A–F 28/28 PASS). They describe what the wallet does, not a run on chain 20778. ## Features | Feature | Implementation and limits | |---|---| | Use AI and the VS Code gateway (included) | AI Sharing → Use AI: choose this PC's model, the network, one model pool or one provider; local OpenAI-compatible endpoint `http://127.0.0.1:9440/v1` for Continue, Cline, Roo Code and OpenAI SDKs, with a budgeted spending session for paid answers ([guide](vscode-ai.md)) | | Contract Studio | Multi-language projects, ABI handling, simulation, project attachments and deployment verification; ERC-1155, ERC-4626 and permit templates | | Token protection | Warnings for suspicious token names and approvals; native tPQAI wrap/unwrap support | | Local models | Optional signed Bonsai model bundle, hash verification, registry approval/revocation checks and bounded local runtime; explicit download and hosting consent | | AI P2P | Opt-in overlay, provider discovery and relay support; availability depends on reachable peers and an approved network | | Paid Ask | Discover an eligible provider, inspect its signed quote, confirm the maximum spend, fund a testnet escrow and accept the delivered charge | | WASM contracts | C++ and C# for WASM VM v1, active from block 0 on chain 20778; with Solidity, Yul, Vyper, Huff and Fe the Studio supports seven languages, all checked against the chain's own EVM and WASM VM (40/40); see the [WASM tutorial](../contracts/wasm/first-contract.md) | Studio's historical local run at `7a23858` passed S1–S5 and two GUI checks. Its broader selection also recorded one environment-dependent AI quote failure and one local-node skip. No complete acceptance of every 0.8.x feature or independent multi-operator AI acceptance is claimed. Provider signatures identify a claim; they do not independently prove inference quality. ## Install | Artifact | Use | |---|---| | `PQWERAI-Wallet--win-x64.msi` | Per-user install, no administrator rights; includes the native node (`node` folder) | | `PQWERAI-Wallet--win-x64-portable.zip` | Portable; data stays next to the exe; includes `pqwerai-wallet-cli.exe` and the native node | | `pqwerai-core--source.tar.gz` | Corresponding source of the bundled Core (GPL/LGPL); rebuilds the shipped node files byte for byte | | `pqwerai-wallet-cli--linux-x64.tar.gz` | Linux command-line wallet | Verify the SHA-256 against `SHA256SUMS` before running: `Get-FileHash -Algorithm SHA256`. One-command install (downloads the MSI of the current release from the release page, checks its SHA-256, installs it for your Windows account and starts the wallet; read the script at first if you like): ```powershell iex (New-Object Net.WebClient).DownloadString('https://pqwerai.com/install.ps1') ``` The release is not code-signed yet, so a browser download shows "not commonly downloaded" and Windows SmartScreen shows "Windows protected your PC". Both describe a new, unsigned file without a download history, not a detection. The [download center](https://pqwerai.com/downloads/#install) lists the exact steps for Edge and Chrome. ## Features for developers | Area | What it does | |---|---| | Network | Pins chain ID **and** genesis hash on approval; refuses to sign if they change; bearer tokens DPAPI-protected; https certificate pinning | | Studio | Flowchart to deploy ERC-20 / ERC-721 templates (OpenZeppelin 5.0.2, precompiled) or custom Solidity; byte-for-byte post-deploy verification | | Own node | Optional: the native Windows x64 Core that ships in the package (pinned by SHA-256, any other build is refused) runs the official network genesis only (chain 20778 from the 20778 wallet); GhostRider mining works without WSL (0.8.11 mined accepted blocks on Windows before the chain 20778 launch). No WSL backend and no private chains | | Smartnodes | Register (Ed25519 key + proof of possession), delegate, top up, exit, withdraw, claim, report conflicting votes; finality dashboard | | AI Sharing | Opt-in local models and P2P; local diagnostic requests are not payable; paid Ask is a separate explicitly funded testnet escrow flow; optional priority over mining (CR-0053): the built-in node mines at the lowest CPU priority while AI sharing is active | | Console | `pqwerai-wallet-cli` inside the wallet (`status`, `balance $me`, `send …`, `sn-validators`) | | Command palette | Ctrl+K / F1 | ## Security model (summary) - Web3 Secret Storage V3 keystores (scrypt), encrypted backup v2 (AES-256-GCM), keys zeroed after signing. - The node-held-key `personal_*`/`eth_sign*` RPCs are **not served**; every RPC response treated as hostile (size, depth, id, hex checks). - Fee rule: `maxFee = 2 × baseFee + tip`; amounts are exact integers. - Status progression: Pending → Confirmed → **BFT-Finalized** (block ≤ `g4_status.finalized_height`, still canonical). Download location and release notes are published by the PQWERAI project for testers; the wallet source is not public. ## Separate development branches Native message signing/Discord connection and macOS work are separate development branches, outside the published packages. See [current ecosystem status](../resources/current-status.md). # Wallet Manual # Wallet Manual This manual explains **every function of the PQWERAI wallet**, one task at a time. The wallet is a **non-custodial** desktop application for the PQWERAI **test network**: your keys are created, stored and used to sign **on your own PC**, and the wallet talks to a PQWERAI Core node over JSON-RPC. It never holds your keys for you and no company can move your funds. !!! warning "Test network only" PQWERAI testnet 20778 is a test network. tPQAI, tEUR and tQAI have no monetary value and there is no mainnet. The wallet for chain 20778 is 0.9.1 (published 28 November 2026); releases are test-network prereleases: not independently audited and not code-signed. Earlier releases (up to 0.8.26) cannot join chain 20778. For the feature summary and release notes, see the reference page [PQWERAI Windows Wallet](../tools/windows-wallet.md). This manual is the step-by-step companion. ## Install and first start | Artifact | How to use it | |---|---| | `PQWERAI-Wallet--win-x64.msi` | Double-click. Per-user install to `%LOCALAPPDATA%\Programs\PQWERAI Wallet`, with Start-menu and desktop shortcuts and no administrator rights. Uninstall from *Settings → Apps*. | | `PQWERAI-Wallet--win-x64-portable.zip` | Extract and run `PQWERAI.Wallet.exe`. Data stays in `wallet-data\` next to the exe. Bundles `pqwerai-wallet-cli.exe` and `qai-wallet.exe`. | | `pqwerai-wallet-cli--linux-x64.tar.gz` | Self-contained Linux command-line wallet with `qai-wallet` and `node-run`. | Both builds are self-contained — no .NET install is required. **Always verify the download** against `SHA256SUMS` before running it: ```powershell Get-FileHash .\PQWERAI-Wallet--win-x64.msi -Algorithm SHA256 ``` The binaries are not code-signed yet, so Windows SmartScreen may warn. The first launch opens a **setup wizard**: 1. **Create or restore a recovery-phrase wallet**, or create/import a single account using a key, V3 keystore or backup. 2. **Choose a password** — it encrypts the keystore on disk. 3. **Save an encrypted backup** — keep it somewhere safe and separate. 4. **Connect to the official network** — the 20778 wallet starts online using the public RPC and failover, pinning chain ID and genesis. An own native node is optional under Network / My node. See [Accounts and backup](accounts-and-backup.md) for every account and backup task in detail. ## Simple and Advanced mode New wallets start in **Simple mode**, with Dashboard, Send, Receive, Transactions, **Smartnode Warranty (draft-only)**, AI Sharing, AI Workflows, Diagnostics and Settings. Account creation and backup remain part of the secure first-launch wizard. Turn on **Advanced mode** to reveal Smartnodes, **Smartnode Warranty** (a draft-only wizard), Node, Network, Studio, Model Pools, QAI, Console and other expert tools. A keyboard shortcut to an expert page switches to Advanced mode automatically. No actual warranty deposits, claims or locked collateral are active on chain 20778. ## Where your data lives | Data | Location (installed build) | |---|---| | Keystores, settings, transaction journal | `%PQWERAI_WALLET_DATA%`, or the per-user default; a portable build keeps `wallet-data\` next to the exe | | Your own node's chain data and binaries | `%LOCALAPPDATA%\PQWERAI\Wallet\node` (native) | | Local AI models and runtimes | `%LOCALAPPDATA%\PQWERAI\Wallet\ai\local` | A `portable.flag` file next to the exe switches to portable storage. The environment variable `PQWERAI_WALLET_DATA` overrides the data folder. ## Every function, by page | Page | What you do there | Manual | |---|---|---| | Dashboard | See your balance and address, copy your address, pick the next step | [Send and receive](send-and-receive.md) | | Send | Send tPQAI with a fee preview and confirmation | [Send and receive](send-and-receive.md) | | Receive | Show your address and a QR code | [Send and receive](send-and-receive.md) | | Transactions | Follow each transaction from Pending to BFT-Finalized | [Transactions and status](transactions.md) | | Tokens | Discover and transfer ERC-20 and ERC-721 tokens | [Tokens](tokens.md) | | Studio | Build, deploy and verify tokens, NFTs and custom contracts | [Contract Studio](studio.md) | | Network | Connect to local or remote nodes; pin chain ID and genesis | [Network and your node](network-and-node.md) | | Node | Run your own full node, mine, run a Smartnode signer | [Network and your node](network-and-node.md) | | Smartnodes | Register, delegate, exit, withdraw and claim; finality health | [Smartnodes](smartnodes.md) | | Pools | Find, create or join a per-model pool | [Model Pools](pools.md) | | Smartnode Warranty | Guided proposal for up to 10 covered addresses with separate tPQAI collateral; **not live** | [Smartnode Warranty](smartnode-warranty.md) | | Legacy recurring recovery | Revoke previously granted recurring permissions and withdraw deposits; no new grants in wallet UI | [Recurring permissions](recurring.md) | | AI Sharing | Share AI compute; run a local model | [AI Sharing](ai-sharing.md) | | AI Escrow / Paid Ask | Pay an approved provider per job | [Paid Ask and AI escrow](paid-ask.md) | | QAI | Post-quantum Quantum Smart Accounts | [QAI post-quantum](qai.md) | | Console | Run wallet CLI commands inside the app | [Console and CLI](console-and-cli.md) | | Workflows / Canvas | Node editor for AI tasks; visual contract builder | [AI Workflows in the wallet](../ai/workflows.md) | | Settings | Theme, motion, modes, security options | [Settings and security](settings-and-security.md) | ## The rules the wallet always follows - It signs **only** with an **approved node** whose chain ID and genesis hash still match what you approved. - Keys are decrypted only for the signing call and wiped from memory afterwards; only the signed raw transaction leaves your PC. - It never uses `personal_*` or `eth_sign*` RPC methods, and it sends no telemetry. - Amounts are **exact integers** — there is no floating-point rounding. The full list is on [Settings and security](settings-and-security.md). # Accounts and backup # Accounts and backup Your account is an Ethereum-style key pair. The private key is kept in an **encrypted keystore file** on your PC and is decrypted locally for explicitly approved signing; bounded AI spending sessions retain an unlock only for their approved lifetime. This page covers every account and backup task. ## Create or import an account The setup wizard (first start) and *Settings → Accounts* both let you: | Action | What happens | |---|---| | **Create a recovery-phrase wallet** | Generate and confirm a BIP-39 phrase; save it offline and protect it as a key. | | **Restore a recovery phrase** | Recover Ethereum-style accounts using the standard Ethereum derivation path; MetaMask/Rabby-compatible for the same phrase/path/index. | | **Create a new account** | A fresh key is generated and encrypted under your password. | | **Import a private key** | Paste a raw `0x…` private key; it is encrypted into a keystore. | | **Import a V3 keystore** | Load a Web3 Secret Storage V3 file (for example one made by `pqwerai-cli`). | | **Import from a backup** | Restore accounts from a wallet backup file (see below). | You can hold **multiple accounts**, give each one a **label**, and switch between them. Keystores created by `pqwerai-cli` are byte-compatible and can be imported and used to sign here, and vice-versa. ## Keystore format Keys are stored as **Web3 Secret Storage V3** (scrypt N=2¹⁸, AES-128-CTR, keccak MAC) via Nethereum — the same format as go-ethereum and `pqwerai-cli`. This is why a keystore moves between the GUI, the CLI and Core without conversion. ## Change your password *Settings → Accounts → Change password* re-encrypts the keystore under a new password. The private key is never written out in the clear during the change. ## Remove an account Removing an account **moves its keystore file aside** — it is never deleted outright. If you remove an account by mistake, the file is still on disk and can be restored. !!! warning "Keep a backup" The wallet cannot recover a key you never backed up. If you lose the keystore and its password, the account and its test funds are gone. Make a backup (below) as soon as you create an account. ## Back up your wallet The wallet supports two backup formats: | Format | What it protects | Encryption | |---|---|---| | **`pqwerai-cli` backup v1** | Encrypted keystores plus a SHA-256 digest | Each keystore keeps its own V3 encryption | | **Encrypted backup v2** | The whole bundle sealed as one file | AES-256-GCM under scrypt (N=2¹⁷, r=8, p=1) of a **separate backup passphrase of at least 12 characters**; every header field is authenticated | To make one, choose **Create backup**, pick the format, and for v2 enter a backup passphrase that is different from your keystore password. The wallet writes the backup to the location you choose and **never overwrites** an existing file. The v2 format has been cross-checked both ways against `pqwerai-cli` and an independent Python implementation, so a backup made in the GUI restores in the CLI and the reverse. ## Verify and restore - **Verify backup** checks the file's integrity (and, for v2, that the passphrase and every authenticated header field are correct) **without** importing anything. - **Restore backup** imports the accounts from a verified backup. Restore never overwrites your current keystores; resolve any name clash first. ## Tips - Store the backup file and its passphrase **separately** from the PC that runs the wallet. - A backup passphrase is only as strong as you make it — use at least 12 characters, and prefer a long phrase. - After restoring on a new PC, re-approve your node on the [Network](network-and-node.md) page before signing. ## Recovery phrase and key scope Current releases use Ethereum derivation (`m/44'/60'/0'/0/index`) for phrase-based accounts. Match the account index and any phrase passphrase when restoring elsewhere. A single imported key is not made recoverable by an unrelated phrase. Keep encrypted backups of separately created/imported accounts and QAI post-quantum keystores; an Ethereum recovery phrase alone does not replace those key files. Never paste a phrase into support chats, websites, diagnostics or an AI prompt. # AI Sharing # AI Sharing Open **AI Sharing** in the wallet or command palette. Sharing is opt-in. The current wallet prepares and starts its verified runtime itself; an already-running external gateway is not required for this managed flow. ## Start sharing 1. Install the [wallet for chain 20778](../tools/windows-wallet.md) (0.9.0 or later) and connect to testnet 20778. 2. Read the download/model/hosting terms and enable sharing. The steps are **Download → Verify → Install → Ready → Sharing active**. 3. Choose **Automatic**, **Saver** or **Performance**. CPU/GPU choices apply on managed start. Images additionally require the vision projector. Hardware eligibility does not prove runtime readiness. 4. Wait for a real inference check. Completed downloads, a running process or an open port alone are insufficient. 5. To join the official pool, read its membership terms and use the pool controls. Without a usable mesh invite, the model can serve this PC locally; this does not establish network availability or paid work. ## Download and verification The signed bundle pins model revision, sizes, SHA-256 values and runtime archive. Public PQWERAI IPFS HTTPS gateways serve the approved files without a wallet, pool membership or payment. See [distribution and access](../ai/model-distribution.md). Downloads have header/data-idle deadlines, cancellation, pause and validated range resume. Cache files are reused only after verification. The registry must allow the signer, manifest, weights and licence, without revocation. Runtime metadata is bound to the signed archive; model, licence and enabled vision files are rechecked at start. A verified cache can be reused when a gateway is unavailable. Default Bonsai Q2_0 weights are about 547 MB; vision and runtime add to this. Keep space for extraction and repair. Data is stored in `%LOCALAPPDATA%\PQWERAI\Wallet\ai\local`. ## Runtime and pool readiness The GhostLLM runtime is a separate process. Its managed local API uses literal loopback; the wallet discovers the actual port. Start/stop is serialized, **Off** cancels pending recovery, and crashes have bounded restart attempts. After startup or restart, a real completion is required. Pool serving additionally requires loaded stages or whole-model nodes. Failed joins stop transient serving and clear the temporary invite. Error details are retained for diagnosis. ## Timeout or GhostLLM runtime failed - Update to the latest wallet release before retrying. Distinguish **LICENSE/download** failure from **runtime/startup** failure. - If Download/Verify completed, inspect the startup error instead of repeatedly fetching all weights. - Download `Diagnose-AiSharing.ps1` from the [release page](https://github.com/peppez07/pqwerai-wallet-releases/releases) and run it locally in PowerShell on the **affected PC**. It writes a diagnostic JSON file to the desktop and excludes keys, invites and prompts. Review the report before sending it to support. - Local runtime checks used an RTX 4060 Ti. The other PC's RTX 2070 timeout remains undiagnosed; no universal GPU compatibility or timeout-fix claim is made. These steps do not depend on finding an “Advanced” menu. Start with the managed flow shown on AI Sharing. ## Payment and mining priority Sharing earns tPQAI only from accepted customer-funded escrow jobs. Local tests, GPU counters and free-pool membership create no payout. See [Paid Ask](paid-ask.md) and [pools](pools.md); pooled contribution settlement is open. **Give AI sharing priority over mining** lowers the built-in miner/helper CPU priority; it does not reserve GPU memory or guarantee startup. AI never participates in block validation. # Console and command-line wallet # Console and command-line wallet Every wallet action is also available as a command, both inside the app (the **Console** page) and as a standalone tool (**`pqwerai-wallet-cli`**). ## The Console page (Advanced mode) The **Console** runs `pqwerai-wallet-cli` commands **inside the wallet**, already pointed at the connected node and this wallet's keystore. For example: ``` status balance $me send -from $me -to 0x… -amount 1.5 sn-validators help ``` - `$me` is the selected account. - **Up/Down** browse command history; quoted arguments are supported. - When a command needs a password, the normal **hidden-input dialog** appears — **passwords never appear in the console** or its history. ## The interactive shell in any terminal The same interactive mode runs in any terminal on Windows or Linux: ``` pqwerai-wallet-cli [-rpc URL] shell ``` It offers masked password input, `history` and `exit`. ## The full command-line wallet `pqwerai-wallet-cli` uses the **same Core library and the same file formats as `pqwerai-cli`**, so it shares keystores, backups, Smartnode keys and transactions. The MSI puts it on your user PATH. Commands include: | Group | Commands | |---|---| | Accounts & funds | `new`, `import-key`, `list`, `status`, `balance`, `nonce`, `tx`, `history`, `send` | | Backup | `backup`, `restore`, `verify-backup` | | Contracts | `deploy`, `call`, `read`, `studio-deploy`, `contract-read`, `contract-send` | | Tokens | `erc20-*`, `erc721-*` | | Smartnodes | `sn-keygen`, `sn-register`, `sn-delegate`, `sn-topup`, `sn-undelegate`, `sn-exit`, `sn-withdraw`, `sn-claim`, `sn-rotate`, `sn-slash`, `sn-status`, `sn-validators` | | AI & post-quantum | `ai-models`, the `qai-*` commands | | Node | `node-run` (runs a native node from a build folder, in the foreground until Ctrl+C) | **Parity with `pqwerai-cli` is tested:** `testnet/cli_parity.sh` makes each tool use the other's keystores, backups, Smartnode keys and transactions (21/21 checks). For example, `sn-slash -from A -vote-a HEX -vote-b HEX` produces **byte-identical** registry calldata to the Go Core, and the GUI offers the same action under [Smartnodes → Report conflicting votes](smartnodes.md#report-conflicting-votes). For the node-operator CLI and flags, see [Core CLI and flags](../tools/core-cli.md). # Network and your own node # Network and your own node The wallet signs transactions locally but needs a **node** to read the chain and broadcast. This page covers connecting to a node (the **Network** page) and running your own (the **Node** page). ## The Network page (Advanced mode) Use **Network** to choose which node the wallet talks to: - **Local discovery** — the wallet probes `127.0.0.1:8545` (the Core default) and the smoke-test ports and offers any node it finds. - **Remote node** — enter a node's URL. A remote node can use a **bearer token**, which the wallet stores **DPAPI-protected** on Windows. ### Approval pins chain ID and genesis When you approve a node, the wallet **pins its chain ID and its genesis hash**. From then on it **refuses to sign** if either value changes — so a node that is swapped for one on a different chain cannot trick the wallet. The wallet reconnects automatically with backoff if the node drops. For an **https** node, the certificate's SHA-256 is shown and **pinned at approval** (self-signed node certificates work safely), and a different certificate later is refused. Plain **http** is allowed for remote nodes but flagged. ## The Node page — run your own full node The wallet can run **PQWERAI Core as its own full node**, so the chain is downloaded and verified on your PC. Core binaries are supplied separately by the network operator; the wallet does not bundle them. ### Backends Under *Advanced → Node → Backend*: - **native** runs `pqwerai-core.exe` directly on Windows (or `pqwerai-core` on Linux via the CLI's `node-run`) when the node build sits next to the wallet or in a folder you choose. This is the default and needs **no WSL, Go, GCC, Python or installed .NET**. - **wsl** is an explicit legacy option for the Linux build inside WSL. - **auto** selects native and reports a missing native bundle rather than silently starting WSL. ### Steps 1. **Install** copies `pqwerai-core` (and `pqwerai-cli`) and the GhostRider helper into a wallet-owned folder. The helper's SHA-256 is pinned on first install and the node is refused if it later changes. 2. **Chain** — Simple setup joins the **20778** network (wallet for 20778) using the bundled, SHA-256-verified genesis and its expected genesis hash. It never generates a replacement genesis or overwrites another profile's database. Advanced mode can instead create a disposable private chain or import another operator's genesis. 3. **Start** runs the node with **RPC on `127.0.0.1` only**, shows sync progress and the log, and the wallet automatically approves (pins chain ID and genesis) and connects to it. You can optionally **stop it with the wallet**. The native P2P listener defaults to loopback, and outbound peers work. Operators who need **incoming** peers can set `LocalNode.P2pListenAddress` to a specific interface in settings and open their firewall; RPC always stays on loopback. ## GhostRider mining With your own node running, **"Mine with this node"** mines proof-of-work blocks with the rewards going to the selected account. The native Windows node bundled since wallet 0.8.11 mines without WSL. **Mining threads** (0.8.13) sets how many GhostRider workers run: `0` = every logical processor; **Apply (restarts the node)** applies it. Step by step: [Mine from the Windows wallet](../getting-started/wallet-mining.md). If [AI Sharing](ai-sharing.md) is active, you can have the node and helper drop to **Idle CPU priority** so AI sharing comes first (CR-0053). ## Smartnode signer The Node page can also run `pqwerai-core validator` with your validator key so your registered [Smartnode](smartnodes.md) votes for BFT finality: - The key password reaches the signer through an **owner-only file** that is **deleted as soon as the signer is ready** — it never appears on a command line. - **Enroll new key** is **only** for a brand-new validator key. **Start signer** reuses the original journal and trusted anchor and refuses missing state. !!! danger "Never re-enroll an old key or copy a live signer" Re-enrolling a key that already voted, or running the same signer on two machines, can produce conflicting votes and get your Smartnode slashed. Always **Start signer** on an existing key; only **Enroll** a truly new one. # Paid Ask and AI escrow # Paid Ask and AI escrow Paid Ask pays an eligible provider for an accepted answer. A local diagnostic or free-pool test is not a payable job. Testnet tPQAI has no monetary value. 1. Choose this PC, network, a pool or one provider in **AI Sharing → Use AI**. Paid routes require funds. 2. Discover an eligible provider and inspect its signed quote, model and maximum charge. 3. Approve the ceiling. The wallet funds escrow and authorizes the exact request hash on **AIJobMarket**. 4. Once the payer's transactions are mined, text streams while the answer is generated. Provider start/propose transactions can be broadcast without another block before delivering text. 5. The wallet checks the signed receipt and matches the answer to the on-chain proposal before accepting its charge. Funding, streamed delivery and final settlement are distinct states. 6. Use escrow controls for disputes/refunds; wait for BFT finality before treating funds as irreversible. A bounded **spending session** approves account, duration, total budget and per-answer ceiling once. Locking, switching account/route, expiry or Stop ends it. Ambiguous/mismatched charges remain reserved, not silently accepted. The [editor gateway](../tools/vscode-ai.md) uses the same route and spending rules at `127.0.0.1:9440/v1`. ## Timing and limits Author-run 21 November scripts (before the chain 20778 launch) measured first text **3.3–5.0 seconds after the payer's transactions were mined** with the updated provider agent; inclusion time varied. Matching proposals and mined acceptance were checked. This is a dated single-operator result, not a latency promise. It did not cover the full wallet Ask UI, independent two-PC relay streaming or every spending-session dialog. ## Contract interfaces [ServiceEscrow v3](../ai/service-escrow.md) is the generic quote/fund/propose/accept/finalize/pull-payment contract. The deployed **AIJobMarket** adds provider/model eligibility, request authorization and receipt binding. Its ABI must not be substituted with generic ServiceEscrow. See [revenue policy](../ai/revenue-policy.md) for payees: the 100% provider fixture is not the live market's 88/4/4/4 deployment. # Model Pools # Model Pools The **Pools** page (Advanced mode) is where AI providers group around a **single model**. A pool lets several providers serve the same model and share work through a members-only relay. ## What you can do | Action | What it does | |---|---| | **Find a pool** | Browse existing pools for a model through the federated pool directories. | | **Create a pool** | Start a new pool for a model you serve. | | **Join a pool** | Become a member of an existing pool. | ## Federated directories and relay Pool directories are **federated** — they are published by network participants rather than a single server, so you can discover pools from more than one source. Once you are a member, the **members-only relay** carries work between pool members. ## Relationship to AI Sharing A pool is about **which model** a group of providers serves together. To actually serve AI from your PC — including running a local model — set yourself up on the [AI Sharing](ai-sharing.md) page first. To be paid per job as a client of a provider, see [Paid Ask and AI escrow](paid-ask.md). !!! note "Testnet feature" On test network 20778 the pool directory runs at `pools-testnet.pqwerai.com` (`pools-testnet2` has no DNS yet) and the relay at `relay.pqwerai.com:3340`; the official pool, `bonsai-2-community`, was created on 28 November 2026 and has no members yet. The built-in official pool list of wallets 0.9.0 and 0.9.1 for 20778 is updated in a later build. Members send heartbeats and collect reputation strikes for going silent or leaving early. Since 19 November 2026 the directories also remove a member that stays silent longer than max(1 hour, 4 × the pool's offline grace); it can request to join again. Step by step, with the directory API: [Create or join a model pool](../getting-started/model-pool.md). ## Runtime readiness A model fitting a member's memory is served whole; otherwise the runtime uses layer stages. Only loaded runtime nodes/stages are advertised as serving. Failed joins stop transient serving and clear the invite. The official free pool can be forming without an active epoch; membership does not guarantee an answer. Independent multi-PC split execution and pooled on-chain payouts remain unverified. # QAI post-quantum token # QAI post-quantum token **QAI** is a post-quantum token; on testnet its ticker is **tQAI** (every testnet unit carries the "t"). Its balances belong to **Quantum Smart Accounts** — 32-byte account IDs — not to ordinary `0x` addresses. The **QAI** page and the `qai-*` commands manage them. !!! note "Deployed testnet contracts" QAI contracts were deployed on testnet 20778 on 27 November 2026. Use the [published addresses](../contracts/guides/qai-post-quantum.md#contracts-on-testnet-20778) and verify chain/genesis. Legacy bonding-curve buys are paused since block 5,112 (sells stay open); tEUR, the curve and the 120% stack are legacy contracts and the economy is under redesign. tQAI and tEUR have no monetary value; ordinary tPQAI gas transactions and validator votes still use classical cryptography. ## Keys The wallet creates **two** post-quantum keys through the bundled reference signer **`qai-wallet`**: | Key | Algorithm | Purpose | |---|---|---| | Operational key | **ML-DSA-65** (FIPS 204) | Signs transfers | | Recovery key | **SLH-DSA-SHAKE-192s** (FIPS 205) | Recovers the account | Both are stored as **Argon2id + AES-256-GCM** keystores in `qai-keys/`. Your selected tPQAI account **relays** the transfer and **only pays gas** — the post-quantum signature is what authorises the move. ## Checks before every signature Before it signs, the wallet verifies that: - the **`pq-verify/v1` precompile** at `0x…0d01` accepts a known NIST ACVP vector **and rejects** a modified signature; - the **registry was deployed for the connected genesis**, and the token uses that registry. Every signature is **bound to the chain, genesis, registry and contract**, carries the account's **next nonce**, and **expires after 10 minutes**. ## What you can do The GUI covers creating an account and transfers; the full lifecycle — recovery, rotation, redemption and reclaim — is available in the CLI and [Console](console-and-cli.md): ``` qai-keygen qai-pubkey qai-status qai-account qai-balance qai-create qai-transfer qai-redeem qai-rotate-op qai-recover qai-cancel-recovery qai-finalize-recovery qai-reclaim ``` Post-quantum passphrases are supplied through files (for example `-op-password-file`) or interactive prompts — **never** as command-line arguments. For the token's design, see [QAI post-quantum token (testnet)](../contracts/guides/qai-post-quantum.md). # Recurring permissions # Recurring permissions !!! warning "Legacy access only — replaced by Smartnode Warranty" **Recurring** is no longer a primary wallet function. In Advanced mode, open **Smartnode Warranty → Legacy recurring permissions — recovery only** to review and revoke previously authorized grants or withdraw old deposits. The new-grant and additional-deposit controls are retired in the wallet UI. Smartnode warranties are completely different and currently **not active** on public testnet 20778. The legacy **Recurring** recovery panel documents **recurring payment permissions** — a signed grant that lets a relayer make a repeating payment **to a fixed recipient** on your behalf, within limits you set, without you signing each time. !!! warning "Implemented UI, separate deployment requirement" RecurringPermissions is implemented and locally tested but not deployed on chain 20778 (left out unless independently audited). These controls require a separately approved compatible contract. They are not a live recurring-payment service or the AI spending-session mechanism. ## What a permission authorises A recurring permission is a signed, EIP-712-typed grant. It authorises paying a **specific recipient** up to a set amount on a set schedule. The contract enforces the limits on-chain, so a relayer can never pull more than you granted or pay anyone other than the recipient you named. ## Call mode is disabled A recurring permission **can only pay a recipient**. It cannot make an arbitrary contract call on your behalf. !!! note "Why call mode was removed" Earlier designs allowed a permission to carry calldata and call a contract ("call mode"). That could be abused as a **confused deputy** — for example to spend a token approval the wallet held for something else. Call mode is now **disabled** at every layer: the on-chain contract rejects any permission that names a target, the reference model refuses it, and the wallet refuses to create one, with the message *"Recurring contract calls are not supported: a permission can only pay a recipient."* A permission's target, selector and data hash must all be zero. (CR-0050.) ## Grant, review and revoke | Action | What it does | |---|---| | **Grant (legacy only)** | Historical behavior, no longer available in the current wallet UI. | | **Review** | See your active permissions and their limits and usage. | | **Revoke** | Cancel a permission so no further payments can be pulled under it. | As with every signing action, revoking goes through the confirmation dialog and password and happens only on an [approved node](network-and-node.md). !!! warning "Not yet independently audited" The recurring-permissions contract, like the rest of the wallet, has had internal (author) review only and still needs an independent audit before it should be relied on beyond the testnet. # Send and receive # Send and receive This page covers the everyday money movements: seeing your balance, receiving tPQAI, and sending it safely. ## The Dashboard The Dashboard shows your **balance** and **address** for the selected account. One click **copies your full address** to the clipboard, and the clipboard **clears automatically** a short time later. When no node is connected, the Dashboard offers both next steps: *Start my own node* or *Open Network*. ## Receive Open **Receive** to show the selected account's address together with a **QR code**. Share either one with the sender. An address is safe to share publicly — it only lets people **send** you funds, never spend yours. Always check that the address the other person used matches yours, character for character. The wallet applies **EIP-55 checksum** validation so a mistyped address is caught. ## Send Open **Send** and fill in: 1. **To** — the recipient's `0x…` address. The wallet validates its EIP-55 checksum. 2. **Amount** — an **exact integer** amount of tPQAI. A comma `,` is rejected because it is the displayed thousands separator; use a plain number. 3. **Fee** — the wallet proposes an EIP-1559 fee using the same rule as `pqwerai-cli`: `maxFee = 2 × baseFee + tip`. Before you confirm, the wallet shows a **preview**: the **expected fee**, the **maximum fee**, and the **chain ID** you are sending on. Review all three. ### The confirmation dialog Every send goes through a confirmation dialog that lists **all parameters** — recipient, amount, fee and chain ID — and then asks for your **password**. The wallet decrypts your key **only** for this one signing call and wipes it from memory afterwards. Only the **signed raw transaction** is sent to the node; the wallet decodes it and recovers the sender before broadcasting, as a final check. !!! note "Signing is blocked on an unapproved node" The wallet refuses to sign if the connected node's chain ID or genesis hash differs from the profile you approved. This stops a swapped-out node from tricking the wallet into signing on the wrong chain. See [Network and your node](network-and-node.md). ## After you send The transaction appears on the [Transactions](transactions.md) page and moves through **Pending → Confirmed → BFT-Finalized**. Treat a payment as truly settled only once it is **BFT-Finalized**. For why finality matters, see [Finality for applications](../blockchain/finality.md). # Settings, shortcuts and security # Settings, shortcuts and security ## Settings The **Settings** page controls appearance and behaviour: - **Simple / Advanced mode** — the same switch as the sidebar; Advanced reveals the expert pages. - **Reduce motion** — turns off the moving animations. Motion is also off when Windows *Show animations* is off. Motion **never carries information on its own**: the end state is identical with or without it. - **Theme** and other appearance options. - Account management (change password, add or remove accounts — see [Accounts and backup](accounts-and-backup.md)). Settings are written **atomically**; a corrupt settings file is preserved and replaced by defaults rather than crashing the wallet. ## Command palette and shortcuts Press **Ctrl+K** (or **F1**) anywhere to open the **command palette**. Type part of a page or action — "send", "node", "backup", "theme" — and press Enter. The palette lists each keyboard shortcut next to its page. A shortcut to an expert page switches to Advanced mode automatically. ## Security model The wallet is built so that a hostile node, a hostile contract or a crash cannot cost you your keys: - **Local signing.** Keys are decrypted **only** for the signing call and **zeroed afterwards**. Only the signed raw transaction is sent, and the wallet decodes it and recovers the sender before broadcasting. - **No dangerous RPCs.** It never uses `personal_*` or `eth_sign*`. There is **no telemetry**. Logs are local and scrubbed of long hex strings. - **Hostile-response handling.** Every RPC response is capped (8 MiB), depth-limited, id-checked and strictly hex-parsed; a receipt or transaction hash must match the request; ABI string decoding is bounded. - **Chain binding.** Signing is **blocked** if the node's chain ID or genesis hash differs from the approved profile. - **Exact amounts.** Amounts are exact integers — no floating point. A `,` is rejected because it is the displayed thousands separator. - **At rest.** Auto-lock after inactivity, clipboard auto-clear, a single instance per data folder, a crash marker, and atomic settings writes. - **https nodes.** The certificate SHA-256 is shown and **pinned at approval**; a different certificate later is refused. Plain http is allowed but flagged for remote nodes. - **Keystores and backups.** Web3 Secret Storage V3 keystores (scrypt) and encrypted backup v2 (AES-256-GCM) — see [Accounts and backup](accounts-and-backup.md). - **Signed updates.** Opt-in, https, ECDSA P-256 manifest, SHA-256-checked MSI. ### Current limitations The wallet is honest about what it does **not** yet have: - **No hardware-wallet support** yet. - **No owner release key or code-signing certificate** yet — builds are not Authenticode-signed, so SmartScreen may warn, and you must verify downloads against `SHA256SUMS` yourself. - **No independent audit** yet — all review so far is internal (author) review. Treat the wallet accordingly: it is private testnet software for a network with **no real funds**. # GhostShield (Smartnode Warranty) # GhostShield GhostShield is the economic guarantee behind every Smartnode. Your collateral is locked by the protocol, the Smartnode's state is computed from the chain, and the only penalty is a 25% burn for proven double voting. Testnet tPQAI has no monetary value. !!! warning "GhostShield v2 is active on chain 20778; this page describes the earlier wizard" GhostShield v2 (a Smartnode puts at least **32 tPQAI** of collateral behind **up to 10 sponsored addresses**, which then become eligible for GhostTurbo, with payment-assurance claims from block 1) is bound in the chain 20778 genesis profile (genesis v3, Core `a679d60a1`) and active. At the time of writing: 1 collateral record (the sn1 owner, 32 tPQAI), 10 assured sponsorships of 3.2 tPQAI each, 0 claims, 0 faults. The independent review is pending before mainnet, and it is not insurance. Wallet 0.9.0 (published 28 November 2026) has the **Smartnode & GhostShield** hub for v2; read the live state on the explorer at [/ghostshield](https://explorer.pqwerai.com/ghostshield) (also `/ghostshield/sponsorships`, `/ghostshield/claims`, `/ghostshield/lookup`, JSON under `/api/v1/ghost/v2/`). The public RPC does not serve `ghostshield_*` methods; use the explorer or your own node. The wallet flows described on this page are the earlier wizard; they do not provide GhostShield v2. The **Smartnode Warranty** Solidity contract (an operator locks tPQAI for up to 10 covered addresses, with a 2-of-3 arbiter panel for disputed claims) is a separate design, not GhostShield. Its address on chain 20778, `0xC772723758aC2c52325d74982f954ec8160C2FB7`, stays reserved and unused: the contract is **not deployed**. In the Windows wallet, open **Advanced mode → GhostShield**, or **Smartnodes → Open GhostShield wizard**. ## What works where | Feature | Requirement | Status | |---|---|---| | Smartnode registration, collateral, top-up, exit, withdrawal | a node with the G4 registry | uses the existing Smartnodes transactions | | Lifecycle state, activation progress, withdrawal eligibility, penalties | a Core with the `ghostshield` RPC namespace | read from chain state | | Guarantees for covered addresses (open, release) | the `ghostshield-guarantee/v1` fork active on the network | **not available on testnet 20778** (not in the genesis, no fork scheduled); the wallet shows "not activated on this network" | | Guarantee claims and payouts | an approved objective evidence verifier | **disabled**; no claim button exists | If your node does not offer the `ghostshield` namespace (for example the public RPC today), the wallet says "not available on this node". It never shows invented numbers. ## The wizard 1. **Eligibility:** registry present, fork status, your Smartnodes. 2. **Requirements and risks:** stake 1–2 048 tPQAI. 25% of stake is burned for proven double or surround voting. Unbonding lasts 4 epochs (128 blocks) after exit. Guarantee collateral is locked for 256 + 64 blocks. 3. **Balance check.** 4. **Prepare:** Smartnode registration (the standard registry transaction) or a guarantee for one covered address. 5. **Sign and confirm** in the usual confirmation dialog. 6. **Registration** is sent. 7. **Activation monitoring:** state and progress to the activation epoch. 8. **Dashboard:** locked stake, withdrawable amount, state and reason, guarantees (slots used/free), verified penalties and recent history. Per-Smartnode rewards are not reported by the node yet; the dashboard says so. 9. **Unbonding and withdrawal:** exit, then withdraw when eligible. A guarantee is released after its challenge window (finalized blocks). States you may see: pending activation, active, degraded (missed checkpoints; no penalty), suspended (outside the 64-member set), penalized, unbonding, withdrawn. ## GhostPulse page **Advanced mode → GhostPulse** shows your node's health, peers, resources and the AI admission advice. Everything on that page is a local observation and never affects consensus. If you previously used experimental recurring payments, the revoke and withdraw controls remain under **Legacy recurring permissions — recovery only**. # Smartnodes # Smartnodes **Smartnodes** are the validators that vote for BFT finality on PQWERAI. The **Smartnodes** page (Advanced mode) manages the registry side — registering, staking and withdrawing — while the actual voting runs on the [Node page's Smartnode signer](network-and-node.md#smartnode-signer). !!! note "What the node must expose" Smartnode actions only appear when the connected node exposes the **`g4` namespace** and the **registry system account**. On a node without them, the actions stay disabled. ## The finality dashboard The page reads `g4_status` and `g4_validators` to show the validator set and the chain's finality health — justified and finalized heights, the active signers and their participation. This is the same data an application would read; see [BFT finality](../smartnodes/finality.md). ## Registry actions | Action | What it does | |---|---| | **Register** | Enrol a Smartnode with an **Ed25519 key** plus a **proof of possession** (the `sn-keygen` file format). | | **Delegate** | Stake toward a Smartnode. | | **Top up** | Add more stake to an existing registration. | | **Undelegate** | Remove a delegation. | | **Exit** | Begin leaving the validator set. | | **Withdraw** | Take out stake after the rules allow it. | | **Claim** | Collect what is owed to you. | | **Report conflicting votes** | Submit two conflicting signed votes to slash an equivocating validator (the same as the CLI `sn-slash`). | Each action is built, shown for confirmation (parameters, fee and chain ID), and signed locally on an approved node. The wallet **refuses an early withdrawal before signing** when the rules do not yet allow it, rather than letting you submit a transaction that would fail. ## Report conflicting votes If a validator signs two conflicting votes, **Smartnodes → Report conflicting votes** takes the two RLP signed-vote inputs and produces the exact registry calldata to slash it. This is byte-for-byte identical to the CLI command `sn-slash -from A -vote-a HEX -vote-b HEX`, which is checked against a known-answer vector generated by the Go Core. ## Running the signer Registering a Smartnode does not by itself make it vote. To vote for finality, run the **Smartnode signer** on the [Node page](network-and-node.md#smartnode-signer) with your validator key. Read the warnings there: never re-enroll a key that already voted, and never run one signer on two machines. # Contract Studio # Contract Studio The **Studio** page is a visual, vertical flowchart for building and deploying smart contracts. Each step turns green when it is valid, so you always know what is left to do. For a complete **C++ or C# WebAssembly project**, follow [Your first WASM contract](../contracts/wasm/first-contract.md). The [WASM guides](../contracts/wasm/index.md) include compiler setup, supported language features, ABI/storage/host interfaces, deployment and module verification. ## Two flows **Template flow (tokens and NFTs):** > Contract type → Name and symbol → Supply (or Items and metadata) → Features → Owner → Review → Deploy on chain → > Verify and track **Custom-code flow:** > Code from AI or file → Compile or load artifact → Constructor arguments → Review → Deploy → Verify ## Tokens and NFTs from templates Since wallet 0.9.1, creating a token is one click away: **Create token** in the Studio header, the **Create a token** card on the first wizard screen (no-code ERC-20 for every language, or the selected language's token example for Solidity, Vyper, Fe, C++ and C#), and the **Create a token** card on the Tokens page. ERC-20 tokens and ERC-721 collections use two **OpenZeppelin 5.0.2** templates that are **precompiled** (pinned solc 0.8.26, `evmVersion: london`, deterministic, zero warnings). Because they are precompiled, **no compiler is needed** to deploy them. After deployment the wallet checks that the on-chain runtime code is **byte-identical** to the shipped artifact, reads back name/symbol/supply/owner, and adds the contract to [Tokens](tokens.md). ## Working with an AI assistant Studio is designed to round-trip with an assistant such as Claude or Codex: - **Copy AI prompt** puts clear instructions on the clipboard. - **Paste from AI** reads the assistant's whole answer back. Markdown code fences are stripped, and the content is recognised automatically as a project (`"schema": "pqwerai-studio-project/2"`), supported source code, a compiled artifact (solc standard JSON, Hardhat, Foundry or Remix) or raw bytecode. - Copy the project JSON or source to send the current design back to an assistant for review. - Flows can also be **saved and opened as files**. Older `pqwerai-flow/1` projects are migrated when opened. Save after compilation and deployment to retain the language, source, ABI, bytecode, attached files and deployment records. ## Compiling pasted Solidity Pasted Solidity is compiled with **standard JSON over stdin**. `@openzeppelin/contracts` 5.0.2 imports resolve from a **bundled copy**, so the compiler reads no files from your disk and needs no network access. Rules the Studio enforces: - User code targets the connected chain's supported EVM capabilities; the shipped templates retain the conservative London target. - Bytecode is checked against the node's supported opcode set. - EIP-170 and EIP-3860 size limits are enforced. The compiler is either the **official solc 0.8.26**, downloaded on request and accepted only if its SHA-256 matches the pinned value `537fd8d8…eb67` (from binaries.soliditylang.org), or a `solc.exe` you choose yourself. ## Deploy and verify Every deployment goes through the normal **confirmation dialog** (all parameters, fee and chain ID) and your **password**. Custom code is clearly **labelled unaudited** — you are responsible for what it does. After deploying, the wallet verifies the contract and tracks it. For WASM, choose C++ or C#, run **Check connected chain**, compile with the matching toolchain, inspect the generated ABI and constructor arguments, simulate and deploy. The module uses `wasm-vm/v1`; its Solidity ABI works in the contract console and ordinary EVM application libraries. Studio verifies its module identity using the deployment record, as described in [WASM verification](../contracts/wasm/deployment-and-verification.md). !!! note "Seven languages" Through the Studio, PQWERAI supports seven contract languages (Solidity, Yul, Vyper, Huff, Fe, and C++/C# for the WASM VM), each checked against the chain's own EVM and WASM VM. See the [EVM language center](../contracts/languages/index.md) and [C++ / C# WASM guides](../contracts/wasm/index.md). # Tokens # Tokens The **Tokens** page lists the ERC-20 and ERC-721 tokens held by the selected account, shows balances, and lets you transfer them. ## Discovery and balances The wallet discovers tokens and reads their balances directly from their contracts over JSON-RPC. ERC-20 fungible tokens show a numeric balance; ERC-721 collections show the items (NFTs) you own. The reads are done with **bounded ABI string decoding**, so a contract cannot return an oversized or malformed name or symbol to disrupt the wallet. ## Transfer a token Select a token and choose **Transfer**: - For an **ERC-20**, enter the recipient and an amount. The amount respects the token's decimals and is handled as an exact integer of base units. - For an **ERC-721**, pick the item (token ID) and the recipient. As with sending tPQAI, the transfer goes through the standard **confirmation dialog** (all parameters, fee and chain ID) and your **password**, and it is only signed on an [approved node](network-and-node.md). ## Tokens you deploy When you deploy a token or NFT collection from [Contract Studio](studio.md), the wallet verifies the on-chain code and then **adds the contract to the Tokens page automatically**, reading back its name, symbol, supply and owner. ## Token safety The wallet shows **warnings for suspicious token names and approvals** so a token cannot impersonate another by its name alone. It also supports wrapping and unwrapping the native **tPQAI** token. Always confirm a token's contract address, not just its displayed name, before trusting it. # Transactions and status # Transactions and status The **Transactions** page is the history of everything this wallet has signed, with a live status for each entry. ## The status lifecycle Each transaction moves through three stages: | Status | Meaning | |---|---| | **Pending** | Signed and broadcast, not yet in a block. | | **Confirmed** | Included in a block and has a receipt. The block could still, in principle, be reorganised. | | **BFT-Finalized** | The block is at or below `g4_status.finalized_height` **and is still canonical**. This is irreversible under the chain's BFT finality. | !!! tip "Wait for BFT-Finalized before treating a payment as settled" "Confirmed" means a block included the transaction; "BFT-Finalized" means the network's validators have finalised that block. For anything that matters, wait for **BFT-Finalized**. Applications can check the same thing with `g4_status` — see [Finality for applications](../blockchain/finality.md). ## How history is built The PQWERAI Core node has **no address index**, so the wallet builds your history itself with an **incremental, reorg-safe block scan**: it walks new blocks as they arrive and re-checks the recent chain so that a reorg is reflected correctly rather than showing a stale result. Alongside the scan, the wallet keeps a **local journal of every transaction it has signed**. This journal is what lets the wallet show a transaction as Pending immediately, independently of the scan. ## Rebroadcast after a crash If the wallet or PC crashes after a transaction was signed but before the network accepted it, the wallet **rebroadcasts** the signed transaction from its journal when it starts again. You do not need to re-sign or resend by hand. ## Reading an entry Each row shows the direction, the counterparty address, the amount, the fee actually paid, the block, and the current status. Selecting an entry shows its hash and details. Because amounts are stored as exact integers, the values shown are exact.