Skip to content
Available on private testnetTestnet: local RPC acceptance; extension UI not executedMainnet: Not availableSoftware: Core bad4a06ea · protocol pqwerai-v8-testnet/1Updated

MetaMask

PQWERAI uses Ethereum accounts, 18-decimal PQAI, 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.

Start the local connection

Start an initialized disposable network using the integration controller. Then run this command from the repository root in Linux/WSL:

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 PQAI
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 future public-testnet target 20777 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:

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://<extension-id> or moz-extension://<extension-id> 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:

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:

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, switch network, watch an ERC-20 asset.


Found a problem? Report a documentation issue · Build testnet-rc1+7a33c77104