QRDXDocs

Accounts

One ledger for classic and post-quantum accounts, and the 20-byte account id that joins them.

QRDX has two kinds of credential:

AddressBytesSignature
Classic0x… (EIP-55)20secp256k1, signer recovered from the signature
Post-quantum0xPQ…32ML-DSA-65, public key sent with the signature

The EVM, Solidity's address type and every Ethereum tool are 20-byte addressed, so a 32-byte account could never be named by a contract. QRDX solves this with an account id.

The account id

The ledger is keyed by a 20-byte account id, derived from the address and never stored or registered:

classic       0x + 40 hex   →  itself
post-quantum  0xPQ + 64 hex →  keccak256("QRDX-ACCOUNT-ID-v1:pq:" ‖ 32 address bytes)[last 20 bytes]

So 0xPQF024…aCbc and its account id 0x3583…0942 are the same account: a contract paying the account id credits exactly the balance the post-quantum key controls. Because the id is a pure function, there is no registry that could be missing on some node.

RPC
qrdx_getAccountId
params⌘/Ctrl + Enter to run

Run sends this request from your browser to https://test.qrdx.org/rpc.

You want toUse
Send QRDX from MetaMask to a post-quantum accountits account id (an ordinary 20-byte address)
Read a post-quantum account's balanceeth_getBalance with either form
See the post-quantum account in a contractmsg.sender is its account id

A deliberate trade-off

Truncating to 20 bytes gives about 80 bits of collision resistance (grinding two keys to one id), the same bound as Ethereum. It does not weaken the post-quantum property: a spend still needs an ML-DSA-65 signature, and attacking a specific existing account is a 160-bit second-preimage problem.

Two accounts per wallet account

Each QRDX Wallet account has both credentials, and on QRDX they are two ledger accounts: the 0x address, and the 0xPQ address's account id (pqAccountId). They have separate balances.

  • eth_sendTransaction spends from the 0x account.
  • Exchange operations and qrdx_sendPQTransaction (type 0x51) spend from the post-quantum account.

To trade, fund the 0xPQ… address. The explorer shows one history for both forms of the same account.

Sub-accounts and vaults

A post-quantum account can open up to 20 sub-accounts (SUBACCOUNT_CREATE, with an optional name of up to 32 characters that cannot be changed later). Each is a separate ledger account with its own balances, perps margin, orders and positions, at an address no key holds:

0xSUBA + blake2b("subaccount:" ‖ master ‖ ":" ‖ index, 18 bytes)

Only the master's signature moves it: SUBACCOUNT_TRANSFER moves QRDX or a token in (to_sub) or out (from_sub), and an exchange transaction the master signs with the sub-account as sender trades as it. A sub-account pays its own gas, so it needs some QRDX before it can trade. Funds go from one sub-account to another through the master: two transfers, which QRDX Trade sends with one approval.

A user vault (0xUVLT…, VAULT_CREATE) works the same way for its leader, except that others deposit into it for shares, and its leader pays its gas.

Protocol accounts

The protocol holds balances under addresses that no key can sign for. Each is a prefix plus 36 hex characters:

PrefixHolds
0xPOOL…a pool's reserves
0xCLOB…an order book's escrow (funds of resting orders)
0xPERP…all perps collateral (the clearinghouse)
0xSUBA…a sub-account, signed for by its master
0xUVLT…a user vault, traded by its leader
0xHLPV…the perps backstop vault; 0xPROT… owns the protocol's own vault shares
0xFEES…the stakers' share of trading fees, until an epoch pays it out
0xVETO…QRDX locked against governance proposals
0xBRDG…the bridge's mint authority
0xQNSA…QRDX names' mint authority

Multisigs have their own derived form, 0xPQMS…, signed for by their members. All of these appear in trades and transfers, and the explorer opens each as an account; the wallet refuses them as recipients.

On this page