pub fn peer_id_to_offchain_key(peer_id: &PeerId) -> Result<OffchainPublicKey>
Converts a PeerId to an OffchainPublicKey.
This is a standalone utility function, not part of the API traits.