Can a billion elliptic curve keys be generated on a laptop in less than an hour? I want my application to generate an EC key pair.

The first four bytes of the sha256 hash of the public key should contain a known IP address.

As hashes are one-way functions, I need to brute force this by generating four billion keys. 

Is this possible, in under an hour, on a laptop?

Openssl is not the way to do this - generating just a thousand keys takes few seconds.  Four billion would take six months at 4s/thousand.

#!/bin/bash
time for a in {0..999} ; do
  openssl ecparam -genkey -name secp256k1 -noout -out key.priv.pem
done


Is openssl doing something which is unnecessary in making keys just to check the hash?
The very fastest elliptic curve algorithms can generate a key-pair in about 40k cycles on a modern CPU. A high end laptop has four cores running at about 3 GHz, so it can generate about 300k key-pairs per second, or a billion per hour. (The cost of SHA-256 is negligible in comparison.)

However, secp256k1 is nowhere near the fastest curve. It takes 10 times as long to generate a key-pair with many algorithms, according to the above link, so it would likely take tens of hours at least to iterate the search space. A more mainstream laptop and you may be looking at several days.

So if you just brute force generate key-pairs looking for a matching one, you can't get it done in an hour even with a much better implementation (unless you get lucky).