Short answer: if you compare the speeds on x86, the maximum cost in PHP of 31 (2^31 iterations) would be secure enough for a strong (random 8 char) password. Not that it would be usable, one hash would take ~ 200 hours to generate on a desktop.
Long answer:
(large margin of error due to lack of accurate hash performance data, no specifics on password strength and lazy approximation.)
The cost of raw brute-force can vary with a factor of billions between a 6 letter password and a length 10 password with numbers and special chars. (26^6 = 3.0E+8 for lowercase, 94^10 = 5.3e+19 for mixalpha-num-all) Hashing speeds can vary with implementation.
So if the user picks one of the 1000 most commonly used passwords, it's as good as a 3 digit pin number, making the question practically irrelevant.
To this end, the answer is "as much as you can, we can't save everyone from themselves"
But let's make a back-of-the-napkin calculation to get an idea. Let's assume the database sets a strong minimum requirement of "as good as 8 random chars"
With a character set of all lower- and uppercase ASCII chars, all digits and special characters that would come to 6161234432565770 combinations
Now let's get an idea of the hashes' performance. The only side-by side comparison i could find that came close was this:
https://pthree.org/2014/12/26/sha512crypt-versus-bcrypt/
It states that the default work factor of 10 is about equal to 80.000 rounds of SHA512crypt
.
Now SHA 512 only costs about 120% of the time 256 takes
So that makes bcrypt with cost(10) approximately equal to 100.000 rounds of SHA256.
BCrypt's cost is defined like this:
The two digit cost parameter is the base-2 logarithm of the iteration
count for the underlying Blowfish-based hashing algorithm and must be
in range 04-31, values outside this range will cause crypt() to fail
cost(10) = 2^10 = 1024 iterations. so bitcoin's algorithm SHA256 is about 100x faster per iteration.
Assuming BitCoins network can do 2.14E+18 SHA256/second, that would come down to 2.14E+16 iterations of BCrypt/second.
The keyspace of the length-8 random password in charset mixalpha-numeric-all is about 6.16E+16
- So at 1 iteration, it could bruteforce such a password in < 3s. the minimum for PHP is a cost of 4, so 16 iterations.
- At the default cost of 10, it would take nearly an hour.
- At the maximum cost of 31 it would increase another 2^21 = 2097152 hours, which is a little under 240 years.
This is quite an infeasible brute-force, and could for the moment be considered secure.
The maximum amount of 'cost' in BCrypt would suffice against the entire current BitCoin network if the password is moderately strong.
However, the comparison of BCrypt vs SHA512 mentions cost(20) already takes > 3 minutes on a workstation, making such large costs impractical for now.
extrapolating 2^12*3.12/60 =~ 213 hours