> For the complete documentation index, see [llms.txt](https://docs.minervachain.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.minervachain.org/protocol/pq-accounts.md). Agents can also search and read this documentation through its [MCP server](https://docs.minervachain.org/~gitbook/mcp).

# Post-quantum accounts

Every Minerva account is a `MinervaAccount` smart contract controlled by an ML-DSA-65 key pair. The user sees a normal `0x` address; quantum resistance lives in the validation logic, not in a new address format.

## The address

The address is computed with `CREATE2` from three fixed inputs: the canonical factory at `0x…0203`, the owner's ML-DSA-65 public key, and a salt (zero for a wallet's first account). It therefore exists the moment the key pair exists:

```
address = CREATE2(factory 0x…0203, salt, keccak256(accountCreationCode ‖ publicKey))
```

Because the factory address and the creation code are the same on every Minerva network, one key gives the same address on the mainnet, the testnet and a devnet. A testnet account carries over to the mainnet unchanged.

## Counterfactual and deployed

An account has two states:

* **Counterfactual** (the wallet shows "Undeployed"). No code at the address yet. The account can already receive MRV and tokens, and it can already **spend**: the node binds a native transaction from an undeployed address to the `CREATE2` derivation of its public key and salt, and executes the call directly. This is how a fresh mainnet account makes its first transaction without a faucet or a deployer.
* **Deployed.** The contract exists at the address. It holds the account's control record, can rotate its key, enrol device keys and execute through the contract's own entry points. Deployment is a call to the factory's `createAccount(salt, publicKey)`, paid by the account itself (or by the faucet on the testnet). Minerva Wallet deploys automatically before the first key rotation.

## Keys

|             |                                                   |
| ----------- | ------------------------------------------------- |
| Scheme      | ML-DSA-65 (FIPS 204, NIST security level 3)       |
| Public key  | 1,952 bytes                                       |
| Signature   | 3,309 bytes                                       |
| Private key | derived from a 32-byte seed held by the wallet    |
| Commitment  | `keccak256(publicKey)`, what the registries store |

The node's verifier is the Cloudflare CIRCL implementation, exposed at precompile `0x…4D00` with the ABI `(bytes publicKey, bytes message, bytes context, bytes signature) → (bool valid)`.

## What the account can do

| Operation                                          | Signed by           | Effect                                                                                                  |
| -------------------------------------------------- | ------------------- | ------------------------------------------------------------------------------------------------------- |
| Native transaction (`MinervaPQTxV1`)               | control key         | any call, value or contract deployment; gas charged to the account                                      |
| `executePQ(target, value, data, nonce, signature)` | control key         | execute from the deployed contract with an in-contract nonce                                            |
| `rotatePQKey(newPublicKey, nonce, signature)`      | current control key | new key, policy version +1, same address                                                                |
| `enrollDeviceKey` / `revokeDeviceKey`              | control key         | scoped secondary keys, see [Account control](https://docs.minervachain.org/protocol/account-control.md) |
| EIP-1271 `isValidSignature`                        | n/a                 | lets contracts verify a message signed by the account                                                   |

There is no ECDSA owner, no admin key and no `onlyOwner` fallback on the account.

## Security modes and readiness

Two genesis registries make an account's posture readable on-chain and only writable by the account itself: `SecurityModeRegistry` (`0x…0201`) stores the mode label and `AccountReadinessRegistry` (`0x…0202`) records readiness for `msg.sender`. Default Minerva accounts report **PQ Native**. A third party cannot mark another address as ready, so wallets and explorers can trust the labels.

## Recovery

The shipped recovery path is the **Recovery Kit**: an export of the account's key material encrypted under the wallet passcode, which restores the same address on another device. Guardian recovery (a quorum of other ML-DSA keys that can rotate the control key after a delay) is specified but not deployed; it changes the account bytecode and therefore every address, so it ships only with a planned genesis change. See [Security, recovery and key rotation](https://docs.minervachain.org/use-minerva/security-recovery.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.minervachain.org/protocol/pq-accounts.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
