Docs · Guides

Export and use a read-only key

Export your account's read-only key, hand it to an accountant or auditor, and open someone else's account from one, in the app or from code.

A read-only key opens a Mesa account's whole history and can spend nothing. It is how you show your books to someone: an accountant, an auditor, a counterparty doing diligence, or your own reporting system.

What the key opens

Whoever holds it can read, for that account:

  • every balance, per asset;
  • every order, with its batch, its fill and its price;
  • every position, with its collateral, debt or size, and health;
  • every share of every pool and vault;
  • the full history: each deposit, order, fill, supply, loan, renewal, repayment and withdrawal, with amounts, times and transaction signatures.

It covers the account's past and everything the account does afterwards. It cannot place, move, repay or withdraw anything, and it cannot be turned into a key that can. See Keys and disclosure.

Export it

1. Open Portfolio, connect and read your account.
2. In the "Read-only key" panel, press "Export read-only key".
3. Press "Copy".

The key is one base58 string. Send it the way you would send any confidential document: whoever reads it reads the account.

Open an account from a key

1. Open Portfolio. No wallet is needed.
2. In the "Read-only key" panel, paste the key under "Open an account from a read-only key".
3. Press "Open".

The page is marked Read-only and shows the account as its owner sees it: balances, orders, positions, shares and history. The notes are fetched from the chain and decrypted in the reader's browser or process. Every action is off, and the Deposit and withdraw panel reads "A read-only key cannot move funds."

Press Back to my account to leave it. From code, openReadOnly(null) does the same.

Check what you were given

A reader does not have to take the account's figures on trust. Every entry of history carries the Solana signature of its transaction and, for a batch action, its batchNumber.

  • Open the batch at /batches/<batchNumber> and find the order among its opened orders: the side, amount, limit and fill match the account's entry.
  • Open the signature in an explorer: the transaction exists and is a Mesa transaction of that time.

The balances are the sum of the account's unspent notes. Each note is a commitment in the Privacy Rings state tree, and the key derives the nullifier that would mark it spent, so the reader's client checks each note's existence and that it is unspent against the chain.

Keys for one position

Handing a single position to the watcher uses a narrower key: that position's own, which reads and renews that position only. It is created when you press Let the watcher renew. See Keep positions renewed.