use fingerprint of public key as network id

also generate a key pair in case none exists yet