Post
Topic
Board Armory
Re: Risk of Exporting Wallet
by
goatpig
on 16/09/2014, 14:07:28 UTC
TLDR: if you expose a private key from your wallet's chain, the wallet is fully compromised, period.

The extention code uses a modulo multiplication to get privKey N+1 from privKey N. The multiplier is pubKey N XOR chaincode.

So if:

a = privKey N
A = privKey N+1
M = pubKey N XOR chaincode
G = secp256k1's order

We have:

A = a * M (mod G)

This is also true:

A * M^-1 (mod G) = a * M * M^-1 (mod G) = a

Sure you can't get pubKey N from pubKey N+1, but that's irrelevant in our case. A single private key N and your chaincode will reveal all private keys past N. Any private key N + chaincode + all your public addresses from 0 to N-1 will reveal your entire wallet.

Since the chaincode always comes with the precomputed public keys, it is safe to assume that if an attacker can get your chaincode, he can also get your public keys. If he gets access to a single private key, you are kebab. So just don't do it. Private keys are meant to remain private.