Technical › Keys & addresses

Private keys

The spend key b, the view key a and their public halves B and A

In short

A Monero wallet is a pair of scalars: b (private spend key) and a = Hs(b) (private view key). Their public versions: B = b·G and A = a·G. An address is simply B and A written together.

The spend key

The private spend key b is a random scalar modulo l. In the classic format, the 25-word seed is b, just written in words. Generation:

  1. take 32 random bytes (or more, for uniformity);
  2. read them as a little-endian number;
  3. reduce modulo l (sc_reduce32).

The spend key is needed for two things: computing a one-time output's private key (to sign a spend) and computing the key image.

The view key

The private view key could be an independent random number, but standard wallets derive it from the spend key:

a = Hs(b) = Keccak256(b) mod l

That's why a single seed is enough to restore both keys. The view key is used when scanning the blockchain: for each transaction the wallet computes the shared secret 8·a·R and checks whether an output is addressed to it (details in one-time addresses).

Public keys

B = b·G      A = a·G

Two curve points, 32 bytes each. They aren't secret: your address is made of them.

bprivate spend aprivate view Bpublic spend Apublic view Hs ·G ·G

Who can do what

You haveYou canYou can't
A, B (address)send money to this walletsee anything
a, B (view-only)find incoming outputs and their amountsspend; reliably see spends
a, beverything—
What changes with Carrot

With Carrot the key hierarchy gets deeper: separate keys for "see incoming", "see everything", "generate key images". For existing wallets, a and b keep working.