2

As far as I know electrum-words generate private spend key. private view key is Keccak_256(private spend key). So how is it possible that if I calculate library function Keccak_256 (Crypto++) on my private spend key, I get something different then my actual private view key?

jakob
  • 123
  • 3

1 Answers1

3

There's an additional step performed, called "normalization". It's just a modulo operation with l. See sc_reduce32 ... is it really supposed to be that complicated?

Oh and note that mnemonic is decoded to seed and then:

spendkey = sc_reduce(seed)

viewkey = sc_reduce(keccak(spendkey))

New versions of wallets roll a random 256bits, normalize it and use that as seed so the below holds true:

seed == sc_reduce(seed)

See Why did monero-wallet-cli restore the same wallet with different mnemonic seeds?

JollyMort
  • 20,004
  • 3
  • 49
  • 105